Skip to content

Reject unset {env:} references in sealed OpenCode providers - #57

Merged
LikC1606 merged 1 commit into
mainfrom
fix/sealed-opencode-env-reference
Nov 28, 2026
Merged

LikC1606 merged 1 commit into
mainfrom
fix/sealed-opencode-env-reference

Conversation

@LikC1606

Copy link
Copy Markdown
Collaborator

Summary

  • sealedOpenCodeProvider resolved a provider baseURL/apiKey written as {env:NAME} to undefined when NAME was unset, then silently fell back to the default upstream (api.openai.com / api.anthropic.com, or OPENAI_BASE_URL/ANTHROPIC_BASE_URL) and the ambient OPENAI_API_KEY/ANTHROPIC_API_KEY. Sealed formalization/review roles could therefore send requests and the host key to an endpoint other than the configured one. The configuration digest records the missing variable as null on every check, so the identity binding did not catch it.
  • Unset or empty references now throw math_sealed_provider_reference_unset.

Tests

  • New regression test in tests/sealedHarness.test.ts (fails without the fix).
  • vitest run tests/sealedHarness.test.ts tests/researchHarness.test.ts: pass (4 skipped need installed Claude Code / OpenCode).
  • tsc --noEmit -p .: pass.
  • tests/harnessProcess.test.ts "nested sandbox" fails on the test host with bwrap: execvp bun: No such file or directory (bun not installed there); unrelated to this change.

🤖 Generated with Claude Code

sealedOpenCodeProvider resolved a provider baseURL/apiKey written as
{env:NAME} to undefined when NAME was unset, then silently fell back to
the default upstream and the ambient OPENAI/ANTHROPIC credential. Sealed
roles could send requests and the host key to an endpoint other than the
configured one. Unset or empty references now throw
math_sealed_provider_reference_unset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LikC1606
LikC1606 merged commit 7d2ec1a into main Nov 28, 2026
4 checks passed
@LikC1606
LikC1606 deleted the fix/sealed-opencode-env-reference branch November 28, 2026 14:50
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