Skip to content

Background sub-agent stream failures end the turn without a failure status #4911

Description

@kondv

Type: Bug

Copilot CLI Version: 1.0.84-5 (also observed on 1.0.81-0 and 1.0.79-9)
OS Version: Windows 11 x64
Model: gpt-6-astra (also observed on an Anthropic model)

Summary

When a model stream ends early, the CLI reports five retries with 5-6 seconds of total retry wait, then stops the background sub-agent's turn. The parent receives a normal completion/idle notification without a failure status.

Found five occurrences in local session history, all on background sub-agent turns.

Steps to Reproduce

No deterministic standalone reproducer yet. The observed workflow was:

  1. Start a background sub-agent on a long, tool-heavy task.
  2. A model response stream terminates early.
  3. Compare the session.error with the following completion/idle notification.

Actual Behaviour

The failing turn reports:

Execution failed: Failed to get response from the AI model; retried 5 times (total retry wait time: 5.00 seconds) Last error: Responses stream ended without a completed response (request ...)
Path Last error Reported total retry wait
Responses Responses stream ended without a completed response 5.00 s
Anthropic messages stream ended without producing a Message with role=assistant 6.00 s
Native HTTP unexpected EOF during chunk size line 5.00 s

The wait figure is not the total request duration.

The inspected subagent.completed event contains usage and timing fields, but no success/error field. In one case it arrived 14 seconds after the error, following 57 minutes and 231 tool calls. In another, the agent went idle less than a second after the error.

Expected Behaviour

  1. Propagate the failure and its error through the sub-agent completion path.
  2. Use configurable backoff for retryable stream failures, without replaying already completed tool actions.

Notes

Impact

Long background work can stop without a usable final response while the parent receives an ordinary completion/idle signal.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions