Add observer logging throughout orchestration loops#65
Merged
Conversation
begin_agent() was doing objective[:80] before splitting on newlines,
so a multi-line objective (e.g. the recovery dispatch whose text is
'Recovery dispatch for workflow…\n\nThis stage depends on: …') got
sliced to exactly 80 chars and then split(), leaving a dangling
fragment like 'This stage de' as a separate log entry.
Fix: take the first non-empty line of the objective before truncating
to 80 chars, so only the header line appears in the pane.
feat(status-log): INFO-log stochastic consensus and sub-agent activity
Four new sets of observer-log lines now reach both the TUI status
pane and the session.log file:
agent.py
_run_consensus_sample – 'consensus :: <name> :: sample #N dispatching (<agent>)'
'consensus :: <name> :: sample #N done (ok|error:…)'
meta_draft_dispatch_prompt – 'meta :: drafting dispatch prompt for <agent> via chief'
meta_draft_role_prompt – 'meta :: drafting role prompt for <role> via chief'
autoresearch_loop.py
_observer_log() helper (mirrors agent._observer_log pattern)
per-step: survey / analyst / critic dispatch announcements
ralph_loop.py
_observer_log() helper
per-iteration: plan / engineer / qa dispatch announcements
_handle_plateau: escalate and reframe notices
_handle_regression: regression-detected + critic dispatch notice
https://claude.ai/code/session_01WGeyhTG21J7tyC5UgbuzQ9
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
This PR adds comprehensive observer logging throughout the orchestration system to provide real-time status updates to the TUI status pane. The changes mirror important workflow events to both the log file and the observer interface, improving visibility into the execution flow.
Key Changes
New
_observer_log()helper method inralph_loop.pyandautoresearch_loop.py: Centralizes the pattern of logging to both the file log and the observer's TUI status pane, with graceful error handling for missing observers.Ralph loop status updates: Added observer logging at critical points:
ralph #{idx} :: plan :: dispatching ralph)ralph #{idx} :: engineer :: {objective})ralph #{idx} :: qa :: dispatching audit pass)Autoresearch loop status updates: Added observer logging for:
autoresearch #{idx} :: survey :: dispatching ralph)Agent consensus logging: Added observer logging in
agent.pyfor:consensus :: {name} :: sample #{sample} dispatching ({agent_name}))consensus :: {name} :: sample #{sample} done (ok|error))TUI improvement: Enhanced
begin_agent()intui.pyto extract the first non-empty line from multi-line objectives, preventing stray fragments in the log pane from objectives that start with blank lines (e.g., recovery dispatches).Implementation Details
_observer_log()method safely handles cases where the observer is not available viagetattr()with a default ofNone{context} :: {phase} :: {action/detail}https://claude.ai/code/session_01WGeyhTG21J7tyC5UgbuzQ9