Skip to content

Send x-opencode-session header on API requests (required by OpenCode Go from 09/05) #334186

Open

Description

@thdxr

Hi — we operate the OpenCode Go managed-inference API, and 1685 of your users' orgs call it through GitHub Copilot Chat (UA GitHubCopilotChat/0.63.0).

Starting 09/05, requests without an x-opencode-session header will error on our side — we need a stable per-conversation ID for routing/optimization. Copilot Chat doesn't send it in any version we've seen.

Ask: include x-opencode-session: <stable-id-per-conversation> on all outbound inference HTTP requests. Any stable UUID per conversation works. Happy to confirm from our telemetry once a build ships it. Thanks!

Activity

  1. arisng commented on Sep 7, 2026

    @arisng

    Now I'm totally stucked because of this new requirement when using GitHub Copilot CLI and VS Code 😥

  2. wjchen94 commented on Sep 7, 2026

    @wjchen94

    ????????????????????????????????????????

  3. wjchen94 commented on Sep 7, 2026

    @wjchen94

    opencode is such a shit model provider!!! You completely break down service BEFORE solving this issue??? What's the problem with you???

  4. gaaralbakuu commented on Sep 7, 2026

    @gaaralbakuu

    so bad, I also meet this error

  5. OnesoftQwQ commented on Sep 7, 2026

    @OnesoftQwQ

    Now I'm totally stucked because of this new requirement when using GitHub Copilot CLI and VS Code 😥

    You may use my extension. I have already fixed it.

  6. zd-dalibor commented on Sep 7, 2026

    @zd-dalibor

    I think the best solution will be that Anomaly dev team develop official opencode provider for the vscode chat like Ollama already did.

  7. 99991 commented on Sep 7, 2026

    @99991

    Dax (@thdxr) You should compute your own routing ids by computing a (sparse) hash over the user prompts. Your current approach is lazy, because it puts all the burden on agent developers when you could have done it yourself.

  8. wjchen94 commented on Sep 7, 2026

    @wjchen94

    you could use X-Interaction-Id from request header as session ID. Dax (@thdxr) you lazy dumb axxhole. stxpid retxrded piece of thing!!! fix this IMMEDIATELY!!! I have paied for your stxpid service!!!

  9. ankit-berlin commented on Sep 7, 2026

    @ankit-berlin

    This is horrible. I am so stuck with it. Can you please fix it ASAP?

  10. AntonioMrtz commented on Sep 7, 2026

    @AntonioMrtz

    Can't use my Opencode GO sub in VSCode because of this. Isn't VSCode one of the most common places outside opencode-cli to use the subscription? I wonder why they apply the change knowing they will break other platforms compatibility...

  11. zeerd commented on Sep 7, 2026

    @zeerd

    Sandeep Somavarapu (@sandy081) could you please fix this ASAP?

  12. wbsch commented on Sep 7, 2026

    @wbsch

    I love everything about this.

    Opencode itself has had support for X-Session-Id anomalyco/opencode#12930 and x-session-affinity anomalyco/opencode#20744 added, then removed under unknown circumstances, then added again not even 3 weeks ago anomalyco/opencode#42694 anomalyco/opencode#43188

    And now here we see a request to add custom headers with the tool name to an entirely different harness. x-opencode-session, really?

    Since there's about as much chance of vscode adding a competitor's custom header like this as hell freezing over, you can just add the header as a static entry like this to your individual model config and continue using opencode in vscode:

    "requestHeaders": { "x-opencode-session": "ARE YOU KIDDING ME DAX" }

    Do note that this might be problematic when using the same model from two chats at once. But then you could just do the reasonable thing and cancel your subscription, which is what I'll be doing.

    So long and thanks for all the fish.

  13. 14 remaining items

  14. added
    feature-requestRequest for new features or functionality
    and removed
    staleIssues that have not been triaged in an appropriate amount of time
    on Sep 25, 2026
  15. vs-code-engineering commented on Sep 25, 2026

    @vs-code-engineering
    Contributor

    This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  16. vs-code-engineering commented on Sep 26, 2026

    @vs-code-engineering
    Contributor

    🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

    Happy Coding!

  17. verdverm commented on Oct 2, 2026

    @verdverm

    🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog.

    Confirmation that leaving Copilot for the OpenCode harness was one of the best decisions ever. Microsoft is too big to succeed

    Like, how hard is it to proxy a header... is co-prev-it not as good as it is claimed to be, similar for microsoft at ai...?

  18. daohunliwei commented on Oct 27, 2026

    @daohunliwei

    but how make visual Studio 2026 work????

  19. VariableVince commented on Oct 30, 2026

    @VariableVince

    I'd love to try the Github Copilot App, but can't because of this. Opencode Desktop v2 is a deeply bugged mess and while Opencode Go is a keeper for now, their apps aren't. Not many good other options besides Orca. Or hopefully Github Copilot App in the near future. I don't get why this should take so long.

    All we'd need is dynamic custom header support, to send the actual session id in the custom header: github/app#3493

  20. code-martin commented on Nov 1, 2026

    @code-martin

    For anyone running into this with OpenCode X/Go:
    the 502/400 is caused by the missing x-opencode-session routing header.

    While waiting for official support, you can patch it dynamically using this workaround:
    https://github.com/code-martin/vscode-copilot-opencode-session

  21. VariableVince commented on Nov 1, 2026

    @VariableVince

    Yeah no, i'm not using all kinds of extensions or scripts from unknown sources. Too unsafe. Waiting for official support #334186 (comment)

  22. code-martin commented on Nov 1, 2026

    @code-martin

    28. Yeah no, i'm not using all kinds of extensions. Too unsafe. Waiting for official support #334186 (comment)

    Just to clarify: it is not a new extension, just a small Node script that adds the missing header directly to Copilot for those who need a workaround right now. Waiting for the official fix makes total sense too!

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions