mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-24 22:55:57 +03:00
[GH-ISSUE #182] feat: Add context window utilization tracking to iteration summary #70
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#70
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?
Originally created by @arjhun-personal on GitHub (Feb 21, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/182
Summary
Add context window utilization (%) as a metric displayed after each orchestration iteration, alongside the existing duration, cost, and turns.
Target output:
Problem
Token data (
input_tokens,output_tokens) arrives from Claude and Pi stream events but is currently dropped before reaching the display layer. Operators have no visibility into how close an agent is to hitting the context window limit.Scope
UsageonAssistantevents) and Pi (PiUsageonTurnEndevents) — both currently droppedSessionResultwithinput_tokens,output_tokens,context_windowcontext_window_tokensconfig with sensible defaults (200K for Claude/Pi)LoopStateevents.jsonlandralph eventsKey Files
crates/ralph-adapters/src/stream_handler.rs—SessionResult+ displaycrates/ralph-adapters/src/pty_executor.rs— Claude token capturecrates/ralph-adapters/src/pi_stream.rs— Pi token capturecrates/ralph-core/src/event_loop/loop_state.rs— per-hat trackingcrates/ralph-core/src/event_logger.rs— events.jsonl persistencecrates/ralph-core/src/config.rs— context window configcrates/ralph-cli/src/loop_runner.rs— wiring