Skip to content

Conversation

@eYdr1en
Copy link

@eYdr1en eYdr1en commented Jan 29, 2026

Problems Fixed

1. Agent files not found for linked cases

When clicking on agent windows in the Ralph Loop wizard, users see "File not found" and "No result file found" errors for all agents.

Root cause: The ralph-wizard file endpoints only looked in ~/claudeman-cases/{name}, ignoring linked cases (external folders linked via "Link Existing").

Fix: All three endpoints now check linked cases first:

  • /api/generate-plan-detailed (for saving files)
  • /api/cases/:caseName/ralph-wizard/files
  • /api/cases/:caseName/ralph-wizard/file/:filePath

2. Execution optimizer agentType mismatch

SSE events were sent with agentType: 'execution' but files were saved to folder execution-optimizer/.

Fix: Consistent naming - SSE events now use 'execution-optimizer', frontend updated to match.

3. JSON parse "Bad control character" errors

[PlanOrchestrator] Execution optimizer JSON parse failed: Bad control character in string literal

Root cause: The tryParseJSON helper only escaped \n, \r, \t but Claude's responses can contain other control characters.

Fix: Enhanced tryParseJSON to escape ALL control characters (0x00-0x1F) using proper JSON escaping.

4. Prompts not visible while agents are running

Clicking on a running agent showed "File not found" because prompts were only saved on completion.

Fix: Prompts are now saved immediately when each agent starts, not when it completes. This allows viewing prompts while agents are still running.

Files Changed

  • src/plan-orchestrator.ts - agentType fix, JSON repair, save prompts on start
  • src/web/server.ts - linked cases support for ralph-wizard endpoints
  • src/web/public/app.js - frontend typeLabels/typeIcons update

Testing

  • TypeScript compiles without errors
  • Tested with linked case - prompts visible while agents run
  • Results saved correctly on completion

🤖 Generated with Claude Code

Two bugs were causing "File not found" and "No result file found" errors
when clicking on agent windows in the Ralph Loop wizard:

1. **Linked cases not checked**: The ralph-wizard file endpoints only
   looked in `~/claudeman-cases/{name}`, ignoring linked cases stored
   in `~/.claudeman/linked-cases.json`. Now all three endpoints check
   linked cases first:
   - `/api/generate-plan-detailed` (for saving files)
   - `/api/cases/:caseName/ralph-wizard/files`
   - `/api/cases/:caseName/ralph-wizard/file/:filePath`

2. **Execution optimizer agentType mismatch**: SSE events were sent with
   `agentType: 'execution'` but files were saved to folder
   `execution-optimizer/`. Fixed to use consistent naming:
   - SSE events now use `'execution-optimizer'`
   - Frontend typeLabels/typeIcons updated to match

3. **JSON parse errors from control characters**: Enhanced tryParseJSON
   to escape ALL control characters (0x00-0x1F), not just newlines.
   This fixes "Bad control character in string literal" errors when
   Claude's response contains backspace, form feed, or other control chars.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@eYdr1en eYdr1en force-pushed the fix/ralph-agent-file-paths branch from 503ca11 to bdf003f Compare January 29, 2026 00:55
@eYdr1en eYdr1en changed the title fix: ralph wizard agent files not found for linked cases fix: ralph wizard agent files not found + JSON parse errors Jan 29, 2026
Previously, prompt.md files were only saved when agents completed.
This caused "File not found" errors when clicking on running agents
in the UI.

Now prompts are saved immediately when each agent starts:
- Research agent
- Analysis subagents (requirements, architecture, testing, risks)
- Verification agent
- Execution optimizer
- Final review agent

The result.json is still saved on completion as before.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant