diff --git a/src/__tests__/instructionBuilder.test.ts b/src/__tests__/instructionBuilder.test.ts index eaf4cbe..8879c0e 100644 --- a/src/__tests__/instructionBuilder.test.ts +++ b/src/__tests__/instructionBuilder.test.ts @@ -821,7 +821,7 @@ describe('instruction-builder', () => { const result = buildReportInstruction(step, ctx); expect(result).toContain('## Instructions'); - expect(result).toContain('Output the results of your previous work as a report'); + expect(result).toContain('Respond with the results of the work you just completed as a report'); }); it('should NOT include user request, previous response, or status rules', () => { @@ -847,7 +847,7 @@ describe('instruction-builder', () => { const result = buildReportInstruction(step, ctx); - expect(result).toContain('前のステップの作業結果をレポートとして出力してください'); + expect(result).toContain('あなたが今行った作業の結果をレポートとして回答してください'); expect(result).toContain('プロジェクトのソースファイルを変更しないでください'); expect(result).toContain('**レポート出力:** `Report File` に出力してください。'); }); diff --git a/src/core/workflow/phase-runner.ts b/src/core/workflow/phase-runner.ts index 63c9e87..89ea741 100644 --- a/src/core/workflow/phase-runner.ts +++ b/src/core/workflow/phase-runner.ts @@ -151,6 +151,13 @@ export async function runReportPhase( }); const reportResponse = await runAgent(step.agent, reportInstruction, reportOptions); + + // Check for errors in report phase + if (reportResponse.status !== 'done') { + const errorMsg = reportResponse.error || reportResponse.content || 'Unknown error'; + throw new Error(`Report phase failed: ${errorMsg}`); + } + const outputs = resolveReportOutputs(step.report, ctx.reportDir, reportResponse.content); for (const [fileName, content] of outputs.entries()) { writeReportFile(ctx.reportDir, fileName, content); @@ -191,6 +198,12 @@ export async function runStatusJudgmentPhase( const judgmentResponse = await runAgent(step.agent, judgmentInstruction, judgmentOptions); + // Check for errors in status judgment phase + if (judgmentResponse.status !== 'done') { + const errorMsg = judgmentResponse.error || judgmentResponse.content || 'Unknown error'; + throw new Error(`Status judgment phase failed: ${errorMsg}`); + } + // Update session (phase 3 may update it) ctx.updateAgentSession(sessionKey, judgmentResponse.sessionId); diff --git a/src/shared/prompts/prompts_en.yaml b/src/shared/prompts/prompts_en.yaml index 6740d5e..a94cfa3 100644 --- a/src/shared/prompts/prompts_en.yaml +++ b/src/shared/prompts/prompts_en.yaml @@ -156,12 +156,12 @@ instruction: appendRule: "- If file exists: Append with `## Iteration {step_iteration}` section" reportPhase: - noSourceEdit: "**Do NOT modify project source files.** Only output report files." + noSourceEdit: "**Do NOT modify project source files.** Only respond with the report content." reportDirOnly: "**Use only the Report Directory files shown above.** Do not search or open reports outside that directory." - instructionBody: "Output the results of your previous work as a report." + instructionBody: "Respond with the results of the work you just completed as a report. **Tools are not available in this phase. Respond with the report content directly as text.**" reportJsonFormat: "JSON format is optional. If you use JSON, map report file names to content (file name key only)." - reportPlainAllowed: "You may output plain text. If there are multiple report files, the same content will be written to each file." - reportOnlyOutput: "Output only the report content (no status tags, no commentary)." + reportPlainAllowed: "You may respond with plain text. If there are multiple report files, the same content will be written to each file." + reportOnlyOutput: "**Respond with only the report content (no status tags, no commentary). You cannot use the Write tool or any other tools.**" reportSections: workflowContext: "## Workflow Context" diff --git a/src/shared/prompts/prompts_ja.yaml b/src/shared/prompts/prompts_ja.yaml index a238796..3223fc5 100644 --- a/src/shared/prompts/prompts_ja.yaml +++ b/src/shared/prompts/prompts_ja.yaml @@ -169,12 +169,12 @@ instruction: appendRule: "- ファイルが存在する場合: `## Iteration {step_iteration}` セクションを追記" reportPhase: - noSourceEdit: "**プロジェクトのソースファイルを変更しないでください。** レポートファイルのみ出力してください。" + noSourceEdit: "**プロジェクトのソースファイルを変更しないでください。** レポート内容のみを回答してください。" reportDirOnly: "**上記のReport Directory内のファイルのみ使用してください。** 他のレポートディレクトリは検索/参照しないでください。" - instructionBody: "前のステップの作業結果をレポートとして出力してください。" + instructionBody: "あなたが今行った作業の結果をレポートとして回答してください。**このフェーズではツールは使えません。レポート内容をテキストとして直接回答してください。**" reportJsonFormat: "JSON形式は任意です。JSONを使う場合は「レポートファイル名→内容」のオブジェクトにしてください(キーはファイル名のみ)。" - reportPlainAllowed: "本文のみの出力も可です。複数ファイルの場合は同じ内容が各ファイルに書き込まれます。" - reportOnlyOutput: "レポート本文のみを出力してください(ステータスタグやコメントは禁止)。" + reportPlainAllowed: "本文のみの回答も可です。複数ファイルの場合は同じ内容が各ファイルに書き込まれます。" + reportOnlyOutput: "**レポート本文のみを回答してください(ステータスタグやコメントは禁止)。Writeツールやその他のツールは使用できません。**" reportSections: workflowContext: "## Workflow Context"