Repository navigation
fix(acp): keep sessions usable after provider failures - #72
Conversation
|
Confidence: 4/5The fix does what it says, in a real ACP process as well as in unit tests. The remaining doubts are the raw error text now landing in chat history and the merge conflict with #67.
Confidence bumps:
SummaryIn
Two new ACP tests (no tools, and with tools plus a completed tool preserved) check notifications, persisted tool results and a following successful turn. One new serializer test covers the id collision. Findings:
Mapflowchart LR
P[provider stream: ChunkMessage::Failed] --> R[acp/service.rs receive_prompt_stream]
R -->|break + mark tools error| T[send_tool_result: failed updates]
R -->|append error text| M[agent_message_chunk]
R -->|persist + status Idle| S[session manager / HistoryDAO]
R -->|return end_turn| C[ACP client]
O[aisdk/providers/openai.rs dedupe_responses_call_ids] -->|reserved ids| B[build_openai_messages]
Start in Regressions
MigrationsNone. Before merging
|
…led turn A provider failure reached the client, the persisted assistant message, the failed tool results and the next request as the full aisdk diagnostic (provider_step_error step stats, tool names, raw response body). Reduce it to the provider's own one-line message before streaming or persisting it, and keep the full diagnostic in the log. Skip post-turn auto-compaction when the turn failed, so compaction does not call the provider that just failed.
Resolve tests/acp_stdio.rs against Blankeos#64's mock provider harness and pass the new prompt-token argument in the provider failure tests.
Problem
Provider errors such as
No tool output found for function call call_119are currently returned fromsession/promptas an ACP internal error. That ends the interaction as a protocol failure instead of reporting a failed turn that the user can recover from.Changes
end_turn, keeping the session available for another prompt.Regression coverage
Tests cover failures before any tool runs and while a tool is pending, including client-visible notifications, persisted results, preservation of completed tools, and a successful next turn on the same connection. A serializer regression covers ID suffix collisions with out-of-order concurrent outputs.
Validation
On this branch against current upstream
main:cargo test acp::service:: -- --test-threads=1— 58 passedcargo test aisdk::providers::openai::tests:: -- --test-threads=1— 53 passedcargo fmt --checkgit diff HEAD^ --checkbash scripts/check-aisdk-boundary.shAlso synced and pushed to
yan-ad/crabcode:yan-flavorasb802f87; the flavor branch passed 72 ACP tests, 53 OpenAI tests, and all 8 ACP stdio tests. This PR contains only the fix, not the unrelated flavor changes.