Ask again after a malformed tool call instead of failing the step #212

Merged
cmoriarty merged 1 commit from malformed-tool-call-continues into main 2026-10-18 15:54:38 -04:00
Owner

Closes #211. OpenSpec change openspec/changes/malformed-tool-call-continues (validates --strict).

On run 79, fastllm ended a turn with Invalid tool call: malformed_tool_block ... (Tool 'read' contains malformed parameter markup). opencode reads that as provider.invalid-request and does not retry, and openspec.apply[all] failed at 15 of 27 tasks, then started over in a fresh session.

Now, on every backend but Free, the step notes that error from its own session. When the session goes quiet, it re-prompts the same session: "Your last tool call could not be parsed by the model server, so it did not run. Make it again with valid parameters…". This happens at most 3 times per attempt; past that the attempt ends as before. It is the same path as the output-limit cut-off re-prompt (#101).

Tests: the recorded error shape, re-prompting up to the bound, and other errors left alone. Fast lane passed: 4,505 backend, 918 vitest, browser specs.

🤖 Generated with Claude Code

Closes #211. OpenSpec change `openspec/changes/malformed-tool-call-continues` (validates `--strict`). On run 79, fastllm ended a turn with `Invalid tool call: malformed_tool_block ... (Tool 'read' contains malformed parameter markup)`. opencode reads that as `provider.invalid-request` and does not retry, and `openspec.apply[all]` failed at 15 of 27 tasks, then started over in a fresh session. Now, on every backend but Free, the step notes that error from its own session. When the session goes quiet, it re-prompts the same session: "Your last tool call could not be parsed by the model server, so it did not run. Make it again with valid parameters…". This happens at most 3 times per attempt; past that the attempt ends as before. It is the same path as the output-limit cut-off re-prompt (#101). Tests: the recorded error shape, re-prompting up to the bound, and other errors left alone. Fast lane passed: 4,505 backend, 918 vitest, browser specs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid!212
No description provided.