microsoft / microsoft/vscode

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

Open
#329,283 1 comment 0 reactions 1 assignee Claimed by @vritant24 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

- 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:

```text
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: https://github.com/microsoft/vscode/pull/328146

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.