Skip to content

[Bug]: ACP prompt RPC errors leave unstarted foreground tools pending #37536

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. An ACP agent receives session/prompt and emits a foreground tool_call with status pending.
  2. The agent replies to that prompt with a JSON-RPC error before starting the tool.
  3. The turn fails, but inspect the tool item: it remains pending. This reproduces with followAgentWorkState disabled and enabled.

The linked fix PR includes a deterministic subprocess mock and a public adapter-event regression test. Run:

pnpm exec vp test run apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts -t 'ends an open tool call when its prompt returns an RPC error'

Expected behavior

A foreground tool that never started ends as failed when its owning prompt fails. Actually started/background work remains visible and stoppable.

Actual behavior

The turn becomes failed while the tool's last event is still pending. The adapter skips foreground cleanup for AcpRequestError, and finalization clears the active turn. A subsequent update cannot settle that turn's item. The stale tool can be interpreted as continuing work on recovery.

This differs from merged #37377, which closes tools after process death and deliberately exempts RPC errors to preserve continuing work. It also differs from #37367, which concerns a successful DONE response with the run still running.

Impact

Minor bug or occasional failure

Version or commit

main @ 3cf00c3

Environment

Linux, local ACP subprocess fixture. Both production work-state modes. Real-agent incidence has not been measured.

Logs or stack traces

Main, both work-state modes: tool statuses [pending], turn terminal failed.
Fix, both work-state modes: tool statuses [pending, failed], turn terminal failed.

Workaround

No verified workaround. Found by the Pi and ACP Improvements hunt with GPT 6.1 Sol; independently confirmed by Claude Opus 5.5 on fresh main. No UI capture or real-client reproduction is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions