From af09bd0f5339cb5a9f9cf9a2f3c11df375cf1f14 Mon Sep 17 00:00:00 2001 From: ztimson Date: Tue, 30 Dec 2025 15:18:02 -0500 Subject: [PATCH] Small issue refiner fixes --- .github/workflows/ticket-refinement.yml | 2 +- src/refine.mjs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ticket-refinement.yml b/.github/workflows/ticket-refinement.yml index 7f7088d..87a9fc9 100644 --- a/.github/workflows/ticket-refinement.yml +++ b/.github/workflows/ticket-refinement.yml @@ -14,7 +14,7 @@ jobs: git checkout ${{ github.event.repository.default_branch }} - name: Run AI Formatter - run: npx -y @ztimson/ai-agents@latest format .github/issue_template/ai-refinement.md + run: npx -y @ztimson/ai-agents@latest refine .github/issue_template/ai-refinement.md env: AI_HOST: anthropic AI_MODEL: claude-sonnet-4-5 diff --git a/src/refine.mjs b/src/refine.mjs index 96fafbd..bedcfa2 100644 --- a/src/refine.mjs +++ b/src/refine.mjs @@ -12,7 +12,7 @@ dotenv.config({path: '.env.local', override: true, quiet: true}); (async () => { let p = process.argv[process.argv.length - 1]; if(p === 'refine' || p.endsWith('refine.mjs')) p = null; - if(!/(\/|[A-Z]:)/.test(p)) p = path.join(process.cwd(), p); + if(!/^(\/|[A-Z]:)/m.test(p)) p = path.join(process.cwd(), p); if(!p || !fs.existsSync(p)) throw new Error('Please provide a template'); @@ -83,7 +83,7 @@ ${template.trim()} Output ONLY the formatted ticket, no explanation.` }) - const messages = await ai.language.ask(`Title: ${issueData.title}\n\nDescription:\n${issueData.body || 'No description provided'}`).catch(() => []);; + const messages = await ai.language.ask(`Title: ${issueData.title}\n\nDescription:\n${issueData.body || 'No description provided'}`).catch(() => []); const content = messages?.pop()?.content; if(!content) { console.log('Invalid response from AI');