Skip to content

๐Ÿ› fix(config): align model allow/block env var names + add CI - #1

Merged
kud merged 1 commit into
mainfrom
fix/env-var-name-and-ci
Jul 5, 2026
Merged

๐Ÿ› fix(config): align model allow/block env var names + add CI#1
kud merged 1 commit into
mainfrom
fix/env-var-name-and-ci

Conversation

@kud

@kud kud commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Problem

3 of 9 tests failed. The test suite set OPENCODE_MODEL_ALLOW / OPENCODE_MODEL_BLOCK (no MCP_ prefix), but src/index.ts reads MCP_OPENCODE_MODEL_ALLOW / MCP_OPENCODE_MODEL_BLOCK. Because the names didn't match, the allow/block patterns were empty at module load, so isModelAllowed allowed everything โ€” failing rejects model not in allow list, rejects disallowed model, and returns only allowed models.

Fix

The env vars are a public contract, and both the README and docs/model-filtering.mdx document the MCP_-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 to MCP_OPENCODE_MODEL_ALLOW / MCP_OPENCODE_MODEL_BLOCK.

Result: all 9 tests pass; typecheck and build clean.

CI

Added .github/workflows/ci.yml running typecheck โ†’ build โ†’ test on pull_request and push to main. Lockfile is committed, so it uses npm ci + cache: npm. Action and Node versions match release.yml (checkout@v6, setup-node@v6, Node 24).

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.
@kud
kud marked this pull request as ready for review July 5, 2026 01:37
@kud
kud merged commit b818c5f into main Jul 5, 2026
1 check passed
@kud
kud deleted the fix/env-var-name-and-ci branch July 5, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant