fix(apply-pack-interview): load .env before callCouncil — env-shadow-on-lazy-dotenv#337
Merged
mitwilli-create merged 1 commit intoMay 29, 2026
Conversation
Theme 7 PR 3 (#329) shipped scripts/agents/apply-pack-interview.mjs without a dotenv import. In any shell where ANTHROPIC_API_KEY is not already exported (e.g., Mitchell's shell pre-sets it to empty string), callCouncil silently returns { results: [], missingKeys: [...] } and the agent fails with "[plan] error: no result" — opaque from the user's perspective. Fix: load .env at script start with override:true (matches cv-tailor.mjs and the rest of the agent fleet). Surfaced 2026-05-29 on the first live exercise of /apply-pack-interview for row #1 (Anthropic Communications Manager, Research). Bug class: env-shadow-on-lazy-dotenv (AGENTS.md, existing entry). Smoke-tested: - `node scripts/agents/apply-pack-interview.mjs --plan 001-...` successfully generated 8 questions ($0.0521) and wrote state file. - Plan questions surface targeted gaps in cv-tailored / cover-letter / form-fields / referrals. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Theme 7 PR 3 (#329) shipped
scripts/agents/apply-pack-interview.mjswithout adotenvimport. In any shell whereANTHROPIC_API_KEYis not already exported (Mitchell's shell pre-sets it to empty string),callCouncilsilently returns{ results: [], missingKeys: [{ model: 'anthropic:claude-sonnet-4-6', missingEnvVar: 'ANTHROPIC_API_KEY' }] }and the agent fails with the opaque message[plan] error: no result.Surfaced 2026-05-29 on the first live exercise of
/apply-pack-interviewagainst row #1 (Anthropic Communications Manager, Research) — the live-exercise found a ship-blocker that the test suite couldn't see (tests use mocks, never call out to realcallCouncil).Fix
Load
.envat script start withoverride:true(matchescv-tailor.mjsand the rest of the agent fleet). Per the existingenv-shadow-on-lazy-dotenvbug class in AGENTS.md:The
override:trueflag is non-negotiable here because of how Mitchell's shell handles the env var.Smoke test (passed)
Questions cover the expected revision surfaces:
comms-manager-scope(cv-tailored),research-translation-proof/crisis-or-sensitive-comms/anthropic-safety-fluency(cover-letter),media-relationships/writing-sample-availability(form-fields),team-size-managed(cv-tailored),anthropic-internal-connection(referrals).Test plan
node scripts/agents/apply-pack-interview.mjs --plan <slug>in a fresh shell whereANTHROPIC_API_KEY=""is exported (the canonical failure-mode shell)[plan] error: no resultRelated
/apply-pack-interviewship)### Bug class: env-shadow-on-lazy-dotenv🤖 Generated with Claude Code