fix(advance): add ctx threshold check before /breathe#345
fix(advance): add ctx threshold check before /breathe#345birdmanmandbir merged 1 commit intomainfrom
Conversation
Port shouldBreathe logic from deleted cmd/task_route.go into advance.go. Agents below the configured breathe_threshold (default 40%) are skipped; stale or missing status files default to breathe (safe fallback).
PR Review — fix(advance): ctx threshold check before /breatheCritical IssuesNone. Important IssuesNone. Suggestions
When This is probably acceptable by design — an agent with very low ctx is likely still in an active work cycle and will be breathed again shortly. But worth confirming: is there a fallback notification path, or is the assumption that ctx < threshold always implies an actively running agent? Strengths
VERDICT: LGTMSolid fix. The pure function extraction and test coverage are particularly well done. |
Triage UpdateVERDICT: LGTM — mergingSuggestion Addressed (by design)Route file staged but no notification when breathe is skipped — this is intentional. An agent below the ctx threshold is assumed to be in an active work loop and will encounter its next natural |
Summary
shouldBreathelogic from the deletedcmd/task_route.gointointernal/daemon/advance.goshouldBreatheStatus(unit-testable) and thinshouldBreatheI/O wrapper/breathesend inadvanceToStage— agents belowbreathe_threshold(default 40%) are skippedtrue(breathe when uncertain)TestShouldBreatheStatustobreathe_routing_test.gocovering nil, stale, below/at/above threshold casesTest plan
go test ./internal/daemon/... -run TestShouldBreatheStatus -vpassesmake testpassesttal task goskips /breathe, logs "skipping breathe for X (ctx below 40% threshold)"ttal task gosends /breathe as before