feat(0025): subagent process isolation via PreToolUse hooks - #48
Conversation
|
🤖 Finished Review · ✅ Success · Started 5:22 PM UTC · Completed 5:42 PM UTC |
PR Summary by QodoAdd experiment 0025: isolate subagent work via PreToolUse Agent hook
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
Code Review by Qodo
1.
|
ReviewFindingsLow
Previous runReviewFindingsMedium
Low
Next steps:
Previous run (2)ReviewFindingsMedium
Low
Next steps:
Previous run (3)ReviewFindingsMedium
Low
Labels: PR adds a new experiment (feat commit type) |
|
I'm checking how to add the cost of the new spawned agent to mlflow |
1032337 to
e69bee7
Compare
|
🤖 Finished Review · ✅ Success · Started 5:55 PM UTC · Completed 6:15 PM UTC |
e69bee7 to
476473f
Compare
|
🤖 Review · |
476473f to
ff0a39e
Compare
|
🤖 Review · |
ff0a39e to
b78d508
Compare
|
🤖 Review · |
b78d508 to
2f03f1e
Compare
|
🤖 Finished Review · ✅ Success · Started 6:39 PM UTC · Completed 7:17 PM UTC |
Demonstrates intercepting Agent() calls via PreToolUse hooks to run subagent work in isolated claude CLI processes within the sandbox. Key findings: - Echo-through pattern works: hook spawns isolated process, replaces Agent prompt with the result for pass-through - Hook settings must use settings.json (not .local) — dangerously-skip-permissions skips .local files - Hook config injected via host_files to CLAUDE_CONFIG_DIR, keeping the target repo clean - Process group kill on timeout prevents orphaned grandchildren - Policy referenced from fullsend-ai/agents via SHA-pinned URL Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Marta Anon <manon@redhat.com>
2f03f1e to
c122319
Compare
|
Acknowledged all low-severity findings as accepted trade-offs for this experiment:
Addressed the medium race-condition (killpg), error-handling (json.load guard, OSError), env-variable-mismatch (validate-output.sh), and CLAUDE_BIN precedence in c122319. |
|
🤖 Finished Review · ✅ Success · Started 10:11 PM UTC · Completed 10:26 PM UTC |
Superseded by updated review
|
🤖 Finished Retro · ✅ Success · Started 7:19 AM UTC · Completed 7:33 AM UTC |
Retro: PR #48 — feat(0025): subagent process isolation via PreToolUse hooksWhat happenedPR #48 was a human-authored experiment by maruiz93 (with Claude Opus 4.6 co-authorship) adding experiment 0025: intercepting Review quality was strong. The agents collectively identified 5 confirmed bugs (killpg race condition, validate-output.sh env var mismatch, JSON parse crash, narrow exception handling, CLAUDE_BIN precedence) and drove 9 total code/documentation fixes. The human reviewer (ralphbean) verified architectural correctness of the echo-through pattern and traceparent cost stitching — a complementary "does this design make sense" review that neither bot performed. Main inefficiencies:
Evidence for existing issues
ProposalsOne proposal filed — see below. The remaining improvement opportunities are well-covered by the existing issues listed above. Proposals filed
|
Summary
Agent()calls via a PreToolUse hook to run subagent work in isolatedclaudeCLI processes within the sandboxclaude -pprocess, captures its output, replaces the built-in subagent's prompt with an echo instructionhost_filestoCLAUDE_CONFIG_DIR— target repo stays clean (can be empty)fullsend-ai/agentsvia SHA-pinned URL instead of local copyKey discoveries
--dangerously-skip-permissionsskipssettings.local.json— must usesettings.jsonfor hooks in sandboxallowed_remote_resourcesonly needed in harness YAML;config.yamlgets defaults merged automaticallystart_new_session+os.killpg) prevents orphaned grandchildren on timeoutTest plan
fullsend runwith empty target repo — 3 transcripts, validation passed🤖 Generated with Claude Code