Skip to content

Claude agent host: steering a running turn shows error_during_execution ([ede_diagnostic] result_type=user …) while the agent keeps working #347325

Open

Agent suggestions

Public preview

Description

@the-corp-mark
  • VS Code Version: 1.145.2 (c4453f8), macOS arm64
  • Harness: Claude agent host (Agents window), Claude Code SDK 2.1.304, model claude-opus-5-5
  • chat.requestQueuing.defaultAction: default (steer)

Steps to reproduce

  1. Send a prompt to a Claude session that takes more than a few seconds (e.g. a few tool calls).
  2. Within a few seconds, send a follow-up message, which is handled as steering.
  3. Optionally send a second steering message.

Expected

The steering message is folded into the running turn and the turn completes normally.

Actual

The turn is shown as failed with:

Error: (error_during_execution) [ede_diagnostic] result_type=user last_content_type=n/a stop_reason=null

The error is not written to agenthost.log or the Claude transcript; it is only persisted as the turn's response part in the session's agentSessionData/<id>/session.db (local_turns, state: "error"). The agent is not actually stopped: the Claude transcript shows it carrying on with the task and answering the steering message after the error is shown. Seen in three separate sessions, each time after steering within seconds of the prompt.

Logs

Clearest case, session 3: a single steer 4.7 s after the prompt, sent before the model had produced any output.

agenthost.log:

11:17:42.940 [Claude:d0f8…] queue yielded sdkUuid=request_81eb… turnId=request_81eb…
11:17:47.626 [Claude] setPendingMessages for ahp-chat:/9c17…: steering=request_7623… queued=0
11:17:47.626 [Claude:d0f8…] injectSteering: enqueued id=request_7623… sdkUuid=request_7623…
11:17:47.626 [Claude:d0f8…] queue yielded sdkUuid=request_7623… turnId=request_81eb… steeringPendingId=request_7623…
11:17:47.637 [Claude:d0f8…] result for sdkUuid=request_81eb…      ← 11 ms after the steer

Claude transcript for the same window: the prompt's API request (11:17:43.033) never gets an assistant message. The steer is appended as a second consecutive user message, a new API request is sent at 11:17:47.740 with both user texts merged, and the model replies at 11:17:53 and carries on with tool calls until end_turn at 11:21:29. The original turn was persisted as:

{"responseParts":[{"kind":"error","error":{"errorType":"error_during_execution",
  "message":"[ede_diagnostic] result_type=user last_content_type=n/a stop_reason=null"}}],"state":"error","duration":4691}

agenthost.log, session 1 (times UTC, ids shortened). The prompt was sent at 11:06:44, steers at +6 s and +12 s:

11:06:45.381 [Claude:ad5e…] queue yielded sdkUuid=request_cb23… turnId=request_cb23…
11:06:51.716 [Claude:ad5e…] injectSteering: enqueued id=request_c81e… sdkUuid=request_c81e…
11:06:51.716 [Claude:ad5e…] queue yielded sdkUuid=request_c81e… turnId=request_cb23… steeringPendingId=request_c81e…
11:06:51.728 [Claude:ad5e…] result for sdkUuid=request_cb23…      ← 12 ms after the steer
11:06:57.021 [Claude:ad5e…] injectSteering: enqueued id=request_6a46… sdkUuid=request_6a46…
11:06:57.021 [Claude:ad5e…] queue yielded sdkUuid=request_6a46… turnId=request_cb23… steeringPendingId=request_6a46…
11:06:57.029 [Claude:ad5e…] result for sdkUuid=request_c81e…      ← 8 ms after the steer

Session 2 (a different chat, the previous day) has the same pattern, with steers at +5 s and +28 s:

17:29:03.880 [Claude:d0f3…] queue yielded sdkUuid=request_59c2… turnId=request_59c2…
17:29:08.238 [Claude:d0f3…] injectSteering: enqueued id=request_3cee… sdkUuid=request_3cee…
17:29:08.250 [Claude:d0f3…] result for sdkUuid=request_59c2…      ← 12 ms after the steer
17:29:31.126 [Claude:d0f3…] injectSteering: enqueued id=request_97e5… sdkUuid=request_97e5…
17:29:31.132 [Claude:d0f3…] result for sdkUuid=request_3cee…      ← 6 ms after the steer
17:29:41.001 [Claude:d0f3…] result for sdkUuid=request_97e5…

That turn also ended in the error state in the session view (I did not capture its error text).

Both failing turns also start with a resume rebuild that logs _processMessages crashed: Error: Claude SDK stream ended without a result message (as in #339309). The rebuild is probably not the cause on its own: in the same log it happens before most turns, and turns where I did not steer (10:50, 10:57 and 11:03 in session 1's chat) completed normally after it.

Likely cause

Each steering message makes the SDK end the in-flight request immediately: result arrives within milliseconds of injectSteering. The SDK reports a turn that ends on a user message, before the assistant has replied, as error_during_execution with the internal [ede_diagnostic] result_type=user … marker. The agent host then shows that as a turn failure, although it is an expected consequence of steering.

The SDK side of this is already reported upstream: anthropics/claude-agent-sdk-typescript#366 (interrupting during the thinking phase yields exactly result_type=user last_content_type=n/a stop_reason=null as is_error) and anthropics/claude-agent-sdk-typescript#405 (the same during a tool call, and the internal [ede_diagnostic] marker leaking to SDK consumers). Both are open. Until the SDK changes, the agent host should treat this result after an injectSteering as an expected interruption rather than a turn failure, as other SDK clients do, e.g. rfairburn/pi-review-gate#305 (steering) and alvag/atelier#176 (interrupt).

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions