Skip to content

Unlock input after ACP error responses on protocol v1 - #34

Merged
domenkozar merged 1 commit into
cachix:mainfrom
gotcha:fix-v1-error-stuck
Oct 13, 2026
Merged

domenkozar merged 1 commit into
cachix:mainfrom
gotcha:fix-v1-error-stuck

Conversation

@gotcha

@gotcha gotcha commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What

The composer becomes permanently unresponsive after an agent answers session/prompt with an error on protocol v1.

Root cause

In src/session.rs, the JSON-RPC error branch only released active_work for v2 sessions. On v1 it set Status::Error but left active_work = true, and the composer is bound via .disabled(agent.active_work) — so the field stays dead until the session is restarted. The stuck flag is also persisted as was_working in the saved config.

Reproduced live: goose acp relayed a transient provider 403 as ACP error: Authentication required; the pane never accepted input again.

Fix

Mirror the v2 cleanup in the v1 branch of the error handler (clear active_work, awaiting_response, cancel_requested, active_prompt). Status still lands on Error for v1, vs Idle for v2.

Test

Added v1_prompt_error_releases_turn_and_unlocks_input: v1 agent mid-turn receives an error response with request id ≥ 3 → asserts active_work/awaiting_response cleared, active_prompt dropped, was_working false in the snapshot, and the system log entry present. cargo test --bin agentaps v1_prompt — 2 passed.

When an agent replies to session/prompt with an error on protocol v1,
only the status changed to Error; active_work stayed true, leaving the
composer permanently disabled (.disabled(agent.active_work)). Mirror
the v2 cleanup so the turn is released and the prompt can be resent.

Repro: goose acp relaying a provider failure, e.g. a transient 403
from the model gateway, shows 'ACP error: Authentication required' and
the input field never recovers.
@gotcha

gotcha commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

@domenkozar @vimjoyer This looks like a simple fix.

@domenkozar
domenkozar merged commit b382f1a into cachix:main Oct 13, 2026
@gotcha
gotcha deleted the fix-v1-error-stuck branch October 14, 2026 06:38
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.

2 participants