feat(diagnostics): add diagnostic capture hooks to mgw:run agent spawns#240
Merged
snipcodeit merged 6 commits intomainfrom Mar 6, 2026
Merged
Conversation
…spawns Provides beforeAgentSpawn()/afterAgentSpawn() helper functions that wrap Task() agent spawns with diagnostic capture from agent-diagnostics.cjs. All operations are non-blocking -- failures log warnings and continue pipeline execution. Closes part of #231 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ge.md Instruments the comment classifier Task() spawn in the preflight_comment_check step with before/after diagnostic capture hooks using lib/diagnostic-hooks.cjs. Part of #231 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e.md Instruments 7 Task() agent spawns with before/after diagnostic capture: - Quick route: planner, plan-checker, executor, verifier - Milestone route: planner, executor, verifier Each spawn gets a pre-spawn beforeAgentSpawn() call that records start time and prompt hash, and a post-spawn afterAgentSpawn() call that records exit reason and writes the diagnostic entry. Part of #231 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instruments the PR creation Task() agent spawn with before/after diagnostic capture hooks using lib/diagnostic-hooks.cjs. Part of #231 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a Diagnostic Capture Hooks section to the shared GSD workflow patterns documenting the before/after hook pattern, design principles, and a table of all instrumented agent spawns across the pipeline. Part of #231 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 6, 2026
1 task
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
lib/diagnostic-hooks.cjsprovidingbeforeAgentSpawn()/afterAgentSpawn()wrapper functions for non-blocking diagnostic capture around Task() agent spawnscommands/workflows/gsd.mdCloses #231
Milestone Context
Changes
lib/
beforeAgentSpawn(),afterAgentSpawn(),wrapAgentSpawn(),generateDiagId(), andpendingCount(). Uses Map-based in-flight tracking, lazy-loadsagent-diagnostics.cjswith graceful degradation.commands/run/
preflight_comment_checkcommands/workflows/
Test Plan
node -e "require('./lib/diagnostic-hooks.cjs')"loads successfullybeforeAgentSpawn()returns a valid diagId handleafterAgentSpawn()clears in-flight tracking (pendingCount returns 0)agent-diagnostics.cjsis not present.mgw/diagnostics/entries are written after agent spawns (requires Build structured diagnostic logger for agent executions #230 merged)