fix: ralph wizard agent files not found + JSON parse errors#5
Open
eYdr1en wants to merge 2 commits intoArk0N:masterfrom
Open
fix: ralph wizard agent files not found + JSON parse errors#5eYdr1en wants to merge 2 commits intoArk0N:masterfrom
eYdr1en wants to merge 2 commits intoArk0N:masterfrom
Conversation
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>
503ca11 to
bdf003f
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/:filePath2. Execution optimizer agentType mismatch
SSE events were sent with
agentType: 'execution'but files were saved to folderexecution-optimizer/.Fix: Consistent naming - SSE events now use
'execution-optimizer', frontend updated to match.3. JSON parse "Bad control character" errors
Root cause: The
tryParseJSONhelper only escaped\n,\r,\tbut Claude's responses can contain other control characters.Fix: Enhanced
tryParseJSONto 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 startsrc/web/server.ts- linked cases support for ralph-wizard endpointssrc/web/public/app.js- frontend typeLabels/typeIcons updateTesting
🤖 Generated with Claude Code