Repository navigation
fix(changes): install session change capture in isolated child agents (#1688) - #1712
carlosmoradev wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe child extension installs session-change capture only when ChangesChild-agent change capture
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Child-agent change capture is wired into the launch path, and the child marker reaches the extension. No actionable merge-blocking risk remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Child workers now send file snapshots into the parent’s change history. Existing ownership, session, and path checks constrain that flow, and no new authorization bypass was established. The remaining uncertainty concerns trust in child-supplied snapshot contents and behavior during interrupted or concurrent execution. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @carlosmoradev, thanks for picking up #1688! Heads-up so we don't step on each other: #1690 covers the same root cause, and @barbatdev already chose a direction there (forward the parent's package to children instead of growing the curated I have that fully implemented and reviewed locally as a stack of four PRs, and I'm only waiting for If both land as they are, children would install the capture hooks twice: once from @barbatdev, how would you like to sequence this? I can open the #1690 stack as soon as it's approved, or adapt to whatever order you prefer. |
|
Thanks for the heads-up and for tracing the broader root cause, @matraket! Forwarding the parent package in #1690 is definitely the right architectural call here. Curating individual child entrypoints was only a stopgap, and resolving all seven missing surfaces at once is much cleaner than patching capture in isolation. Since @barbatdev already approved #1690, go ahead with your PR stack. Once your stack lands and closes #1688, we can close this PR (or I can close it now if you prefer to keep the queue clean). I can also help test and review your stack when you open it. |
Fixes #1688
Problem
Successful native
writeandeditoperations performed by isolated workers do not appear in the parent/gentle:changesview. Parent-authored changes appear normally, but delegated source changes are missing from the view even though the files were actually modified (#1688).Root cause: The child launch path explicitly passes extensions via
childContextExtensionPaths()(child-context.tsandchild-safety.ts), but does not install the change capture hook. Change capture is registered only bygentle-shell.tsin the parent, which isolated children do not load. Although the parent runner already supports relaying child evidence, nogentleSessionChangedetails were emitted by child tool results without that capture hook.Change
extensions/child-capture.ts: installsinstallSessionChangeCapture(pi, env)whenGENTLE_PI_AGENTS_CHILD === "1", remaining completely inert in the parent to avoid duplicate handlers../child-capture.tstochildContextExtensionPaths()inextensions/gentle-agents.ts, so isolated children automatically receive the capture hook at spawn.tests/child-capture.test.tsverifying thatchild-captureis inert in the parent and registers lifecycle and tool hooks in children.tests/gentle-agents.test.tsasserting thatchildContextExtensionPaths()includeschild-capture.tsand passes it to spawned children.Verification
tests/gentle-agents.test.tsfailed against basemainwith missingchild-capture.tsinchildContextExtensionPaths().tests/gentle-agents.test.ts.tests/child-capture.test.ts.tests/session-change-capture.test.ts.tests/package-manifest.test.ts.pnpm run typecheckclean (186 recorded baseline diagnostics, 0 regressions, 12 improved).node scripts/verify-package-files.mjsclean (155 files, 69 exact byte-pinned artifacts verified).Summary by CodeRabbit