feat(daemon): hardcode builder isolation rules + crash diagnostics#9
Merged
feat(daemon): hardcode builder isolation rules + crash diagnostics#9
Conversation
… prompt Promotes the three isolation constraints from memory-only entries to a permanent section in prime.ts so they are always present regardless of memory state. Section is placed before "How to delegate" and verified by a new assertion in prime.test.ts. Implements evolve proposal: friction-correction-repeating-on-orchest-wmzf Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds lastCrashInfo map and getCrashInfo() export to lifecycle.ts. The spawnAgentLoop .catch() handler now stores exit code (numeric only, string codes coerced to null) and the last 10 lines of the error stack/message before logging. The entry is cleared when the agent is destroyed. Implements evolve proposal: agent-health-crashed-repeating-on-builde-535t Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ayload Extracts crash state into crash-store.ts (avoids circular import between lifecycle.ts and agent-health.ts). HealthIssue now carries optional exitCode and stderrTail fields. runHealthCheck calls getCrashInfo() on crash detection and attaches the fields; notifyOrchestrator appends them to the mail body; the agent_health_crashed log event includes them. Tests verify both the populated and absent-info cases. Implements evolve proposal: agent-health-crashed-repeating-on-builde-535t Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- lifecycle.ts: discard old async-loop code (replaced by fork supervisor in main); keep both clearCrashInfo() and clearFileTracking() in destroyAgentByName; wire crash capture into forkAgentProcess with piped stderr (stdio inherit/inherit/pipe/ipc) and rolling 10-line buffer; store exitCode+stderrTail via setCrashInfo on unexpected exit - prime.test.ts: keep both isolation rules assertions (ours) and memory assertions (main) in the orchestrator test - agent-health.ts: take main's updated crash message text, keep exitCode/ stderrTail field spread and enhanced log call - agent-health.test.ts: restructure crash diag tests into dedicated describe block to match main's new test layout; keep 3-condition IPC stall detection tests from main Co-Authored-By: Claude Sonnet 4.6 <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
prime.ts): Promotes the three workspace-containment constraints from memory-only entries to a hardcoded section inbuildOrchestratorSystemPrompt, placed before "How to delegate". Eliminates reliance on memory state for a critical safety invariant.crash-store.ts,lifecycle.ts): Newcrash-store.tsmodule stores{ exitCode, stderrTail }per agent. ThespawnAgentLoop.catch()handler captures the numeric exit code and last 10 lines of the error stack and stores them there. Entry is cleared ondestroyAgentByName.agent-health.ts):HealthIssuegains optionalexitCodeandstderrTailfields.runHealthCheckpopulates them viagetCrashInfo()on crash detection.notifyOrchestratorappends them to the mail body; theagent_health_crashedlog event includes them.crash-store.tsis imported directly (not vialifecycle.ts) to avoid the existing circular import.Evolve proposals implemented
friction-correction-repeating-on-orchest-wmzf— builder isolation rules hardcoded in orchestrator promptagent-health-crashed-repeating-on-builde-535t— crash diagnostics on agent exitTest plan
pnpm test— all 319 tests pass (16 daemon, 14 CLI, 4 shared, 2 memory, dashboard)pnpm --filter @friday/daemon exec tsc --noEmit— cleanpnpm --filter @friday/cli exec tsc --noEmit— cleanpnpm --filter @friday/shared build— cleanprime.test.tsverifies Builder Isolation Rules block present and ordered before "How to delegate"agent-health.test.tsverifies exitCode/stderrTail appear in issue, mail body, and log when crash info is present; verifies clean absence when no crash info🤖 Generated with Claude Code