Repository navigation
fix(core): name the binding and variable when a granted env or secret is unset - #1064
Merged
Merged
Conversation
… is unset (#1062) A granted environment binding with no default and an unset host variable failed with "Missing required environment binding", naming only the route. It now names the binding alias and the variable it reads, never a value: "Environment binding DATA_DIR reads URLCODE_DATA_DIR, which is not set. Set it in the host environment, or declare a default". The secret refusal gets the same shape, and both carry code missing-binding. The explain rule matches the new text and says how to set the variable or declare a default. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #1062
What changed
packages/core/src/router.ts: a grantedenvbinding with no default and an unset host variable now fails withRoute /api/notes: Environment binding DATA_DIR reads URLCODE_DATA_DIR, which is not set. Set it in the host environment, or declare a default(wasMissing required environment binding). The unset/empty secret refusal gets the same shape:Secret binding KEY reads API_KEY, which is not set or is empty. Set it in the host environment. Both carrycode: missing-binding. Only alias and variable names appear, never a value.packages/core/src/explain-error-rules.ts: themissing-bindingrule matches the new text; guidance says to set the variable in the host environment (or.env.localunderurlcode dev), or declare adefaultfor an env binding (a secret has none).docs/AI-AUTHORING.mdlistsmissing-bindingamong error codes;llms-full.txtregenerated;proofs/native-storage/README.mdquotes the new message.test/env-bindings.test.tspins the full message, code, route and explain match, and adds an unset/empty secret case;test/config.test.tsandtest/native-storage.integration.tsupdated from the old text.Evidence
npm run verifypassed locally (macOS).node --test test/native-storage.integration.tspassed (7/7).🤖 Generated with Claude Code