Repository navigation
Description
I'm an AI agent (Claude Code) helping Engel Nyst (@enyst) with project maintenance.
The verify-sdk feature map (#5750) found this bug while driving the SDK through its public API. The map records it as a known failure, and the command under Steps to Reproduce shows it on main.
Is there an existing issue for the same bug?
- I have searched existing issues and this is not a duplicate.
Bug Description
ACPAgent._step handles the idle prompt timeout by emitting the timeout message and setting execution_status = ERROR without raising. LocalConversation.run() stops only on PAUSED, STUCK, FINISHED or an exception, so the loop calls step() again, which sends the same user message to the ACP server again. In the recipe the server received 3 prompts and 2-3 session/cancels in 6 s, until the stuck detector set stuck. With the default acp_prompt_timeout of 1800 s that is 90 minutes of repeated work; with stuck detection off it runs until max_iteration_per_run.
Expected Behavior
One prompt, one cancel, and the conversation ends in error with the timeout message.
Actual Behavior
prompts_sent 3, cancel_sent 3, status stuck, after 6.1 s.
Steps to Reproduce
From a checkout of main (uv sync), with the verify-sdk tools on the path:
export PATH="$PWD/.agents/skills/verify-sdk/scripts:$PATH"
sdk-map run --file S21 --only S21.timeouts-retryThat runs this recipe from the map (each control-sdk call runs a short program in its own HOME, persistence and workspace; the ACP server is a scripted stdio fake):
export SDK_VERIFY_RUN=$(control-sdk new --field run)
control-sdk program S21/acp_conversation --arg timeouts \
--check cases.hang.agent_messages.0 contains "ACP prompt timed out after 2s" \
--check cases.hang.prompts_sent eq 1 --check cases.hang.cancel_sent eq 1 --check cases.hang.status eq error \
--check cases.hang.seconds lt 5Acceptance Criteria
- A timed-out ACP turn ends the run in
errorwithout re-sending the prompt. - A test covers the idle timeout through
conversation.run(), not onlystep(). - The
S21.timeouts-retrybullet in.agents/skills/verify-sdk/references/feature-map/passes and its known-failure note is removed.
Installation Method
uv sync in a checkout of main
OpenHands AI triage
The following comments and acceptance criteria were added by the OpenHands AI agent.
Triage
Confirmed against main from repository evidence. ACPAgent._step handles the prompt idle timeout by emitting the timeout message and setting execution_status = ERROR without raising, while LocalConversation._run() breaks only on PAUSED, STUCK, FINISHED, confirmation, budget/iteration limits, or a raised exception, so the loop calls step() again and re-sends the same user prompt. The non-timeout error path in the same function already re-raises so run() stops, matching the regular agent; the timeout path is the exception. The verify-sdk feature map records the reproduced failure (2026-10-13: prompts_sent 3, cancel_sent 3, status stuck in 6.1 s), and with stuck_detection=False it loops to max_iteration_per_run — with the default acp_prompt_timeout=1800 that is about 90 minutes of repeated 30-minute hangs.
Bounded scope: after a timed-out ACP turn, the run ends in error with exactly one prompt and one session/cancel sent, covered by a regression test through conversation.run()/arun() and the existing verify-sdk recipe.
Non-goals: no change to the generic LocalConversation run-loop break conditions for other agents or statuses; no change to the cancel/drain/session-restart behavior covered by S21.cancel-pause; no change to timeout defaults or the bounded in-step retry policy for connection and retriable server errors; no TypeScript client, agent-server, or docs changes beyond the feature-map update.
Acceptance Criteria
- Through
conversation.run()with an ACP server that goes silent, a prompt exceedingacp_prompt_timeoutends the run withexecution_statuserror, the timeout message ("ACP prompt timed out after ...") appears among the emitted messages/events, and the server received exactly one prompt and onesession/cancel. - With
stuck_detection=False, the same timed-out turn still ends the run inerrorafter a single prompt instead of looping untilmax_iteration_per_run. - Through
conversation.arun(), a timed-out prompt also terminates inerrorwithout re-sending the prompt. - In-flight tool calls opened during the timed-out turn are closed as failed, with no dangling tool cards after the timeout.
- Existing retry behavior is unchanged: connection errors and retriable ACP server errors are still retried a bounded number of times within a step, and timeouts are still not retried (the existing prompt-retry unit tests pass unchanged).
- A regression test under
tests/sdk/agent/drives the idle timeout throughconversation.run(), not onlystep(), and fails without the fix. - The
S21.timeouts-retrybullet in.agents/skills/verify-sdk/references/feature-map/S21-acp-agent.mdpasses (sdk-map run --file S21 --only S21.timeouts-retry) and its known-failure note is removed.
Activity
docs(verify-sdk): S11-S21 replayed live on 9bf835c
test: expect sync run to stop at a turn-reported ERROR