Skip to content

fix: strip copilot response item ids - #32451

Closed
wgu9 wants to merge 2 commits into
anomalyco:devfrom
wgu9:fix-copilot-response-itemid-reuse
Closed

fix: strip copilot response item ids#32451
wgu9 wants to merge 2 commits into
anomalyco:devfrom
wgu9:fix-copilot-response-itemid-reuse

Conversation

@wgu9

@wgu9wgu9 commented Jun 15, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes#31236

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Copilot Responses models persist per-connection response item handles in provider metadata. OpenCode already strips stale Responses itemId values for OpenAI, Azure, and Bedrock Mantle when store=false; this extends the same contract to GitHub Copilot by stripping openai.itemId and copilot.itemId while preserving encrypted reasoning metadata.

This prevents existing Copilot gpt-5.5 sessions from replaying stale item handles after the active Copilot Responses connection changes.

How did you verify your code works?

  • bun test test/provider/transform.test.ts
  • bun run typecheck
  • bunx oxlint packages/opencode/src/provider/transform.ts packages/opencode/test/provider/transform.test.ts (0 errors; existing warnings)
  • git diff --check

Push note: local pre-push hook requires bun ^1.3.14, but this machine has bun 1.3.11, so I pushed with --no-verify after the checks above passed.

Screenshots / recordings

Not applicable. This is provider message normalization.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@wgu9

wgu9 commented Jun 21, 2026

Copy link
Copy Markdown
Author

This is still the only open fix for #31236 and applies cleanly on current dev (re-checked against the Jun 17 transform.ts change in #32489). It reuses the existing Responses itemId-stripping path already used for @ai-sdk/openai / azure / bedrock/mantle, just adding @ai-sdk/github-copilot — stripping both the openai and copilot keys while preserving encrypted reasoning — a minimal, low-risk extension with unit coverage in transform.test.ts. Happy to rebase or adjust naming if a maintainer can take a quick look; several users in the thread hit this on every Copilot gpt-5.5 session.

@wgu9

wgu9 commented Jul 1, 2026

Copy link
Copy Markdown
Author

Closing as superseded by #34686, which fixes the underlying Copilot providerOptions namespace mismatch and also covers the stale itemId replay path. Thanks for taking this through.

@wgu9

wgu9 commented Jul 1, 2026

Copy link
Copy Markdown
Author

Superseded by #34686.

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

Labels

None yet

Projects

None yet

1 participant

@wgu9