Repository navigation
feat(tui): render agent telemetry and notifications - #9023
usr-bin-roygbiv wants to merge 8 commits into
Conversation
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughProtocol v12 support is added across the control server, Mux, remote sessions, TypeScript bindings, CLI, TUI rendering, conformance tests, end-to-end parity checks, and protocol documentation. Agent telemetry, error states, state-change events, and notification subtitles are wired through the full stack. ChangesProtocol v12 agent and notification flow
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (23 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmux-tui/crates/cmux-tui-core/src/mux.rs (1)
3676-3700: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve telemetry when advancing agent state
report_agentcreates a full newAgentRecord, so omitting fields sendsAgentTelemetry::default()for allOption<T>telemetry fields. This means a later state transition can resetstarted_at_msand progress fields used byagent_elapsed_seconds/agent summary; the hook suppression also blocks later socket telemetry updates from reaching the UI. Merge telemetry instead of replacing the whole record, and avoid treating a later hook report as authoritative for a prior socket record unless the new socket telemetry is preserved or stale telemetry is invalid.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmux-tui/crates/cmux-tui-core/src/mux.rs` around lines 3676 - 3700, Update report_agent so new reports merge with the existing AgentRecord and preserve non-default AgentTelemetry fields when the incoming report omits them, including started_at_ms and progress values. Revise the Hook/Socket suppression logic to allow valid newer socket telemetry to update a prior hook record, while preventing stale hook data from overwriting an established socket record. Keep state/source/session updates and AgentStateChanged emission consistent with the merged record.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmux-tui/crates/cmux-tui/src/app.rs`:
- Around line 4720-4728: Move the tick_agent_elapsed() and
expire_notification_banner() checks above the existing comment, keeping the
comment immediately adjacent to action.merge(self.apply_pty_failures()).
Preserve the current checks and RenderAction::Draw behavior unchanged.
- Around line 6451-6457: Extract the four-second notification banner duration
into a named constant alongside the existing display-duration constants such as
DURABLE_NOTICE_DISPLAY_DURATION, then update the
AppEvent::Mux(MuxEvent::Notification(event)) handler to use that constant when
calculating the deadline.
In `@cmux-tui/crates/cmux-tui/src/cli.rs`:
- Around line 1044-1053: The agent-state validation is duplicated between
build_list_agents and build_report_agent. Extract the allowed-state check and
matching UsageError message into a shared helper, then call it from both
functions while preserving the current accepted states and error behavior.
In `@cmux-tui/scripts/test-agent-parity.py`:
- Around line 115-143: Update the subscriber read in the report-agent test to
loop over events until event["event"] equals "agent-state-changed", skipping
unrelated client events. Then retain the existing state and tasks_completed
assertions against the matched event, following the skip-loop pattern used by
the notification check.
In `@cmux-tui/spec/cli.md`:
- Around line 145-147: Escape every enum separator in the affected Markdown
tables so literal alternatives do not create extra columns: update the notify,
list-agents, and report-agent flag descriptions in cmux-tui/spec/cli.md lines
145-147, and the corresponding notify mapping at cmux-tui/spec/commands.md line
2884, list-agents mapping at line 2947, and report-agent mapping at line 3005.
In `@cmux-tui/spec/commands.md`:
- Line 207: Update the identify JSON example to match the declared result schema
by including required registry_id, generation, and workspace_revision fields in
the exact result object; only mark them optional if the server intentionally
omits them.
In `@cmux-tui/spec/events.md`:
- Around line 877-884: Update the wire schema fields session, label, detail,
started_at_ms, tasks_completed, tasks_total, jobs_running, agents_active, and
subtitle to be optional, matching the optional properties defined in the
TypeScript events protocol. Preserve their existing types and names while
changing only their required/omitted-field behavior.
---
Outside diff comments:
In `@cmux-tui/crates/cmux-tui-core/src/mux.rs`:
- Around line 3676-3700: Update report_agent so new reports merge with the
existing AgentRecord and preserve non-default AgentTelemetry fields when the
incoming report omits them, including started_at_ms and progress values. Revise
the Hook/Socket suppression logic to allow valid newer socket telemetry to
update a prior hook record, while preventing stale hook data from overwriting an
established socket record. Keep state/source/session updates and
AgentStateChanged emission consistent with the merged record.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 45429a1b-5607-4936-8fe9-b0d25f2ba9d1
📒 Files selected for processing (35)
cmux-tui/bindings/conformance/fixtures.jsoncmux-tui/bindings/generate.shcmux-tui/bindings/go/cmd/e2e/main.gocmux-tui/bindings/java/src/com/cmux/E2e.javacmux-tui/bindings/python/e2e.pycmux-tui/bindings/typescript/README.mdcmux-tui/bindings/typescript/e2e/e2e.tscmux-tui/bindings/typescript/src/client.tscmux-tui/bindings/typescript/src/protocol/commands.tscmux-tui/bindings/typescript/src/protocol/common.tscmux-tui/bindings/typescript/src/protocol/events.tscmux-tui/bindings/typescript/test/client.test.tscmux-tui/bindings/typescript/test/protocol-types.tscmux-tui/crates/cmux-tui-core/src/event_bus.rscmux-tui/crates/cmux-tui-core/src/lib.rscmux-tui/crates/cmux-tui-core/src/mux.rscmux-tui/crates/cmux-tui-core/src/server.rscmux-tui/crates/cmux-tui/src/app.rscmux-tui/crates/cmux-tui/src/cli.rscmux-tui/crates/cmux-tui/src/session/mod.rscmux-tui/crates/cmux-tui/src/session/remote.rscmux-tui/crates/cmux-tui/src/ui/mod.rscmux-tui/crates/cmux-tui/src/ui/sidebar.rscmux-tui/crates/cmux-tui/tests/cli.rscmux-tui/docs/README.mdcmux-tui/docs/protocol.mdcmux-tui/scripts/smoke-tui.pycmux-tui/scripts/test-agent-parity.pycmux-tui/spec/README.mdcmux-tui/spec/bindings.mdcmux-tui/spec/cli.mdcmux-tui/spec/commands.mdcmux-tui/spec/events.mdcmux-tui/spec/frontends.mdcmux-tui/spec/transports.md
ae8e8a7 to
72deeb8
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
@usr-bin-roygbiv I can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 241,631 of the 240,000 allowed lines of code this month. Reviews resume on 1 August 2026 (in 4 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews. To help optimise your usage, you can tune cubic to get the most out of your usage limits:
|
|
✅ Action performedReview finished.
|
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
Actionable comments posted: 11
♻️ Duplicate comments (1)
cmux-tui/scripts/test-agent-parity.py (1)
115-143: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winRead until
agent-state-changedis received (still unresolved).The control-subscribe channel also broadcasts client events (
ClientAttached/ClientChanged); the line immediately afterreport-agentisn't guaranteed to be the agent event. The notification check further down (lines 183-186) already uses a skip-loop for exactly this reason — apply the same pattern here instead of a barereadline().🩺 Proposed fix
- event = json.loads(subscriber_stream.readline()) - self.assertEqual(event["event"], "agent-state-changed") - self.assertEqual(event["state"], "error") - self.assertEqual(event["tasks_completed"], 3) + while True: + event = json.loads(subscriber_stream.readline()) + if event.get("event") == "agent-state-changed": + break + self.assertEqual(event["state"], "error") + self.assertEqual(event["tasks_completed"], 3)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmux-tui/scripts/test-agent-parity.py` around lines 115 - 143, Update the report-agent verification in the parity test to read subscriber_stream repeatedly until it receives the "agent-state-changed" event, skipping unrelated client events such as ClientAttached or ClientChanged. Reuse the existing skip-loop pattern from the later notification check, then keep the current state and tasks_completed assertions against the matched event.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmux-tui/bindings/typescript/src/client.ts`:
- Around line 841-857: Update reportAgent to preserve the legacy positional
session argument and accept the object form without breaking TypeScript or
JavaScript callers. Normalize both forms before processing, and require protocol
12 only when new telemetry fields beyond session are supplied; allow
options.session alone on protocols 6–11.
In `@cmux-tui/bindings/typescript/test/protocol-types.ts`:
- Around line 126-141: The type-level fixture in protocol-types.ts currently
omits SubscribeEvent and KnownCmuxEvent coverage. Add fixtures assigning
notification and agent-state-changed events to those unions, including cases
with omitted and null telemetry fields, while preserving the existing
request-shape tests so event-field or union regressions fail at compile time.
In `@cmux-tui/crates/cmux-tui-core/src/mux.rs`:
- Around line 436-455: Sanitize and clamp AgentTelemetry.label and detail before
they are stored in AgentRecord, reusing sanitize_window_title with the
established hard length cap. Apply this at the AgentRecord/AgentTelemetry
construction or update path so AgentStateChanged broadcasts, JSON serialization,
and agent_summary() only receive bounded sanitized strings.
In `@cmux-tui/crates/cmux-tui/src/app.rs`:
- Around line 5759-5766: The agent_elapsed_seconds method mixes server
timestamps with the local clock for active agents. Anchor live elapsed
calculations to a server-time offset captured when updated_at_ms is received,
while retaining purely server-based updated_at_ms minus started_at_ms
calculations for Done and Error states, so live and terminal values remain
consistent.
- Around line 15522-15734: Extend the test module with focused coverage for the
time-driven helpers expire_notification_banner and tick_agent_elapsed. Inject
deterministic deadlines or timestamps, verify expired notification banners are
removed, and verify tick_agent_elapsed updates elapsed timing for an agent
record associated with a non-active surface so sidebar timers continue
advancing.
- Around line 5794-5803: Update tick_agent_elapsed to derive its redraw value
from every cached/rendered agent record used by agent_summary, rather than only
active_agent_record(). Compare the aggregate per-surface elapsed or
running-state value with last_agent_elapsed_second, and return true whenever any
sidebar timer can advance while preserving the existing change-detection
behavior.
In `@cmux-tui/crates/cmux-tui/src/session/mod.rs`:
- Around line 271-285: The Session::agents method must fail on malformed remote
agent data instead of returning empty or partial results. Require the response’s
agents field to be an array and propagate a decode error for any record that
remote::parse_agent_record cannot parse, matching the validation behavior of
clients(); preserve the existing successful parsing behavior for valid lists.
In `@cmux-tui/crates/cmux-tui/src/ui/mod.rs`:
- Around line 283-293: Sanitize agent-supplied text by replacing every control
character with a space before rendering. In
cmux-tui/crates/cmux-tui/src/ui/mod.rs lines 283-293, clean the status-bar
summary before passing it to put; in cmux-tui/crates/cmux-tui/src/ui/sidebar.rs
lines 415-431, clean the subtitle before passing it to rail::entry. Reuse the
established clean pattern from draw_notification_banner.
In `@cmux-tui/crates/cmux-tui/tests/cli.rs`:
- Line 797: Update the protocol version assertion in the CLI test to expect 12,
matching the server’s authoritative PROTOCOL_VERSION and related conformance and
remote-session tests.
In `@cmux-tui/spec/cli.md`:
- Line 151: Update the report-agent CLI option documentation to show --session
as a value-taking argument using the [--session <id>] form, while leaving the
existing optionality and other option descriptions unchanged.
In `@cmux-tui/spec/transports.md`:
- Line 7: Update the clear-history compatibility prose in the protocol matrices
across transports.md, README.md, protocol.md, and frontends.md so clients must
require the advertised clear-history-v1 capability and identify.protocol >= 9
before using clear-history, matching the v9 command schema.
---
Duplicate comments:
In `@cmux-tui/scripts/test-agent-parity.py`:
- Around line 115-143: Update the report-agent verification in the parity test
to read subscriber_stream repeatedly until it receives the "agent-state-changed"
event, skipping unrelated client events such as ClientAttached or ClientChanged.
Reuse the existing skip-loop pattern from the later notification check, then
keep the current state and tasks_completed assertions against the matched event.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 716087c9-9358-44d4-836c-e0b6b50f19f6
📒 Files selected for processing (35)
cmux-tui/bindings/conformance/fixtures.jsoncmux-tui/bindings/generate.shcmux-tui/bindings/go/cmd/e2e/main.gocmux-tui/bindings/java/src/com/cmux/E2e.javacmux-tui/bindings/python/e2e.pycmux-tui/bindings/typescript/README.mdcmux-tui/bindings/typescript/e2e/e2e.tscmux-tui/bindings/typescript/src/client.tscmux-tui/bindings/typescript/src/protocol/commands.tscmux-tui/bindings/typescript/src/protocol/common.tscmux-tui/bindings/typescript/src/protocol/events.tscmux-tui/bindings/typescript/test/client.test.tscmux-tui/bindings/typescript/test/protocol-types.tscmux-tui/crates/cmux-tui-core/src/event_bus.rscmux-tui/crates/cmux-tui-core/src/lib.rscmux-tui/crates/cmux-tui-core/src/mux.rscmux-tui/crates/cmux-tui-core/src/server.rscmux-tui/crates/cmux-tui/src/app.rscmux-tui/crates/cmux-tui/src/cli.rscmux-tui/crates/cmux-tui/src/session/mod.rscmux-tui/crates/cmux-tui/src/session/remote.rscmux-tui/crates/cmux-tui/src/ui/mod.rscmux-tui/crates/cmux-tui/src/ui/sidebar.rscmux-tui/crates/cmux-tui/tests/cli.rscmux-tui/docs/README.mdcmux-tui/docs/protocol.mdcmux-tui/scripts/smoke-tui.pycmux-tui/scripts/test-agent-parity.pycmux-tui/spec/README.mdcmux-tui/spec/bindings.mdcmux-tui/spec/cli.mdcmux-tui/spec/commands.mdcmux-tui/spec/events.mdcmux-tui/spec/frontends.mdcmux-tui/spec/transports.md
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
cmux-tui/spec/commands.md (1)
3192-3202: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winMark optional v12 telemetry result fields as optional.
Older producers may omit v12 fields, but both result schemas require them. Generated clients could reject valid pre-v12-compatible payloads.
cmux-tui/spec/commands.md#L3192-L3202: changelabelthroughagents_activeto optional members (?).cmux-tui/spec/commands.md#L3260-L3261: change the same telemetry members to optional members inreport-agentresults.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmux-tui/spec/commands.md` around lines 3192 - 3202, Update the telemetry result schema at cmux-tui/spec/commands.md lines 3192-3202 and the report-agent result schema at lines 3260-3261: mark label, detail, started_at_ms, tasks_completed, tasks_total, jobs_running, and agents_active as optional members using the schema’s existing optional-member syntax. Leave state, source, session, and updated_at_ms unchanged.cmux-tui/crates/cmux-tui-core/src/mux.rs (1)
3786-3817: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winBound/sanitize
subtitlethe same wayreport_agentnow sanitizes telemetry.
report_agent(below, lines 3825-3832) now runslabel/detailthroughsanitize_window_titleand clamps them to 64 chars specifically to prevent control characters and overlong payloads from corrupting terminal rendering or amplifying broadcast size.post_notification's newsubtitle(and pre-existingtitle/body) take the same free-form, externally-supplied path (CLInotify,Command::Notify) but skip that treatment entirely, reintroducing the exact class of issue that was just closed for agent telemetry.🛡️ Proposed fix
pub fn post_notification( &self, title: String, subtitle: Option<String>, body: String, level: NotificationLevel, surface: Option<SurfaceId>, ) -> u64 { let id = self.next_notification_id(); + let subtitle = subtitle + .map(|value| crate::server::sanitize_window_title(&value).chars().take(128).collect()); let mut unread_changed = false;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmux-tui/crates/cmux-tui-core/src/mux.rs` around lines 3786 - 3817, Update post_notification to sanitize title, subtitle, and body with sanitize_window_title and clamp each value to 64 characters, matching report_agent’s telemetry handling. Apply the transformation before constructing MuxEvent::Notification, preserving subtitle’s optional shape and the existing notification flow.cmux-tui/scripts/test-agent-parity.py (1)
35-43: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winBound the stderr read on startup failure.
If the child remains alive without creating the socket,
self.server.stderr.read()waits for EOF indefinitely, so the test hangs instead of failing. Terminate/kill the process and use boundedcommunicate()before reporting the error.Proposed fix
stderr = self.server.stderr.read() if self.server.stderr else "" + if self.server.poll() is None: + self.server.terminate() + try: + stderr, _ = self.server.communicate(timeout=5) + except subprocess.TimeoutExpired: + self.server.kill() + stderr, _ = self.server.communicate() self.fail(f"headless server did not start: {stderr[-2000:]}")🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmux-tui/scripts/test-agent-parity.py` around lines 35 - 43, Update the startup-failure path in the test agent’s server wait logic to terminate the still-running self.server process, force-kill it if necessary, and collect stderr with bounded communicate() calls before self.fail. Replace the unbounded self.server.stderr.read() while preserving the existing stderr tail in the failure message.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmux-tui/spec/cli.md`:
- Line 151: Update the report-agent option table to show value placeholders for
every value-taking telemetry flag: use <label> and <detail> for the
corresponding string options and <n> for all numeric options, while preserving
the existing --session <id> and command contract.
---
Outside diff comments:
In `@cmux-tui/crates/cmux-tui-core/src/mux.rs`:
- Around line 3786-3817: Update post_notification to sanitize title, subtitle,
and body with sanitize_window_title and clamp each value to 64 characters,
matching report_agent’s telemetry handling. Apply the transformation before
constructing MuxEvent::Notification, preserving subtitle’s optional shape and
the existing notification flow.
In `@cmux-tui/scripts/test-agent-parity.py`:
- Around line 35-43: Update the startup-failure path in the test agent’s server
wait logic to terminate the still-running self.server process, force-kill it if
necessary, and collect stderr with bounded communicate() calls before self.fail.
Replace the unbounded self.server.stderr.read() while preserving the existing
stderr tail in the failure message.
In `@cmux-tui/spec/commands.md`:
- Around line 3192-3202: Update the telemetry result schema at
cmux-tui/spec/commands.md lines 3192-3202 and the report-agent result schema at
lines 3260-3261: mark label, detail, started_at_ms, tasks_completed,
tasks_total, jobs_running, and agents_active as optional members using the
schema’s existing optional-member syntax. Leave state, source, session, and
updated_at_ms unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9a795ef2-1ad5-476f-a869-ab9573fb182a
📒 Files selected for processing (17)
cmux-tui/bindings/typescript/src/client.tscmux-tui/bindings/typescript/test/client.test.tscmux-tui/bindings/typescript/test/protocol-types.tscmux-tui/crates/cmux-tui-core/src/mux.rscmux-tui/crates/cmux-tui-core/src/server.rscmux-tui/crates/cmux-tui/src/app.rscmux-tui/crates/cmux-tui/src/cli.rscmux-tui/crates/cmux-tui/src/session/mod.rscmux-tui/crates/cmux-tui/tests/cli.rscmux-tui/docs/protocol.mdcmux-tui/scripts/test-agent-parity.pycmux-tui/spec/README.mdcmux-tui/spec/cli.mdcmux-tui/spec/commands.mdcmux-tui/spec/events.mdcmux-tui/spec/frontends.mdcmux-tui/spec/transports.md
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmux-tui/crates/cmux-tui/src/app.rs`:
- Around line 5760-5766: Update is_omp_root_record and all OMP-root
attention/counting callers to use a structured protocol-level root-session
identity signal instead of matching telemetry.label to "OMP"; add that signal to
AgentRecord or its associated telemetry data if absent, set it when creating the
OMP root record, and preserve non-root AgentSource::Hook records such as
"Worker" as non-roots.
- Around line 5768-5786: The omp_root_session_counts method currently performs
an unnecessary tree traversal for each agent record. Replace the
self.tree.surface(record.surface).is_some() filter with a tab_locations
membership check using contains_key, while preserving the existing root-record
filtering and state counting.
In `@cmux-tui/crates/cmux-tui/src/ui/pane.rs`:
- Around line 205-210: In cmux-tui/crates/cmux-tui/src/ui/pane.rs:205-210 and
356-362, compute a single filtered, severity-ranked attention cue from the OMP
state and unread notification, excluding Working/Idle OMP states, then reuse it
for both tab labels and styles. Ensure higher-severity unread notifications take
precedence over lower-severity OMP icons while preserving the existing rendering
and styling behavior for the selected cue.
In `@cmux-tui/crates/cmux-tui/src/ui/sidebar.rs`:
- Around line 24-51: Update workspace_attention_color so Working and Idle OMP
states are excluded before selecting the maximum, matching omp_attention_icon’s
no-indicator behavior. Filter out rank-zero entries from the omp iterator while
preserving notification handling and existing ranking for Error, Blocked,
Unknown, and Done.
- Around line 24-51: Update workspace_attention_color to traverse each
workspace’s screens, panes, and tabs only once per render, combining
notification and OMP attention ranking updates within that single tab iteration.
Preserve the existing ranking precedence and color selection behavior while
eliminating the separate notifications and omp scans.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: cb3b14aa-4438-4ec5-8370-3ef991ccb71d
📒 Files selected for processing (5)
cmux-tui/crates/cmux-tui/src/app.rscmux-tui/crates/cmux-tui/src/ui/mod.rscmux-tui/crates/cmux-tui/src/ui/pane.rscmux-tui/crates/cmux-tui/src/ui/sidebar.rscmux-tui/docs/configuration.md
e721f61 to
96f5b3f
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
There was a problem hiding this comment.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmux-tui/crates/cmux-tui/src/ui/mod.rs (1)
100-140: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winNotification banner silently overwrites the prefix-key help bar.
draw_notification_banner's non-surface-onlyyisarea.height.saturating_sub(2)(line 354), which is exactly the rowdraw_prefix_help_bardraws to (status_y.saturating_sub(1)=(area.height-1)-1=area.height-2, called fromdraw_status_barat lines 341-343). Sincedraw()callsdraw_status_barbeforedraw_notification_banner(line 122), an active notification banner will overwrite the prefix help row whenever the user hasprefix_armeda keyboard sequence, hiding the available-actions chrome without any fallback. This contradicts the PR's stated goal of preserving screen/session chrome, and there's no existing test covering both states together.🩹 Proposed fix: shift banner up when prefix is armed
- let y = if app.is_surface_only() { area.height - 1 } else { area.height.saturating_sub(2) }; + let y = if app.is_surface_only() { + area.height - 1 + } else if app.prefix_armed { + area.height.saturating_sub(3) + } else { + area.height.saturating_sub(2) + };Also applies to: 340-394
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmux-tui/crates/cmux-tui/src/ui/mod.rs` around lines 100 - 140, Update draw_notification_banner so its non-surface-only row moves up when app.prefix_armed is active, avoiding the prefix-help row rendered by draw_prefix_help_bar in draw_status_bar. Preserve the current banner position when no prefix sequence is armed, and add coverage for the notification-plus-prefix-armed state.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmux-tui/bindings/typescript/src/client.ts`:
- Around line 838-845: Localize the new public protocol-v12 additions using the
project’s locale-specific sources instead of English literals. Update client.ts
at lines 838-845 to localize the notification-subtitle protocol error, client.ts
at lines 872-875 to localize the agent-telemetry protocol error, and README.md
at line 4 to add matching localized protocol-v12 documentation; update every
supported locale as required.
In `@cmux-tui/crates/cmux-tui-core/src/mux.rs`:
- Around line 2456-2471: Update the workspace_key-to-workspace_id lookup in the
surface spawn logic to call the existing State::workspace_by_key method instead
of scanning state.workspaces with iter().find(). Preserve the current optional
handling and CMUX_TUI_WORKSPACE_ID environment assignment while reusing the
maintained O(1) index.
In `@cmux-tui/crates/cmux-tui/src/app.rs`:
- Around line 7061-7062: Update replace_authoritative_tree, using its existing
live_surfaces set, to prune agent_records and agent_observed_at_ms entries whose
surfaces are no longer live. Keep the existing retire_surface_state cleanup for
per-surface retirement, but reconcile both caches against the authoritative live
surface set so orphaned non-terminal agents cannot continue triggering redraws.
- Around line 5780-5804: Update agent_summary and format_elapsed to obtain the
agent state labels, jobs/agents unit suffixes, and elapsed-time h/m/s suffixes
through localization::catalog() instead of hardcoded strings. Preserve the
existing compact formatting and ordering while ensuring every user-facing
segment uses the active locale.
In `@cmux-tui/crates/cmux-tui/src/session/remote.rs`:
- Around line 90-121: Update parse_agent_record to reject malformed optional
fields instead of treating them as absent: distinguish missing values from wrong
JSON types for session, every AgentTelemetry field, and updated_at_ms, and
return a parse error that decode_remote_agent_list propagates. Restrict state
parsing to the protocol’s explicit strings, including "unknown", and reject any
other state rather than mapping it to AgentState::Unknown; preserve event
handling’s ability to discard malformed events and add regressions for invalid
optional types and unknown states.
In `@cmux-tui/crates/cmux-tui/src/ui/sidebar.rs`:
- Around line 446-451: Update draw_workspaces to guard workspace_sidebar_area
dimensions before calling rail::prepare or rendering workspace rows. Skip
painting when the area is too narrow or short for the x + 1 and y + 1 buffer
accesses, including width 1, preventing out-of-bounds writes while preserving
normal rendering for valid areas.
In `@cmux-tui/spec/commands.md`:
- Line 216: Update the protocol compatibility matrices to gate the new agent
state error on protocol 12 everywhere: in cmux-tui/spec/commands.md lines
216-216, cmux-tui/spec/transports.md lines 7-7, and cmux-tui/spec/frontends.md
lines 30-30, add error to the protocol-12 requirement; in
cmux-tui/docs/protocol.md lines 143-143, list error among the protocol-v12
additions.
- Line 3132: Update the notify.subtitle field in the command schema
documentation to accept string|null, matching the NotifyRequest type and
preserving explicit null as a valid protocol value.
- Around line 3192-3201: Update the list-agent schema fields label, detail,
started_at_ms, tasks_completed, tasks_total, jobs_running, and agents_active to
be optional and nullable, preserving their existing types. Ensure the schema
accepts older producers that omit these additive v12 telemetry fields and
remains consistent with the example payload.
---
Outside diff comments:
In `@cmux-tui/crates/cmux-tui/src/ui/mod.rs`:
- Around line 100-140: Update draw_notification_banner so its non-surface-only
row moves up when app.prefix_armed is active, avoiding the prefix-help row
rendered by draw_prefix_help_bar in draw_status_bar. Preserve the current banner
position when no prefix sequence is armed, and add coverage for the
notification-plus-prefix-armed state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 56298e26-da19-4f28-a6ac-c083a52c8a84
📒 Files selected for processing (35)
cmux-tui/bindings/conformance/fixtures.jsoncmux-tui/bindings/generate.shcmux-tui/bindings/go/cmd/e2e/main.gocmux-tui/bindings/java/src/com/cmux/E2e.javacmux-tui/bindings/python/e2e.pycmux-tui/bindings/typescript/README.mdcmux-tui/bindings/typescript/e2e/e2e.tscmux-tui/bindings/typescript/src/client.tscmux-tui/bindings/typescript/src/protocol/commands.tscmux-tui/bindings/typescript/src/protocol/common.tscmux-tui/bindings/typescript/src/protocol/events.tscmux-tui/bindings/typescript/test/client.test.tscmux-tui/bindings/typescript/test/protocol-types.tscmux-tui/crates/cmux-tui-core/src/event_bus.rscmux-tui/crates/cmux-tui-core/src/lib.rscmux-tui/crates/cmux-tui-core/src/mux.rscmux-tui/crates/cmux-tui-core/src/server.rscmux-tui/crates/cmux-tui/src/app.rscmux-tui/crates/cmux-tui/src/cli.rscmux-tui/crates/cmux-tui/src/session/mod.rscmux-tui/crates/cmux-tui/src/session/remote.rscmux-tui/crates/cmux-tui/src/ui/mod.rscmux-tui/crates/cmux-tui/src/ui/sidebar.rscmux-tui/crates/cmux-tui/tests/cli.rscmux-tui/docs/README.mdcmux-tui/docs/protocol.mdcmux-tui/scripts/smoke-tui.pycmux-tui/scripts/test-agent-parity.pycmux-tui/spec/README.mdcmux-tui/spec/bindings.mdcmux-tui/spec/cli.mdcmux-tui/spec/commands.mdcmux-tui/spec/events.mdcmux-tui/spec/frontends.mdcmux-tui/spec/transports.md
96f5b3f to
357b7de
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
dc14a30 to
bd3b397
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
f8a2178 to
25a558b
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
25a558b to
5e187b8
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Summary
reportAgent(..., session)callers while gating only protocol-12 telemetry fieldsReview fixes
sanitize_render_bufferpass, and telemetry is now additionally sanitized and clamped at ingestion--session <id>, and protocol-9/capability clear-history wordingTesting
cargo test -p cmux-tui-core agent --lib— 7 passedcargo test -p cmux-tui-core notification --lib— 3 passedcargo test -p cmux-tui agent— 48 passedcargo test -p cmux-tui notification— 4 passedcargo test -p cmux-tui --test cli cli_verbs_cover_command_output_errors_and_streams— 1 passednpm testinbindings/typescript— 65 passedcargo build -p cmux-tui && python3 scripts/test-agent-parity.py— build passed; parity smoke 1 passedpython3 -m py_compile scripts/test-agent-parity.py— passedcargo fmt --all -- --checkandgit diff --check— passedDemo Video
N/A — this is a Linux TUI/protocol change; deterministic focused tests and the live parity smoke exercise the changed behavior.
Checklist
Summary by CodeRabbit
New Features
errorstate and real-time agent status updates.Documentation
Tests