nightly: Send session headers on all OpenCode requests (#63702)
Fixes #63672
OpenCode Go now requires the x-opencode-session header on every model
request. Zed previously sent the header only when a request already had
a thread ID, so inline assistance, terminal assistance, and other
standalone requests could omit it and risk rejection.
This change makes the OpenCode provider add the header to every request.
Existing thread and assist session IDs are reused when available.
Standalone requests receive a generated non-empty ID. Thread title and
summary requests now carry the thread ID so related requests keep the
same session scope.
The change also adds tests for missing, empty, and invalid IDs, plus a
wire-level test that verifies the header reaches the HTTP client. The
provider test file stays separate so the implementation remains under
1,000 lines.
Testing:
cargo fmt --all -- --check- Focused OpenCode, thread summary, and thread title tests
cargo check -p agent_ui -p sidebarGITHUB_ACTIONS=1 ./script/clippy -p language_modelsgit diff --check
Release Notes:
- Fixed OpenCode Go requests that could fail when Zed omitted the
session header.
Co-authored-by: Kirill Bulatov kirill@zed.dev
Co-authored-by: Christopher Biscardi chris@christopherbiscardi.com