[codex] Polish Lab TUI agent output#623
Conversation
| ) -> None: | ||
| display_content = _dynamic_tool_chat_content(status, content, action) | ||
| if display_content is None: | ||
| return |
There was a problem hiding this comment.
Early return skips streaming assistant finalization
Low Severity
When _dynamic_tool_chat_content returns None (i.e., status == "tool"), _record_dynamic_tool_call now returns before reaching _finish_latest_streaming_assistant_locked(fallback=""). Previously, this finalization was always called, ensuring any active streaming assistant message was properly completed (or removed if empty) before appending a system message. Now, if there happens to be an active streaming assistant message when a "tool" status event arrives, it will remain in the "streaming" state until some other event finalizes it, potentially causing a lingering streaming indicator in the UI.
Reviewed by Cursor Bugbot for commit 1924dd4. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1924dd40af
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if normalized.startswith("sync failed:"): | ||
| return "Sync failed: Lab asset refresh failed" |
There was a problem hiding this comment.
Preserve sync failure cause when redacting skill lines
When a sync error message contains skill (for example exceptions like Skill 'x' is missing SKILL.md. or duplicate-skill errors), this branch rewrites the full Sync failed: ... line to the generic Sync failed: Lab asset refresh failed, which removes the actionable failure reason from the TUI. run_lab_sync_service already emits the precise exception text, so this redaction makes real sync failures hard to diagnose and forces users to rerun outside the screen to understand what broke.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 994af56. Configure here.
| with self._lock: | ||
| if ( | ||
| not text | ||
| and _is_lab_widget_tool_event_title(label) |
There was a problem hiding this comment.
Redundant truthiness check after early return guard
Low Severity
The if text and condition on line 745 is redundant because lines 743–744 already return early when not text. At this point, text is guaranteed to be truthy, making the truthiness check in if text and _is_lab_widget_tool_result_text(text) unnecessary.
Reviewed by Cursor Bugbot for commit 994af56. Configure here.


Summary
LabSyncProgressEventmilestones; the TUI renders only those event kinds.Validation
uv run --project packages/prime pytest packages/prime/tests/test_lab_view.py -q->209 passed17 passed, 192 deselecteduv run --project packages/prime ruff check packages/prime/src/prime_lab_app/agent_runtime.py packages/prime/src/prime_cli/lab_setup.py packages/prime/src/prime_lab_app/setup_screens.py packages/prime/tests/test_lab_view.py-> passeduv run --project packages/prime ty check packages/prime/src/prime_lab_app/agent_runtime.py packages/prime/src/prime_cli/lab_setup.py packages/prime/src/prime_lab_app/setup_screens.py-> passedgit diff --check-> passedNote
Medium Risk
Changes how
prime lab syncprogress and agent/tool events are emitted and rendered in the Lab TUI, which can affect user-visible status updates and chat transcript behavior. Risk is moderate due to modified message-filtering logic across multiple agent transports, but changes are largely presentation-focused and covered by updated tests.Overview
Lab sync now emits typed progress milestones (
LabSyncProgressEvent) and the TUI renders only these events, replacing raw log streaming; sync failure also reports afailedmilestone.Lab doctor and sync UI copy is updated to consistently refer to Lab assets (not skills/templates/docs) and to show clearer sync progress messages.
Agent chat output rendering is tightened: ACP tool events are recorded only when they include non-empty text and now include
tool_kindmetadata; non-widget dynamic tool chatter is hidden, widget messages use action titles for deterministic display, and eval/run widget cards/transcripts show a picker summary instead of config paths.Eval config widgets adjust field rendering so known
envsvalues use aSelectcontrol, and tests are expanded/updated to assert the new progress events, copy, and transcript behaviors.Reviewed by Cursor Bugbot for commit 994af56. Bugbot is set up for automated code reviews on this repo. Configure here.