Repository navigation
fix(autonudge): name the stop reason at every remaining loop removal - #14493
Conversation
|
Intent: every auto-nudge loop stop names its real reason in the gateway WARNING line, instead of |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 23bd805 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One residual to confirm: issue_radar's watchdog-initiated crew stop ( What this change shipsInventory (8 items) — 8 justifiedIntent: make every auto-nudge stop line in gateway.log name its real reason instead of
Checks run: [FIRST-PRINCIPLES-REVIEWED] 23bd805 |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
0978a18 to
83d910d
Compare
|
mechanism: stop_reason kwarg on Spec Builder's shared removal helper
|
|
83d910d to
440e502
Compare
Pass a specific stop_reason (or stopped_reason on the deactivating write) at the goal-clear, Slack/Discord/Webex retirement, Auto Research and Spec Builder orphan-cleanup stops, so the WARNING stop line no longer reads reason='removed' or 'unspecified' for them. Fixes #14409
440e502 to
23bd805
Compare
Problem / Motivation
Goal: every auto-nudge loop stop names its real reason in the gateway log.
Since #14131, each loop stop writes one WARNING line to
gateway.log. Some callers still stop a loop without saying why. Their line readsreason='removed'orreason='unspecified', which tells a reader nothing.Why it matters
When a conductor loop stops early, the log line is the only clue. A line that just says
removedsends the reader back into the code to guess which of ten paths fired.Not a goal
What changed (motivation → approach → change)
/goal cleardashboard/chat_runner.pygoal_clearedslack/gateway.pyslack_unroutableslack/gateway.pyunsupported_keyslack/gateway.pyuser_not_authorizedslack/gateway.pysession_rotatedslack/gateway.pysession_unreachableslack/gateway.pyunsupported_channelapps/builtins/auto_researchcampaign_stopped/campaign_deletedapps/builtins/auto_researchcampaign_<status>apps/builtins/spec_builderorphaned_workerapps/builtins/spec_builderspec_stopped/spec_deletedapps/builtins/spec_builderspec_arm_abortedThe log line takes its reason from the write that turns the loop off. A plain
remove()with no reason becomesremoved. So each caller that removes a live loop passesstop_reason. Spec Builder's stop, delete and hand-off paths share one removal helper,_remove_nudge_loop_for_slot, so the reason is threaded through that helper.Two callers turn the loop off first and remove it later. The Auto Research watchdog and Spec Builder orphan cleanup do this. For them the line is written at the turn-off step, so they pass
stopped_reasonthere.deactivate_and_waitinautonudge.py, on the service and its maintenance view, gains an optionalstopped_reasonfor this. The watchdog only sets it on a loop that is still active, so a worker's ownautonudge_stopmark is never overwritten.The Auto Research relaunch cleanup is left as is. It only removes a loop that is already stopped, so it writes no line.
Backwards compatibility
Compatible:
stop_reasonandstopped_reasonare new optional keyword arguments with the old defaults. No stop happens at a different time.Tests
test/test_goal_command.py,test/test_slack_gateway_coverage.py,test/test_autonudge_dashboard_fire.py,test/test_auto_research.py,test/test_auto_research_handlers_coverage.py, Spec Builder'stest_routes.py, andtest/test_spec_builder_routes_coverage.py.test/test_autonudge_stop_log.pyadds a real-service test: a maintenance-view turn-off withstopped_reason="orphaned_worker"logs that reason.Manual verification
N/A — unit coverage sufficient: the change is the reason string on existing calls, and each call is pinned by a test.
Related Issues
Fixes #14409
Pattern harvest
Not generalizable: the default
removedreason is a deliberate fallback; the fix is naming each caller, not a rule.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)