Skip to content

[Agent Host BYOK] Responses reasoning continuation loses its stateful marker #329283

Closed

Description

@sgent-epic
  • Copilot Chat Extension Version: 0.60.0
  • VS Code Version: 1.132.0
  • OS Version: Windows 11 x64 (build 26100)
  • Feature: Agents window, agent mode
  • Selected model: Reasoning-capable extension-contributed BYOK model
  • API: OpenAI Responses-compatible

Does this issue occur when all extensions are disabled?: No. The reproduction requires the built-in Agent Host and an extension-contributed BYOK provider.

Description

A multi-turn Agent Host BYOK request can lose its stateful_marker between the initial response and a tool continuation.

The initial request succeeds and reaches the configured provider. The provider returns a response ID, and the extension emits a stateful_marker data part.

During the next continuation attempt:

  • The request re-enters the extension with no stateful marker.
  • No subsequent outbound provider request is sent.
  • Agent Host retries the same deterministic failure five times.
  • The final error is:
502 OpenAI Responses reasoning tool continuation is missing its state marker. Start a new chat.

The total retry delay was approximately 32 seconds.

Steps to Reproduce

  1. Configure an extension-contributed BYOK model backed by an OpenAI Responses-compatible endpoint.
  2. Open the Agents window and select the model.
  3. Send a request that causes the model to use a tool.
  4. Allow the tool result to continue the same turn.
  5. Observe the continuation failure and repeated local retries.

Expected Behavior

The stateful marker should be preserved across the Agent Host bridge and supplied to the next reasoning or tool continuation.

If the marker cannot be preserved, the request should fail once with a clear diagnostic instead of retrying the same deterministic failure.

Actual Behavior

The initial request succeeds and emits a stateful marker. The marker is absent when the continuation re-enters the extension, and the Agent Host retries the failure five times.

Additional Context

This appears specific to the Agent Host BYOK Responses path. The observed request sequence places the loss after the extension emits the marker and before the next provider request.

Related implementation work: #328146

Activity

  1. sgent-epic commented on Aug 20, 2026

    @sgent-epic
    ContributorAuthor

    Revalidated on 2026-08-19 with provider extension 0.6.4 built from commit f367c270d600f271f608b15ce6fd494bf393a5c3.

    Host Provider routing Built-in file read Marker on provider response Marker on tool continuation Usage Result
    Stable 1.133.0, a5b5009 Pass Pass Emitted Missing Present Fail
    Insiders 1.134.0-insider, 661f18f Pass Pass Emitted Missing Present Fail

    Sanitized diagnostics show the same sequence on both hosts:

    1. The Responses request completes with a response ID.
    2. The provider generates and emits its stateful marker.
    3. The built-in view tool reads package.json successfully.
    4. The next provider invocation has activeToolTurn=true but statefulMarkerCount=0. Its messages contain the assistant reasoning and tool call plus the user tool result.
    5. The extension fails before sending another outbound Responses request. Agent Host retries the deterministic failure five times.

    Stable reported 30.59 seconds of retry wait. Insiders reported 29.10 seconds. This confirms the issue remains reproducible in both current Stable and Insiders.

  2. added a commit that references this issue on Oct 8, 2026
    636f811
  3. added this to the 1.142.0 milestone on Oct 8, 2026
  4. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

insiders-released

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions