Merge dev to main#1356
Merged
Merged
Conversation
…esses Three consecutive planning runs on prod (2026-05-12) failed identically: MNG-741 (run 44c1bc3f) 11m "Agent completed but no PM write recorded" MNG-736 (run 98ae7010) 13m same MNG-739 (run 1534ab74) 16m same All planning/codex, all "Done." outputs. The agents finished their work but the requiresPMWrite completion gate rejected them because the sidecar evidence file was never written. Root cause: `src/gadgets/sessionState.ts` defines five sidecar env-var constants (PR / PUSHED_CHANGES / REVIEW / PM_WRITE / FRICTION). The adapter creates a temp file path for each via sidecarManager and injects it into projectSecrets. But `src/backends/shared/envFilter.ts` SHARED_ALLOWED_ENV_EXACT — the bottleneck for what reaches the subprocess engine — listed only the first three. PM_WRITE and FRICTION were silently filtered out before reaching the agent's `cascade-tools pm add-checklist` invocation, so writePMWriteSidecar hit its `path === undefined` early-return and the gate always failed. PM_WRITE fix is load-bearing (every planning run was broken). FRICTION fix is defensive (the code path has fallbacks today via getFrictionSidecarPath() and DEFAULT_FRICTION_SIDECAR_PATH, but the design intent is to flow through the env var like the others). Regression net: new "sidecar env-var allowlist invariant" describe block iterates every sidecar constant defined in sessionState.ts and asserts (a) presence in SHARED_ALLOWED_ENV_EXACT and (b) round-trip survival through filterProcessEnv. A future maintainer adding a sixth sidecar without registering it gets a precise CI failure. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ar-envvar-allowlist fix(envFilter): plumb PM_WRITE + FRICTION sidecar env vars to subprocesses (MNG-741)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Routine dev → main promotion. Single feature PR:
Commits
PM_WRITE_SIDECAR_ENV_VAR+FRICTION_SIDECAR_ENV_VARtoSHARED_ALLOWED_ENV_EXACT.sessionState.ts.🤖 Generated with Claude Code