mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-24 22:55:57 +03:00
[PR #179] [MERGED] fix: hat display stuck on previous iteration's hat #181
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#181
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/179
Author: @The-Zona-Zoo
Created: 2/20/2026
Status: ✅ Merged
Merged: 2/20/2026
Merged by: @mikeyobrien
Base:
main← Head:fix/hat-display-stuck-on-previous📝 Commits (1)
909a9b9fix: hat display stuck on previous iteration's hat📊 Changes
6 files changed (+169 additions, -25 deletions)
View changed files
📝
crates/ralph-cli/src/loop_runner.rs(+5 -6)📝
crates/ralph-core/src/event_loop/mod.rs(+23 -4)📝
crates/ralph-core/src/event_loop/tests.rs(+82 -8)📝
crates/ralph-core/src/lib.rs(+1 -1)📝
crates/ralph-core/tests/event_loop_ralph.rs(+5 -2)📝
crates/ralph-tui/src/widgets/header.rs(+53 -4)📄 Description
This was originally attempted to be fixed in #170, but was unsuccessful. Two bugs caused the TUI to show stale hat state:
process_events_from_jsonl returned has_orphans (bool), but the caller in loop_runner.rs treated it as had_events via matches!(Ok(true)). For non-orphan events (topic matches a hat trigger), has_orphans=false caused the caller to think no events were written and inject default_publishes, corrupting hat state. Fix: return a ProcessedEvents struct with separate had_events and has_orphans fields.
The TUI header always preferred the frozen IterationBuffer hat over the live pending_hat. After an iteration finishes (elapsed set) but before the next iteration starts, the stale frozen hat was displayed instead of the updated pending_hat. Fix: when iteration is finished and pending_hat is known, show pending_hat.
Both regression tests fail on old code, pass on fix.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.