Ask
@oddmund ·

400 MissingSessionID: x-opencode-session header not sent

Every request out of my editor started coming back with this:

400: {"type":"MissingSessionID","message":"Error from provider (Console Go): Request is missing x-opencode-session and cannot be routed efficiently."}

Nothing changed locally. The provider now requires a header called x-opencode-session on every inference request, and anything that does not send one is refused.

What makes this odd is how it is being rolled out. The same request has been filed by the vendor in one client repository after another, asking each of them to add the header: VS Code is at 93 reactions, kilocode at 68, LiteLLM at 48, then zed, the Vercel AI SDK, LangChain.js and several model vendors' own repos. Their VS Code issue says 1,685 customer organisations reach them through Copilot Chat, which does not send it in any version.

So it is not a bug in one client. It is a vendor asking the whole ecosystem for a vendor-specific header, and in the meantime every one of those clients is broken against them.

Is there something I set on my side today, or is waiting for a dozen separate projects to ship a header the actual plan?

22
9 answers Share
Report
Write an answer

Answering anonymously, a moderator will review it first.

  • @tarn_v · 3h ago · 2 replies

    Worth knowing the history before you treat this as settled: session header support has been added, removed and added again upstream more than once this year. Whatever you wire up today, keep it somewhere you can find in a hurry.

    16
    Share
    Reply

    Answering anonymously, a moderator will review it first.

    Report
    • @halvard · 16m ago

      Which is an argument for the proxy version rather than the editor version. One place to change, and it does not vanish in a settings sync.

      1
      Share
      Reply

      Answering anonymously, a moderator will review it first.

      Report
  • @petra_ks · 3h ago · 3 replies

    You can set it yourself in VS Code today. Custom endpoint models take arbitrary headers, so in chatLanguageModels.json add one to the model you are using:

    "requestHeaders": { "x-opencode-session": "a-stable-string" }
    

    That is documented and it clears the 400 immediately.

    27
    Share
    Reply

    Answering anonymously, a moderator will review it first.

    Report
    • @oddmund · 3h ago · 2 replies
      @oddmund OP ·

      Does the value have to be anything in particular?

      13
      Share
      Reply

      Answering anonymously, a moderator will review it first.

      Report
      • @petra_ks · yesterday

        Their own ask is a stable id per conversation, any UUID. A single hardcoded string gets you past the check, and the cost is that every conversation you have looks like one session to their router. Fine for one person, less fine for a team sharing a config.

        15
        Share
        Reply

        Answering anonymously, a moderator will review it first.

        Report
  • @lucie_bm · 3h ago · 2 replies

    For anything you cannot patch, put it in the proxy. One proxy_set_header line in front of the endpoint fixes every client on the machine at once, editors, scripts and the two tools you forgot are calling it. It is also the only version that survives the next client update.

    21
    Share
    Reply

    Answering anonymously, a moderator will review it first.

    Report
    • @mint_rooftop · 3h ago

      This is what we did after the third person on the team hit it. Ten minutes, and nobody has to touch their editor settings.

      12
      Share
      Reply

      Answering anonymously, a moderator will review it first.

      Report
  • @mint_rooftop · 6h ago

    The error text is at least honest about the reason. It is not authentication or a quota, it is routing, which tells you a constant value will do.

    14
    Share
    Reply

    Answering anonymously, a moderator will review it first.

    Report
  • @halvard · 2h ago

    The odds of a major editor adding a competitor's custom header are close to zero, so plan for that. Realistically this gets resolved either at the proxy layer or by the vendor accepting something standard, and both of those are somebody else's timeline. If your work depends on it, do not wait.

    1
    Share
    Reply

    Answering anonymously, a moderator will review it first.

    Report