๐ fix(config): align model allow/block env var names + add CI - #1
Merged
Conversation
The test set OPENCODE_MODEL_ALLOW/BLOCK while the source and docs use the MCP_-prefixed names, so allow/block patterns were empty at module load and isModelAllowed allowed everything โ 3 failing tests. Align the test with the documented MCP_OPENCODE_MODEL_ALLOW/BLOCK contract. Add a CI workflow running typecheck, build, and test on pull_request and push to main.
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
3 of 9 tests failed. The test suite set
OPENCODE_MODEL_ALLOW/OPENCODE_MODEL_BLOCK(noMCP_prefix), butsrc/index.tsreadsMCP_OPENCODE_MODEL_ALLOW/MCP_OPENCODE_MODEL_BLOCK. Because the names didn't match, the allow/block patterns were empty at module load, soisModelAllowedallowed everything โ failingrejects model not in allow list,rejects disallowed model, andreturns only allowed models.Fix
The env vars are a public contract, and both the README and
docs/model-filtering.mdxdocument theMCP_-prefixed names โ which is also what the source already ships to real users. So source + docs are the source of truth; the test was the odd one out. Aligned the test toMCP_OPENCODE_MODEL_ALLOW/MCP_OPENCODE_MODEL_BLOCK.Result: all 9 tests pass;
typecheckandbuildclean.CI
Added
.github/workflows/ci.ymlrunning typecheck โ build โ test onpull_requestand push tomain. Lockfile is committed, so it usesnpm ci+cache: npm. Action and Node versions matchrelease.yml(checkout@v6,setup-node@v6, Node 24).