[recipes] Load .env into wiki-compiler child processes#235
Open
mlava wants to merge 1 commit intoNateBJones-Projects:mainfrom
Open
[recipes] Load .env into wiki-compiler child processes#235mlava wants to merge 1 commit intoNateBJones-Projects:mainfrom
mlava wants to merge 1 commit intoNateBJones-Projects:mainfrom
Conversation
spawnNode passed process.env to spawned scripts, which only contains variables present when the parent node process started. Users relying on a .env or .env.local file at the repo root had those values silently dropped in subprocesses, while the parent process loaded them via loadEnv(). Use loadEnv() for children too so env resolution matches between parent and spawned scripts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hey @mlava — welcome to Open Brain Source! 👋 Thanks for submitting your first PR. The automated review will run shortly and check things like metadata, folder structure, and README completeness. If anything needs fixing, the review comment will tell you exactly what. Once the automated checks pass, a human admin will review for quality and clarity. Expect a response within a few days. If you have questions, check out CONTRIBUTING.md or open an issue. |
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.
Contribution Type
What does this do?
Fixes an env-resolution mismatch in
recipes/wiki-compiler/compile-wiki.mjs. ThespawnNode()helper was passingprocess.envto child scripts, so any variable set in.envor.env.local(and loaded by the parent vialoadEnv()) was silently dropped before reaching the spawned subprocess. The parent would readOPENROUTER_API_KEYfrom.envand run fine; the child would seeundefinedand fail or skip silently.The fix is a one-line change: children now also receive
loadEnv()(which merges.env,.env.local, andprocess.env), matching the env resolution the rest of the script already uses.Requirements
None — no new dependencies, no schema changes. Affects only the existing
wiki-compilerrecipe.Checklist
Checklist items that don't apply: