feat(http): X-Session-Id fallback + drop workspace suffix#72
Merged
Conversation
opencode sends X-Session-Id by default via Vercel AI SDK -- recognize it as a fallback for X-Client-Session-Id so PR #71's session-resume chain works for opencode with zero config. Also drop the workspace-suffix mechanism. Per-client distinction is at the session_id level; workspace stays at server-process scope so hook state (context-intelligence) shares cleanly across client sessions. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
manojp99
added a commit
that referenced
this pull request
Jun 23, 2026
Cuts v0.9.0 release with chat-completions session resume, client-authoritative reconciliation, and zero-config opencode session continuity via X-Session-Id header. See CHANGELOG.md [0.9.0] for details: PR #71, #72, #73. Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-authored-by: Manoj Prabhakar Paidiparthy <mpaidiparthy@microsoft.com> Co-authored-by: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changed
X-Session-Idheader is now recognized as a fallback for the existingX-Client-Session-Idcorrelation mechanism (PR feat(http): session resume via X-Client-Session-Id; client-authoritative reconciliation #71). opencode and other Vercel AI SDK-based clients sendX-Session-Idby default; amplifier-agent now picks it up automatically, so session-resume + client-authoritative reconciliation works for opencode with zero config.X-Client-Session-Idremains authoritative when both headers are present.Workspace name is no longer suffixed with the client session id. Previously,
X-Client-Session-Id: abcwould route requests intoworkspaces/<base>-abc/. Now the workspace stays at<base>and per-client distinction is purely at the session_id level (workspaces/<base>/sessions/http-abc/). This keeps workspace-level hook state (context-intelligence, etc.) shared across all sessions of the same server process, where it belongs.How we discovered this
Live traffic inspection of opencode 1.17.9 → amplifier-agent confirmed the following incoming headers:
opencode sends
X-Session-Id(andX-Session-Affinitywith the same value) automatically via the Vercel AI SDK's provider-utils. It does not sendX-Client-Session-Id(our convention from PR #71), does not populate the OpenAIuserfield, and there's no plugin hook in opencode to mutate request headers.A three-line server-side change reading
X-Session-Idas a fallback unlocks the entire session-resume + client-reconciliation chain from PR #71 for every opencode user with zero config.The workspace-suffix change is a follow-on cleanup: each opencode session creates its own
sessions/http-<sid>/directory, which is sufficient per-session distinction. Putting the sid in the workspace name was fragmenting workspace-level hook state (context-intelligence, hooks config) per opencode session — not what we want.Changes
chat_completions.pychat_completions.py: fallback header read + simplified workspace logic (no suffix)test_reconciler.py: updated workspace slug assertion fromtest-ws-{sid}→test-wstest_session_id_fallback.py(new): 4 tests covering X-Session-Id-only, precedence, no-header fallback, and workspace-not-suffixed scenariosCHANGELOG.md: documented both changes under[Unreleased] ### ChangedTest evidence
Hard constraints honored