Skip to content

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

Description

@thdxr

Hi — we operate the OpenCode Go managed-inference API, and 1154 of your users' orgs call it through Kilo Code (UA Kilo-Code/7.5.6 ai-sdk/provider-utils/4.0.27 runtime/bun/1.3.14).

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. Kilo Code 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. hi-one-gg commented on Sep 3, 2026

    @hi-one-gg

    @thdxr Thank you for leaving an issue! I call opencode go/zen via kilo cli

  2. WnDTech commented on Sep 3, 2026

    @WnDTech

    💯 please fix this.

  3. rusagent commented on Sep 3, 2026

    @rusagent

    Need asap please.

  4. mariozelaya23 commented on Sep 3, 2026

    @mariozelaya23

    Please resolve!

  5. esfolk commented on Sep 4, 2026

    @esfolk

    Pls fix

    What do i need to do on my ends?

  6. wgomg commented on Sep 7, 2026

    @wgomg

    Has this been not updated on vscode extension?

  7. cavalia88 commented on Sep 8, 2026

    @cavalia88

    Can we please get this fixed? Need to use opencode inside kilocode for VScode

  8. esfolk commented on Sep 8, 2026

    @esfolk

    OpenCode Cli is also good, may not fit everyone's use case.

    KiloCode was slow and chunky - OpenCode Cli works smooooothh.

  9. intentionally-left-nil commented on Sep 8, 2026

    @intentionally-left-nil
    Contributor

    @thdxr thanks for the bug report. This should be fixed in kilo >= 7.5.12

    If there are any sessions with versions greater than this, we would love to know. Similarly, if anyone else watching this issue continues to have issues after updating to the latest version of kilo, please reach out.

    Cheers!

  10. oscarlocatelli commented on Sep 10, 2026

    @oscarlocatelli

    Confirming this is only partially fixed: #13752 covers the session request path, but memory consolidation still sends no header.

    On 7.5.16 with opencode-go/deepseek-flash, chat works while every turn close fails with "Memory error · ... missing x-opencode-session" (400 MissingSessionID).
    Cause: packages/opencode/src/kilocode/memory/ports.ts (memoryText()) calls generateText/streamText directly without headers, bypassing LLMRequestPrep.prepare.

    Same opencode* header logic is needed there.

  11. intentionally-left-nil commented on Sep 10, 2026

    @intentionally-left-nil
    Contributor

    @oscarlocatelli thanks for the report. I have drafted up a revised fix here: #14015
    However, I don't have an opencode go subscription on hand to test with. Are you able to build the local branch with the fix and confirm it solves your issue?

  12. oscarlocatelli commented on Sep 11, 2026

    @oscarlocatelli

    @intentionally-left-nil Thanks for the reply.
    Yes, I can confirm that the error no longer appears.

  13. hi-one-gg commented on Sep 11, 2026

    @hi-one-gg

    #13937

    @thdxr @intentionally-left-nil Please look at the issue above. kilo has not been properly modified yet and is causing conflicts with opencode.
    Unable to use kilo's memory feature when selecting opencode models

  14. WnDTech commented on Sep 11, 2026

    @WnDTech

    not sure if related but i keep getting the following when using open code go ```
    "{
    "name": "APIError",
    "data": {
    "message": "Error from provider (Console Go): Upstream request failed: [invalid_request_error] Invalid upload request.",
    "statusCode": 400,
    "isRetryable": false,
    "responseHeaders": {
    "cf-placement": "remote-ORD",
    "cf-ray": "a3993d921ffe4cb1-PHL",
    "connection": "keep-alive",
    "content-length": "211",
    "content-type": "application/json",
    "date": "Fri, 11 Sep 2026 19:57:19 GMT",
    "server": "cloudflare"
    },
    "responseBody": "{"model":"muse-spark-1.2-contributor","error":{"param":null,"type":"invalid_request_error","message":"Error from provider (Console Go): Upstream request failed: [invalid_request_error] Invalid upload request."}}",
    "metadata": {
    "url": "https://opencode.ai/zen/go/v1/responses"
    }
    }
    }

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions