Repository navigation
Conversation
Meridian can serve providers other than Claude (for example an OpenAI GPT/Codex gateway), and OpenCode requests to those still arrive on the `opencode` adapter. The scrub exists to make OpenCode prompts look like Claude Code to Anthropic; rewriting a prompt headed to another provider only changes what the user asked for. onRequest now returns the context unchanged when `ctx.model` names a non-Claude model. Claude requests are recognised by Meridian's resolved SDK aliases (opus/sonnet/haiku/fable, optionally `[1m]`) or any id containing `claude`, so their output is byte-identical to before. A context without a model keeps the previous behaviour. AI-Tool: opencode 1.18.32 AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Platform: linux AI-Harness: Vibeterm 34e58e5 AI-Session-ID: ses_f1b57aaacffe4FrhMdS1oqKXAG
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.
Change
Meridian is gaining providers other than Claude, for example an OpenAI GPT/Codex gateway. When OpenCode talks to those, its requests still arrive on the
opencodeadapter, so this plugin would rewrite the system prompt before it reaches OpenAI. That changes the instructions the user sent and does nothing useful, because the scrub only exists to make OpenCode traffic look like Claude Code to Anthropic.With this change,
onRequestonly scrubs requests whosectx.modelnames a Claude model. That means Meridian's resolved SDK aliases (opus,sonnet,haiku,fable, optionally with[1m]) or any id that containsclaude. Other models, such asgpt-6-lunaorgpt-5.3-codex, pass through with their prompt byte-for-byte unchanged. For Claude requests the output is identical to before. A context with no model keeps the current behaviour. The README behaviour table documents the new rule.Validation
gpt-6-luna,gpt-5.3-codex,openai/gpt-5.5on both theopencodeandpassthroughadapters) failed because their prompt was rewritten.npm ci,bun test(37 pass, 0 fail),npm run build,tsc --noEmitandnpm pack --dry-runall passed.claude-*model matches the output with no model, so Claude scrubbing stays identical.This PR is AI generated, but under direct supervision and on request of @Nowaker.