test: model OpenCode's real base headers in the plugin harness - #852
Merged
Conversation
This was referenced Aug 19, 2026
The V1 plugin harness previously returned only the plugin's header contribution. OpenCode 1.18.11 also supplies x-session-affinity and X-Session-Id, then applies model headers and plugin headers, so the old harness could make a no-op identity change appear effective. Invoke the V1 hook with its real empty output object, compose native, model, and plugin headers in wire order, and assert the exact session keys Meridian derives through real Hono requests. Keep the non-Anthropic plugin output assertion strong while proving that OpenCode's native headers remain. Use the same real proxy boundary for V2's existing realistic header rewrites. Pin detached title and summary requests to no adapter key, primary and compaction requests to the base key, and subagents to scoped keys.
rynfar
force-pushed
the
test/plugin-headers-model-real-base
branch
from
August 31, 2026 01:01
41064cf to
38d7e67
Compare
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.
Problem
The V1 plugin harness returned only the plugin's
chat.headersaccumulator. OpenCode 1.18.11 builds the actual request in three stages:x-session-affinityandX-Session-Id;model.headers;Testing only stage 3 can make an identity change look effective when OpenCode's native affinity header still keeps the request keyed. PR #845 was the concrete example.
Changes
build,title,summary, andcompaction.titleandsummaryresolve to no adapter key;compactionrequests retain the base key;#agentscope.Reflect.applyworkaround.Validation
Exact head:
38d7e6702a3903b971d20515a6e60c4a6255eef7npm test: 3,122 passed, 1 skipped, 0 failednpm run typechecknpm run buildnpm pack --dry-run --jsongit diff --check origin/main...HEADas any,as unknown as,@ts-ignore, or@ts-expect-errorTwo independent read-only reviews found no remaining blocker after the exact merge-stage and proxy-boundary repairs.