Conversation
s0ld13rr
added a commit
that referenced
this pull request
Oct 2, 2026
…d binary - Rename x-pentestcode-* headers to x-opencode-* in request.ts (the old names were never consumed by any server) - Add session/affinity headers to core runner LLM path (auxiliary requests now carry x-opencode-session for OpenCode Go provider routing) - Move x-parent-session-id to apply to both opencode and non-opencode provider branches - Break circular import between filesystem/search.ts and filesystem.ts by importing Entry/FindInput/Match directly from @pentestcode/schema; fixes "Unexpected server error" crash in compiled binaries where the cycle left FileSystemSearch.node undefined Closes #13 Based on contributions from PR #14 (devilarch) and PR #15 (Usman0220) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
Thanks for the thorough fix, @Usman0220! Your approach of renaming all headers to I've merged a combined fix in 6cfd111 that takes your header approach plus the circular import fix from PR #14. Both contributors credited in the commit message. |
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
OpenCode Go began enforcing the
x-opencode-sessionheader on 2026-09-05 to optimize routing and prompt caching. Every request made through the built-inopencode-goprovider is now rejected:Upstream OpenCode (v1.18.x) works against the same endpoint because it sends the header natively per session. This PR ports those send points into pentestcode.
Changes
packages/opencode/src/session/llm/request.ts— replace thex-pentestcode-*headers with the canonicalx-opencode-*headers (x-opencode-session,x-opencode-request,x-opencode-client,x-opencode-project) for allopencode*providers, and applyx-parent-session-iduniformly across both provider branches (matches upstreamanomalyco/opencodebehavior).packages/core/src/session/runner/llm.ts— add the missinghttp.headerssend point (x-session-affinity,X-Session-Id,x-parent-session-id) so auxiliary/runner requests carry the session too, includingx-opencode-sessionwhen the model provider isopencode*.Why not keep
x-pentestcode-*?The
x-pentestcode-*headers were only produced inrequest.tsand consumed nowhere in this repo — swapping them for the upstreamx-opencode-*names is safe and fixes routing tohttps://opencode.ai/zen/go/v1.Testing
bun run build --single --skip-embed-web-ui), smoke test passed.opencode-go/*models now carry a stable per-conversation session ID inx-opencode-session.