Skip to content

Show live tool progress in native chat - #17597

Merged
brennanb2025 merged 9 commits into
mainfrom
brennanb2025/native-chat-agent-running
Aug 31, 2026
Merged

brennanb2025 merged 9 commits into
mainfrom
brennanb2025/native-chat-agent-running

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​490 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​485
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​629 $\color{#cf222e}{\Huge{\mathbf{−}}}$​212 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​417

What changed

The structured Codex app-server native chat now makes the agent lifecycle and tool activity explicit without turning the transcript into a wall of expanded payloads.

Agent status

  • Thinking appears directly below the user message while the agent waits for its first response.
  • The Thinking label itself uses a subtle opacity pulse, matching the Codex reference behavior.
  • Once output or tool activity arrives, the row changes to Working for N seconds.
  • When the turn completes, the same row becomes Worked for N seconds and remains in the transcript.
  • Thinking has no divider; Working and Worked have the divider below them.
  • Status timing is scoped per turn and prior completed status rows persist across later turns.

Tool and command coverage

Every structured tool-call and tool-result block is supported. Command-family tools are explicitly recognized and labeled as shell activity:

  • bash
  • shell
  • powershell
  • terminal
  • execute
  • run_command
  • run_shell_command
  • shell_command
  • exec_command
  • run_terminal_cmd
  • run_terminal_command

For an active command-family tool, native chat shows a terminal icon and the latest command preview. For any other named tool, native chat shows a wrench icon and the tool name plus its input preview. This covers file reads, patches, searches, and other provider-defined tools without requiring a new renderer branch for each name.

Tool results are rendered as compact Result rows. Text output and structured patch/diff output remain available through the individual row disclosure. A non-zero command result is shown in its own expanded result body; it does not turn the aggregate activity row into an error state.

Disclosure behavior

  • Adjacent tool calls are grouped into one compact activity row.
  • While a batch is active, only the latest running tool is shown.
  • Completed activity is compact by default.
  • Clicking the completed turn caret opens the activity group, but each shell/result child starts collapsed.
  • Individual tool rows can be expanded independently.
  • No red exclamation icon is shown for failed commands or orphaned calls.

Implementation checklist

  • Thinking → Working for N seconds → Worked for N seconds lifecycle.
  • Thinking text pulse with stable layout.
  • Per-turn timer persistence across later turns.
  • Explicit shell/command tool-family recognition.
  • Generic named-tool fallback for all other structured tools.
  • Latest-running-tool presentation for grouped active batches.
  • Compact completed activity rows.
  • Individual tool/result disclosure.
  • Completed-turn caret that does not auto-expand child payloads.
  • No aggregate red error icon.
  • Lifecycle, disclosure, and failed-result behavior covered by tests.

Verification

  • pnpm run check:code-quality:changed
  • pnpm tc:web
  • pnpm test src/renderer/src/components/native-chat/NativeChatToolRun.test.tsx src/renderer/src/components/native-chat/NativeChatMessageList.test.tsx — 16 tests passed.
  • Real Electron/CDP validation on this worktree observed the native-chat status transition from Thinking to Worked for N seconds.
  • The completed-turn disclosure was validated to open the grouped activity while leaving individual shell/result payloads collapsed.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR adds live per-turn agent status and compact tool-progress presentation to structured Codex native chat while preserving legacy activity chrome for bridge sessions.

  • Tracks Thinking, Working, and Worked states per user turn.
  • Projects structured tool lifecycle state into native-chat blocks.
  • Groups tool activity behind per-turn disclosure controls with independently collapsible details.
  • Adds command-family labeling, generic tool fallbacks, localization, and lifecycle/disclosure tests.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up-review scope.

No blocking failure remains.

Important Files Changed

Filename Overview
src/renderer/src/components/native-chat/NativeChatMessageList.tsx Integrates per-turn status placement, persistent completed timing, and turn-scoped activity disclosure into the transcript.
src/renderer/src/components/native-chat/NativeChatToolRun.tsx Adds live tool labeling, command-family recognition, settled activity presentation, and nested disclosure behavior.
src/renderer/src/components/native-chat/use-native-chat-turn-status.ts Introduces turn-keyed timing state that transitions active work into persistent completed durations.
src/shared/structured-agent-session-projection.ts Preserves structured tool-call lifecycle state when projecting journal items into native-chat blocks.
src/renderer/src/components/native-chat/NativeChatWorkingStatus.tsx Renders accessible Thinking, Working, and Worked status rows with elapsed timing and completed-turn disclosure.

Sequence Diagram

sequenceDiagram
    participant U as User
    participant S as Structured session
    participant P as Native-chat projection
    participant V as Message list
    participant T as Tool activity
    U->>S: Submit turn
    S->>P: Working lifecycle
    P->>V: User message and active turn
    V-->>U: Thinking
    S->>P: Assistant output or tool call
    P->>V: Response blocks and tool state
    V-->>U: Working for N seconds
    V->>T: Show latest active tool
    S->>P: Turn completed
    P->>V: Settled lifecycle
    V-->>U: Worked for N seconds
    U->>V: Toggle turn details
    V->>T: Reveal grouped activity
    T-->>U: Collapsed tool and result rows
Loading

Reviews (14): Last reviewed commit: "fix(native-chat): limit turn status UI t..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 28441b48-71b7-430d-bf81-ec248fed79ee

📥 Commits

Reviewing files that changed from the base of the PR and between 83883ae and 5fa27c2.

📒 Files selected for processing (7)
  • src/renderer/src/components/native-chat/NativeChatMessageList.test.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.test.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.tsx
  • src/renderer/src/components/native-chat/native-chat-typing-indicator.test.ts
  • src/renderer/src/components/native-chat/native-chat-typing-indicator.ts
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Structured tool-call state now flows from session projection into native chat blocks. NativeChatToolRun renders active, completed, and failed tool activity with labels, summaries, icons, and collapsed outputs. The typing indicator remains visible whenever isWorking is true, regardless of message content. Tests cover projection, rendering transitions, grouping, failure states, collapsed results, lifecycle fallback, and typing-indicator behavior.

Merge Risk: 🔵 Low · up to 5fa27

Native chat can mislabel tool activity by showing a running tool as failed or by showing an older unresolved tool as active during a newer turn. The PR is mergeable with explicit owner awareness and follow-up to scope lifecycle state correctly and preserve accurate live status.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 10 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the implementation, behavior, objectives, and verification, but it omits required template sections, including ELI5, Why, Linked Issue, Visual Proof, AI Disclosure, Review, Ag… Add the missing template sections. Provide the required issue reference after "Fixes #". Attach before-and-after screenshots or videos, or write exactly "N/A" with a brief reason if visual proof is not applicable. Complete the testing and c…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely summarizes the main change: showing live tool progress in native chat.
Full details: Docstring Coverage

Explanation

Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 10 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description explains the implementation, behavior, objectives, and verification, but it omits required template sections, including ELI5, Why, Linked Issue, Visual Proof, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It also does not provide the required visual proof or an explicit N/A statement for the UI changes.

Resolution

Add the missing template sections. Provide the required issue reference after "Fixes #". Attach before-and-after screenshots or videos, or write exactly "N/A" with a brief reason if visual proof is not applicable. Complete the testing and checklist items, and document AI usage, review, cross-platform impact, and upstream-boundary status.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/renderer/src/components/native-chat/NativeChatToolRun.tsx (1)

41-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use named interpolation placeholders.

Replace value0 and value1 with semantic keys such as preview, toolName, commandCount, and toolCount. Update the corresponding translation resources in the same change.

Based on learnings, newly added user-facing TypeScript and TSX strings must use intent-named localization IDs with named interpolation placeholders.

Also applies to: 47-56, 72-102

Source: Learnings


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bb7dcd30-43bc-43b9-aa75-d2e99a99f050

📥 Commits

Reviewing files that changed from the base of the PR and between 68bb227 and 96147e2.

📒 Files selected for processing (7)
  • src/renderer/src/components/native-chat/NativeChatToolRun.test.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.tsx
  • src/renderer/src/components/native-chat/native-chat-typing-indicator.test.ts
  • src/renderer/src/components/native-chat/native-chat-typing-indicator.ts
  • src/shared/native-chat-types.ts
  • src/shared/structured-agent-session-projection.test.ts
  • src/shared/structured-agent-session-projection.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Two things need attention before merge: the new localization keys are missing from en.json (the verify:localization-catalog gate in pnpm lint fails), and the typing-dots suppression is not scoped to the current turn.

Reviewed changes

  • Journal lifecycle projection — NativeChatToolCallBlock gains an optional state, populated from body.state in the structured projection.
  • Live tool row — NativeChatToolRun renders an animated row with the latest running tool plus a grouped batch summary when a call is active.
  • Typing-dots suppression — the generic indicator defers to the structured live row while a running tool-call block is present.
  • Tests — new coverage for grouping, collapsed payloads, the live→compact transition, failure state, projection, and the indicator deferral.

ℹ️ Nitpicks

  • The active-batch summary row shows a Check icon and phrases the batch as Ran N commands even while the latest call is still spinning below (NativeChatToolRun.tsx). Consider a progress-neutral icon/wording for the in-flight state.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron/visual-proof follow-up (2026-08-30): retried the target worktree with an isolated profile, HOME, ORCA_DISABLE_CODEX_TRUST_RPC=1, --disable-gpu, and a fresh CDP port. The Electron process launched, but the Playwright E2E harness timed out waiting for window.__store (30s), matching the earlier DevTools /json socket hang during macOS Keychain initialization. No screenshot/video is attached because the captured frame is not valid visual evidence.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron visual proof (live native-chat tool progress)

Launched this PR worktree (pacu @ brennanb2025/native-chat-agent-running) with isolated profile + mock keychain. Identity matched: Orca: brennanb2025/native-chat-agent-running / Dock Orca/ brennanb2025-native-chat-agent-running / renderer http://127.0.0.1:5183/.

Scenario: New tab → Codex (structured native chat) → sent sleep 15 && echo NATIVE_CHAT_TOOL_PROGRESS_MARKER from the real composer.

Visible:

  • Empty Codex Chat surface
  • Typing dots while the turn started
  • Live animated row Running /bin/zsh -lc 'sleep 15 && echo NATIVE_CHAT_TOOL_PROGRESS_MARKER' (dots suppressed)
  • Compact 1× shell result after settle
  • Expanded payload opt-in showing command JSON + Result NATIVE_CHAT_TOOL_PROGRESS_MARKER

Gaps: grouped adjacent active tools, failed compact error state, and the PTY/command-marker path were not visually exercised.

Empty structured Codex Chat

01-codex-chat-empty.png

Turn started (typing dots, Stop control)

03-live-1.png

Live tool progress (primary evidence)

04-tool-1.png

Compact completed tool row

06-after-tool-1.png

Expanded payload (opt-in)

07-completed-expanded.png

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ The two blocking items from the prior review are resolved. The remaining dead usedOneSummary branch from that review is still present, but it is a non-blocking cleanup and stays tracked in its open thread rather than being re-raised here.

Reviewed changes

  • Turn-scoped typing-dots suppression — shouldShowNativeChatTypingIndicator now defers to the structured live row only when the running tool-call belongs to the current turn, with a regression test for the interrupted-turn case.
  • Localization catalog minted — all ten components.native-chat.tool.* keys were added to en.json, clearing the verify:localization-catalog gate.
  • Named interpolation placeholders — the new translation calls use preview / toolName / commandCount / toolCount instead of positional value0 / value1.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5736fd9d-e38f-4355-b883-bb47bd73518f

📥 Commits

Reviewing files that changed from the base of the PR and between 88d4485 and 949216f.

📒 Files selected for processing (4)
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.test.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.tsx
  • src/renderer/src/components/native-chat/use-native-chat-live-session.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Commit 949216f wires the live-row gate to session.transcriptLifecycle, a field the structured session path never populates, so a running tool now renders as failed and the animated live row never appears — the feature this PR adds is disabled in the very path it targets.

Reviewed changes

  • Orphaned-tool settlement — NativeChatToolRun gained an activeTurnIsWorking prop that stops the spinner and marks a running call as failed when its turn is no longer working, threaded through NativeChatMessageList.
  • Lifecycle exposure — NativeChatLiveSession gained a transcriptLifecycle field sourced from the transcript-watch hook, with a unit test for the orphaned-call settlement.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

brennanb2025 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Review status (correction)

Outcome: pass with low-risk residual

  • Same-model review/fix loop completed and pushed two focused fixes:
    • 88d4485: scope structured live-tool typing suppression to the current turn.
    • 949216f: settle orphaned state="running" tool rows after completed/interrupted turns.
  • Added regression coverage and English localization entries.
  • Validation passed: 25 targeted tests, native-chat suite (91 files / 928 tests), pnpm tc:web, changed-file code quality/oxlint, localization catalog/extraction/coverage, and git diff --check.
  • Orchestrated Grok Electron proof on the intended PR worktree. The real structured Codex chat flow showed typing dots, the animated live shell row with dots suppressed, compact completion, and opt-in expanded payload. Five uncropped screenshots are attached above.
  • Remaining low-risk gap: lifecycle is currently global to the transcript view, so an orphaned old tool row could still spin during a newer working turn when no per-message turn key is available. This is UX-only; no P0/P1 issue was found.
  • Current CI static analysis and aggregate verify are failing on the unrelated pre-existing src/main/runtime/rpc/dispatcher.ts:323 max-lines violation; that file is outside this PR diff. All PR test, typecheck, package, and Windows package checks pass.

No scope-expanding changes were made.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Follow-up fix pushed in 83883ae: when transcript lifecycle metadata is absent, native chat now falls back to the session-level isWorking state. Previously the expression session.transcriptLifecycle?.state === 'working' evaluated to false when metadata was missing, so a correctly state: "running" shell row was classified as stale and rendered with the red error icon. The live row now remains animated while the turn is working; the stale/orphan failure path is retained only when the session explicitly reports that work has ended. Added a regression test for this exact case.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this delta. The change cleanly resolves the prior blocking concern by falling back to the session-level isWorking prop, restoring the animated live tool row in the structured session path.

Reviewed changes

  • Live-row gate fallback — activeTurnIsWorking now falls back to the isWorking prop when session.transcriptLifecycle is absent, so structured sessions (which never populate transcriptLifecycle) render running tools as live again instead of settling them to a failed state.
  • Regression test — a NativeChatMessageList case asserts a running tool keeps its Running sleep 5 live row with no failure styling when lifecycle metadata is absent.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes — one commit since the last pullfrog review: the in-progress signal was stabilized and de-animated.

  • Stable working row — TypingIndicatorRow now renders a fixed-height Working… label instead of three bouncing dots, and it stays for the entire turn rather than hiding once prose arrives.
  • De-animated live tool row — NativeChatToolRun dropped the Loader2 spinner and the grouped Ran N commands summary; the active row is now a static SquareTerminal/Wrench icon plus the latest tool label.
  • Typing-indicator simplification — shouldShowNativeChatTypingIndicator collapsed to return args.isWorking, deleting the turn-boundary scan and the PTY/structured deferral logic.
  • Dead-code removal — deleted activeToolSummary, retiring the unreachable usedOneSummary branch flagged in the prior review.

ℹ️ PR description no longer matches the behavior

The PR body still claims the live row is animated and that the typing dots are suppressed when a structured live tool row is present. After this commit there is no animation anywhere (both the spinner and the dot bounce are removed, and the tests assert their absence), and the Working… row now stays visible beside the live tool row for the whole turn. Update the "What changed" bullets and the Active tool work is visibly animated checklist item to describe the new stable-row design.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Comment on lines +16587 to +16592
"ranCommandOneToolSummary": "Ran {{commandCount}} command and used {{toolCount}} tool",
"ranCommandManyToolsSummary": "Ran {{commandCount}} command and used {{toolCount}} tools",
"ranCommandsOneToolSummary": "Ran {{commandCount}} commands and used {{toolCount}} tool",
"ranCommandsManyToolsSummary": "Ran {{commandCount}} commands and used {{toolCount}} tools",
"usedOneSummary": "Used 1 tool",
"usedManySummary": "Used {{toolCount}} tools"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These six summary keys are now orphaned: activeToolSummary was their only consumer and this commit removes it. Delete them from the catalog (verify:localization-extraction reports them as report-only, so they won't fail lint, but they are dead copy).

@brennanb2025
brennanb2025 force-pushed the brennanb2025/native-chat-agent-running branch from 5fa27c2 to 073e27e Compare August 31, 2026 17:42
@brennanb2025
brennanb2025 force-pushed the brennanb2025/native-chat-agent-running branch from 073e27e to 664f415 Compare August 31, 2026 17:45

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No blocking issues here — a few minor suggestions on the new working-status row.

Reviewed changes — one commit since the last pullfrog review (664f415): the fixed Working… typing row was replaced with a top-of-transcript NativeChatWorkingStatus component that shows Thinking before any tool activity and a ticking Working for N seconds once tools begin.

  • Working-status component — new NativeChatWorkingStatus renders a fixed-height status row above the transcript, threading a workingStartedAt prop (with an isWorking-derived fallback ref) through NativeChatMessageList, NativeChatResolvedView, and NativeChatStructuredSession.
  • Typing-row removal — deleted the TypingIndicatorRow bouncing-dots/Working… label; the Thinking/Working for row now sits at the top of the list instead of the bottom.
  • i18n — added status.thinking and status.workingFor keys.
  • Tests — new cases for the stable Thinking row and the elapsed-time display after tool activity begins.

ℹ️ Nitpicks

  • components.native-chat.status.working is now orphaned — TypingIndicatorRow was its only consumer and this commit deletes it. Remove it from en.json alongside the six tool.*Summary keys flagged in the previous review.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

<div
className="flex min-h-8 items-center border-b border-border text-xs text-muted-foreground"
aria-label={translate('components.native-chat.status.responding', 'Agent is responding')}
aria-live="polite"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aria-live="polite" region's text changes every second, so screen readers announce Working for 1 seconds, Working for 2 seconds, … continuously for the whole turn. Keep a static announcement (the aria-label already reads "Agent is responding") and take the ticking count out of the live region, or drop the live semantics from the elapsed figure.

>
{thinking
? translate('components.native-chat.status.thinking', 'Thinking')
: translate('components.native-chat.status.workingFor', 'Working for {{value0}} seconds', {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two copy issues on the new workingFor string: Working for {{value0}} seconds renders 1 seconds (no plural form, and a momentary 0 seconds), and it reintroduces the positional value0 placeholder that earlier commits in this PR replaced with named keys (preview, toolName, commandCount, toolCount). Use a named placeholder with proper pluralization (e.g. a countN-style plural key).

@brennanb2025

Copy link
Copy Markdown
Contributor Author

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — one commit since the last pullfrog review (38eb3cc): the working-status row was anchored to each user prompt and the Thinking label was re-scoped to the current turn.

  • Turn-anchored status — the single top-of-transcript status row is replaced by a per-turn NativeChatWorkingStatus rendered directly below each user message (via a Fragment wrapper), with a bottom fallback when no user message exists yet.
  • Turn-scoped thinking — the full-history hasToolActivity scan is replaced by hasCurrentTurnResponse, computed over messages.slice(latestUserIndex + 1) in the new use-native-chat-turn-status hook, so Thinking correctly reappears at the start of every turn (resolves the prior hasToolActivity thread).
  • Per-turn timing — a timingByTurn state machine latches each turn's start from workingStartedAt (or a latched Date.now()) and freezes workedSeconds when isWorking clears, surfacing a compact Worked for N seconds + ChevronRight row after a turn completes.
  • Extracted prose→markdown — proseToMarkdown moved to native-chat-prose.ts as nativeChatProseToMarkdown.
  • i18n — added status.workedFor.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 force-pushed the brennanb2025/native-chat-agent-running branch 2 times, most recently from fb72149 to f38ca6e Compare August 31, 2026 19:03

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this delta — approval is blocked only by four still-open minor threads from earlier reviews, which the new commit does not touch.

Reviewed changes — the delta since the prior pullfrog review (38eb3cc → fb72149f) is a single visual tweak to the per-turn working-status row.

  • Thinking-row border removed — NativeChatWorkingStatus now applies its border-b border-border separator only when not thinking (i.e. on Working for N seconds / Worked for N seconds rows), so the quiet Thinking row no longer draws a divider; the two NativeChatMessageList assertions were updated to match the new conditional class.

ℹ️ Prior nits still open (block approval)

The following minor findings remain unaddressed and keep their existing open threads: the unused messages parameter in shouldShowNativeChatTypingIndicator, the orphaned tool.*Summary i18n keys, the workingFor/workedFor pluralization with the positional value0 placeholder, and the aria-live="polite" ticking status row. These are non-blocking cleanups; resolve them to unblock approval.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 force-pushed the brennanb2025/native-chat-agent-running branch 2 times, most recently from 4c96c0d to b1a70f9 Compare August 31, 2026 19:53

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No blocking issues found — the completed-turn disclosure is a clean, well-tested addition. One minor efficiency note inline.

Reviewed changes — the delta since the prior pullfrog review (f38ca6e) adds a per-turn disclosure that hides a completed turn's settled tool activity behind its Worked for … status row, plus a bugfix and a pure component extraction.

  • Completed-turn disclosure — NativeChatMessageList tracks expandedTurnIds keyed by the owning user message and threads an activityExpandOverride into each NativeChatToolRun; a settled, collapsed run now returns null instead of rendering a compact row that misread as the whole response still running (or having failed).
  • Disclosure affordance — NativeChatWorkingStatus renders a Toggle turn details button (aria-expanded + rotating caret) for completed turns, toggling the owning turn's expansion.
  • Turn-status freeze fix — use-native-chat-turn-status falls back to workingStartedAt when a turn has no latched timing before freezing workedSeconds, so the __unanchored__ case still records a duration.
  • Transcript chrome extraction — NativeChatImageAttachments, NativeChatAgentControls, and ProviderFrameRow moved verbatim into NativeChatTranscriptChrome.tsx (re-exported from NativeChatMessageList to preserve the public API).
  • Tests — new cases for the caret-driven expansion and for settled tool activity staying behind the disclosure.

The four minor open threads from earlier reviews (unused messages param, orphaned tool.*Summary/status.working keys, workingFor/workedFor pluralization, aria-live tick spam) remain unaddressed and stay open.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues in this delta — one minor correctness note on the new tool-line keys.

Reviewed changes — the delta since the prior pullfrog review (4c96c0d) collapses child tool lines behind the per-turn disclosure, restores a pulsing Thinking indicator, and switches tool-line keys to content-derived values.

  • Collapsed child lines on disclosure — ToolLine gains initiallyExpanded (default true) and an aria-expanded; NativeChatToolRun sets expandToolLines to false when opened via the turn caret, so the group opens while each child stays collapsed.
  • Pulsing thinking indicator — NativeChatWorkingStatus renders three animate-pulse dots (aria-hidden) inside the Thinking row.
  • Content-derived tool-line keys — the blocks.map key switched from the row index to name:JSON.stringify(input) / type:output.
  • Tests — asserts the three pulse dots and that a caret-expanded group's child line starts aria-expanded="false".

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 force-pushed the brennanb2025/native-chat-agent-running branch from b1a70f9 to 3d6c8c1 Compare August 31, 2026 20:12
@brennanb2025
brennanb2025 force-pushed the brennanb2025/native-chat-agent-running branch from 3d6c8c1 to 3d231b6 Compare August 31, 2026 20:16

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

This delta removes the collapsed failure state: a failed tool run now renders the same Check icon as a completed one, contradicting the PR checklist item "Failed tool runs have an explicit compact error state". See the inline comment.

Reviewed changes — the delta since the prior pullfrog review (b1a70f9) is a single visual change to NativeChatToolRun.

  • Failure icon removed — the hasFailure derivation and CircleAlert import are gone, so the settled/collapsed row always renders Check; the two affected tests now assert the check icon and the absence of the alert icon.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this delta — approval remains blocked only by the still-open minor threads from earlier reviews, which this delta does not touch.

Reviewed changes — the delta since the prior pullfrog review (3d6c8c1) makes the Thinking indicator pulse the label itself and rewrites the PR description to document the final design.

  • Pulsing Thinking label — the three staggered aria-hidden dots in NativeChatWorkingStatus were replaced with an animate-pulse opacity pulse applied directly to the Thinking label span, matching the "subtle opacity pulse" claim; the test now asserts the label has the class and that no dot elements remain.
  • Description reconciled with code — the PR body now explicitly documents "No red exclamation icon is shown for failed commands or orphaned calls" and lists "No aggregate red error icon" in the checklist, resolving the prior failure-state contradiction.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status

Outcome: pass — focused fixes pushed in 4432f49924.

  • Same-model review/fix loop completed with no remaining in-scope findings.
  • Fixed completed-turn status lookup so prior Worked for N seconds rows persist across later turns.
  • Replaced the per-row quadratic turn-boundary scan with a linear pass.
  • Preserved live tool progress for legacy tool calls without lifecycle metadata.
  • Scoped working/orphan handling to the current turn and guarded against stale lifecycle completion.
  • Made duplicate tool/result rows use occurrence-safe keys.
  • Pruned retained timing state so it does not grow for the entire session lifetime.
  • Validation: 18 targeted native-chat tests passed, pnpm tc:web passed, changed-code quality/React Doctor passed, and git diff --check passed.
  • Final readiness checklist found no P0/P1/P2 issues and no new SSH, security, mobile, cross-platform, packaging, or back-compat concerns. Residual: legacy calls without per-call lifecycle metadata can remain labeled Running until the turn settles; this is low-risk and not release-blocking.
  • Grok Electron proof on the intended worktree exercised a real Codex native-chat turn:
    • Thinking/live state: 01-after-send.png
    • Worked/collapsed state: 04-worked-collapsed.png
    • Turn disclosure with child rows collapsed: 05-disclosure-group-open-children-collapsed.png

No scope-expanding changes were made.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this delta — the two inline threads from earlier reviews (the O(n²) turn-key scan and the tool-line key collision) are now resolved. Approval remains gated only by the still-open minor cleanup threads, which this delta does not touch.

Reviewed changes — one commit since the prior pullfrog review (3d231b6c): preserve turn status for legacy tool calls and fix the two flagged renderer inefficiencies.

  • Precomputed turn keys — NativeChatMessageList resolves each row's owning turn key once in a useMemo running variable instead of the per-row slice(0, index + 1).findLast(...), removing the O(n²) rescan and its per-render allocations.
  • Live legacy tool calls — activeTurnIsWorking is re-derived as isCurrentTurn && (isWorking || session.transcriptLifecycle?.state === 'working'), and NativeChatToolRun now treats a state-less tool call (state == null) as active while the turn works, so hook/PTY tool calls without lifecycle metadata keep their live row.
  • Unique tool-line keys — NativeChatToolRun appends a per-signature occurrence counter to each child key, so repeated identical calls/results (e.g. pwd twice) no longer collide and corrupt per-line expanded state.
  • Stale-timing pruning — use-native-chat-turn-status drops timings whose turn key no longer maps to a user message, bounding timingByTurn growth across long sessions.
  • Tests — new cases for legacy-tool liveness, stale-completed-lifecycle-plus-active-hook-state, and the key-collision/turn-key behavior.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 force-pushed the brennanb2025/native-chat-agent-running branch from 1231957 to c558dc7 Compare August 31, 2026 22:49
@brennanb2025
brennanb2025 force-pushed the brennanb2025/native-chat-agent-running branch from c558dc7 to 1d24737 Compare August 31, 2026 22:51
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review update (commit 1d247376f3):

  • Scoped the turn timer/disclosure and live tool activity UI to structured Codex native-chat sessions only.
  • Restored the legacy bridge/Claude typing-indicator and tool activity chrome; added regression coverage so Claude does not show the structured Thinking/Running … UI.
  • Added the missing components.native-chat.status.toggleDetails localization key, fixing the PR-owned localization catalog failure.
  • Bounded expanded-turn state to 128 entries to avoid unbounded transcript-session growth.

Validation: 31 focused native-chat tests passed; pnpm tc:web; localization catalog verification; changed-code quality (oxlint/type-aware/React Doctor); and git diff --check all pass. Current GitHub checks after the push are pending (Greptile Review and test-vs-non-test LoC).

Electron visual proof was attempted, but a clean dev launch/CDP target was unavailable in this shared workspace; no screenshot was attached. The existing canonical working spinner uses the yellow token (border-yellow-500).

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this delta. The commit cleanly scopes the live-tool/turn-status UI to the structured Codex lane and restores the legacy bridge chrome; approval remains gated only by the pre-existing minor cleanup threads (unused messages param, orphaned tool.*Summary/status.working i18n keys, workingFor/workedFor pluralization, and the per-second aria-live tick), none of which this commit touches.

Reviewed changes — one commit since the prior pullfrog review (c558dc7): the turn-status and live-tool UI is now gated behind a showTurnStatus prop instead of being rendered in both native-chat lanes.

  • Turn-status gating — NativeChatMessageList gains showTurnStatus (default true) and threads it into useNativeChatTurnStatus, the NativeChatWorkingStatus row conditions, and each row's activeTurnIsWorking/structuredActivityUi.
  • Bridge lane reverted to legacy chrome — NativeChatResolvedView passes showTurnStatus={false}; TypingIndicatorRow (three bouncing dots) is re-introduced and rendered only when !showTurnStatus, and NativeChatToolRun skips the live-tool row, Check icon, and settled-turn early-return when structuredActivityUi is false — restoring the pre-PR collapsed N× summary rendering.
  • Structured lane scoped to Codex — NativeChatStructuredSession passes showTurnStatus={props.agent === 'codex'}.
  • Bounded disclosure state — expandedTurnIds evicts its oldest key once it exceeds MAX_EXPANDED_TURNS (128).
  • i18n + regression test — added status.toggleDetails; a new NativeChatMessageList case asserts the bridge lane shows the legacy dots and none of the turn-status/live-tool affordances.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this delta. The bridge-lane typing predicate was restored to its pre-PR scan behavior, the corresponding tests were reverted to match, and the accidental pnpm-lock.yaml change was dropped. Approval remains gated only by the three still-open minor cleanup threads (orphaned tool.*Summary keys, workingFor/workedFor pluralization, and the per-second aria-live tick), none of which this delta touches. The earlier "unused messages parameter" thread is now resolved and retired.

Reviewed changes — one commit since the prior pullfrog review (1d24737), which supersedes c558dc7.

  • Bridge typing predicate restored — shouldShowNativeChatTypingIndicator regains its original turn-scoped scan (hides the dots once the assistant answer arrives, keeps them over tool work, returns on user/command-marker rows), reverting the return args.isWorking simplification. It is now consumed only by the bridge lane, where that nuance still matters.
  • Typing-indicator tests restored — the test names and assertions reverted to the originals (hides as soon as the structured reply row arrives, hides behind the PTY streaming bubble, does not flicker back on when a system row interleaves, hides once prose is the newest row), matching the restored predicate.
  • Lockfile cleanup — the accidental @pnpm/exe additions to pnpm-lock.yaml were removed.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 merged commit 59facfb into main Aug 31, 2026
28 checks passed
brennanb2025 added a commit that referenced this pull request Sep 5, 2026
…s Codex (#18743)

* fix(native-chat): render Claude structured chat through the same UI as Codex

Structured native chat is one shared, agent-agnostic component tree, but three
Codex-hardcoded terms on that path made a Claude session render differently.

- `showTurnStatus` was `agent === 'codex'`, which gated the whole structured
  presentation: the live tool-progress row, the completion check and activity
  grouping (`structuredActivityUi`), and the Thinking / Working for N /
  Worked for N status rows. Claude fell back to the legacy compact chrome.
- `runtimeContext` was likewise Codex-only, so a Claude transcript rendered
  images as filename chips instead of previews.
- The composer's structured slash menu always served the Codex catalog,
  ignoring `agent`. That disagreed with the dispatcher, which does branch per
  agent: Codex-only tokens offered to Claude missed the command guard and were
  sent to the model as literal prompt text, where Codex shows an error.

The first two gates landed Codex-first (#17597, #18266) before the Claude
structured lane existed; they were rollout scoping, not capability limits.
Neither `useNativeChatTurnStatus` nor `useNativeChatImageRuntimeContext` has
any agent-specific logic. The menu now reads `structuredSlashCommands(agent)`,
the function the dispatcher already used, so both read one list.

No new rendering logic: two gates removed and one existing shared function
reused. There are now zero `agent === 'codex' | 'claude'` branches in any
native-chat component.

* docs(native-chat): update structured turn status contract

---------

Co-authored-by: Merge Sim <sim@local>
brennanb2025 pushed a commit that referenced this pull request Sep 5, 2026
…tool progress

Mobile chat had a single static "Agent is working" row and no live tool
activity, while the desktop restructure (#17597, #18705) replaced that with a
per-turn status row and a running-tool label. This brings mobile to parity and
puts the derivation in one place instead of two.

Shared (new, pure, RN-safe — desktop uses them as i18n fallbacks, mobile
directly, matching the native-chat-empty-state pattern):
- `native-chat-turn-status.ts`: duration formatting, label selection, the
  turn-timing state machine, and the active/settled split.
- `native-chat-tool-activity.ts`: command-tool classification, the running-tool
  label descriptor, and running-call selection.

Desktop now consumes both; `NativeChatWorkingStatus`, `NativeChatToolRun` and
`use-native-chat-turn-status` keep their existing behavior and strings.

Mobile gains the "Thinking" / "Working for 12s" / "Worked for 3m 4s" row with a
caret that discloses the turn's tool activity, the pulsing "Running npm test"
row with terminal-vs-wrench glyphs, and desktop's rule that a completed turn's
tool run hides behind the turn caret. The bridge lane is untouched and keeps its
three-dot indicator. Headings, quotes, code, lists and table cells are now
selectable.

Files at their max-lines cap were split rather than bumped: the tool-run subtree,
the prompt card, the session-lane wiring, and the turn-disclosure state each move
to their own module.
brennanb2025 added a commit that referenced this pull request Sep 5, 2026
…tool progress (#18761)

* feat(mobile): port the restructured native-chat turn status and live tool progress

Mobile chat had a single static "Agent is working" row and no live tool
activity, while the desktop restructure (#17597, #18705) replaced that with a
per-turn status row and a running-tool label. This brings mobile to parity and
puts the derivation in one place instead of two.

Shared (new, pure, RN-safe — desktop uses them as i18n fallbacks, mobile
directly, matching the native-chat-empty-state pattern):
- `native-chat-turn-status.ts`: duration formatting, label selection, the
  turn-timing state machine, and the active/settled split.
- `native-chat-tool-activity.ts`: command-tool classification, the running-tool
  label descriptor, and running-call selection.

Desktop now consumes both; `NativeChatWorkingStatus`, `NativeChatToolRun` and
`use-native-chat-turn-status` keep their existing behavior and strings.

Mobile gains the "Thinking" / "Working for 12s" / "Worked for 3m 4s" row with a
caret that discloses the turn's tool activity, the pulsing "Running npm test"
row with terminal-vs-wrench glyphs, and desktop's rule that a completed turn's
tool run hides behind the turn caret. The bridge lane is untouched and keeps its
three-dot indicator. Headings, quotes, code, lists and table cells are now
selectable.

Files at their max-lines cap were split rather than bumped: the tool-run subtree,
the prompt card, the session-lane wiring, and the turn-disclosure state each move
to their own module.

* perf(mobile): stop the turn-status rows from re-rendering the whole transcript

A streaming turn re-renders the chat list many times a second. The disclosure
wiring handed every row a fresh status object and a fresh toggle closure on each
of those renders, so `MobileNativeChatMessage`'s memo never held and every
visible row re-rendered per tick — including settled turns that had not changed.

Memoize the status selection on the timing map, and keep one stable toggle
handler per turn (pruned when a turn leaves the transcript) attached only to the
settled rows that can actually disclose anything. Now only the live turn's row
changes identity while the agent works.

* fix(mobile): keep the turn clock running when the optimistic echo is replaced

An accepted send renders as `pending-N` until the transcript echo lands under
its real message id. That flips the active turn key mid-turn, and the timing
reducer treated the new key as a new turn — so a turn that had reached
"Working for 8s" visibly restarted at "Working for 0s".

The reducer now carries the start over when the previous key names a turn that
has since left the transcript, which is exactly the echo-replacement case. A
genuinely new turn (the previous key still in the transcript) and a turn that had
already settled both keep their own clock; both are pinned by tests. Desktop does
not pass the new key and is unaffected.

* fix(mobile): keep the Tools toggle working on settled turns

Hiding a settled turn's tool run behind the turn caret (desktop parity) also
made the composer's global Tools control a no-op on every completed turn: the
run it wanted to expand was not rendered at all. Let that toggle override the
hiding, so it still reveals every run at once the way it did before.

* fix(mobile): re-key the turn timing instead of only carrying its start

The previous fix carried the start forward only while the turn was still
working. When the transcript echo landed after the turn had already settled,
the new key inherited nothing, the settled timing was pruned with the old key,
and the turn's "Worked for N" row disappeared entirely.

Move the timing onto the new key instead, which covers both orderings: an
in-flight turn keeps counting from its original start (and later settles against
it), and an already-settled turn keeps its duration. Both orderings are pinned.

* test(mobile): pin the structured turn-status wiring at the view level

Emulator QA could not reach the structured lane (mobile's Create Tab -> Codex
falls back to a terminal tab when agentSession.createSupport says unsupported),
so the view's own lane wiring had no coverage — the one seam between the shared
turn-timing reducer and the rendered rows.

Assert what the view hands each row: the live user turn gets a status object and
the three-dot indicator is gone on the structured lane; the bridge lane keeps the
indicator and gets no status; a finished turn settles to a numeric duration with
a toggle; and an assistant row never carries a status row of its own.

* fix(mobile): isolate structured chat turn state

* fix(mobile): let the capability RPC actually store what a phone advertises

`runtime.clientCapabilities.update` records the advertised set by assigning
`authenticatedSocket.clientCapabilities`, but the socket handed to the dispatcher
defined that property with a getter only. In strict mode the assignment throws
`TypeError: Cannot set property clientCapabilities ... which has only a getter`,
so the RPC answered `runtime_error` and the set was never stored.

The consequence is not subtle: `supportsStructuredAgentSessions` requires the
capability, so `projectSessionTabAgentStatus` removed every `agent-session` tab
from a phone that had advertised it correctly. A paired phone saw ZERO tabs on a
worktree whose only tab was a structured Codex chat — structured native chat was
unreachable on mobile over this transport, not just missing its new turn UI.

Give the socket a setter that writes through to the channel, which already owns
the set for the connection's lifetime, so later requests on the same socket see
it. Found while trying to capture emulator screenshots of the turn-status port:
two full QA runs reported the new UI "missing" because the phone could only ever
get a bridge/PTY tab.

* fix(mobile): carry the turn key instead of caching a handler in a ref

Builds on the scope-isolation fix: that kept (and extended) a ref that is
written during render — once to memoize a per-turn handler, once to prune dead
turns, once to reset on a scope change. React Doctor's "Ref mutated during
render" is what CI's `check:react-doctor:changed` was failing on (x2), and on
mobile it is a real hazard rather than a style note: react-freeze discards
renders, and a discarded render would leave the cache mutated.

Pass the settled turn's key down the row instead and let it call one stable
handler with it. That preserves both properties the cache was bought for — per
scope isolation, and identity stability so a streaming transcript does not
defeat the row's memo — with no ref writes and no pruning to get wrong. The
scope-keyed expanded set and the 128-turn cap are untouched; their tests move to
the new contract and one now pins handler identity across a re-render.

Note for future changes here: `check:code-quality:changed` does NOT cover this.
CI additionally runs the standalone react-doctor CLI, which has rules the oxlint
plugin config does not enable.

* fix: ship native chat status translations

* test(native-chat): pin the shared copy against the English catalog

The shared constants are desktop's i18n fallback and mobile's actually-rendered
string. If one changes without the other, desktop keeps rendering en.json while
mobile renders the constant — and nothing fails, because a fallback is only used
when the key is missing. That silent divergence is the exact thing the shared
module exists to prevent, and it is now reachable precisely because these strings
are runtime-required rather than statically extracted.

Assert every key in both shared copy objects matches en.json byte for byte, plus
the interpolation placeholders the catalog interpolates on.

---------

Co-authored-by: Merge Sim <sim@local>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* Show live tool progress in native chat

* fix(native-chat): scope live tool indicator to current turn

* fix(native-chat): settle orphaned live tool rows

* fix(native-chat): keep live tools running without lifecycle metadata

* fix(native-chat): keep working status stable during streaming

* fix(native-chat): anchor turn status below prompts

* fix(native-chat): preserve turn status and legacy tool activity

* fix(native-chat): limit turn status UI to structured Codex

---------

Co-authored-by: Merge Sim <sim@local>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…s Codex (stablyai#18743)

* fix(native-chat): render Claude structured chat through the same UI as Codex

Structured native chat is one shared, agent-agnostic component tree, but three
Codex-hardcoded terms on that path made a Claude session render differently.

- `showTurnStatus` was `agent === 'codex'`, which gated the whole structured
  presentation: the live tool-progress row, the completion check and activity
  grouping (`structuredActivityUi`), and the Thinking / Working for N /
  Worked for N status rows. Claude fell back to the legacy compact chrome.
- `runtimeContext` was likewise Codex-only, so a Claude transcript rendered
  images as filename chips instead of previews.
- The composer's structured slash menu always served the Codex catalog,
  ignoring `agent`. That disagreed with the dispatcher, which does branch per
  agent: Codex-only tokens offered to Claude missed the command guard and were
  sent to the model as literal prompt text, where Codex shows an error.

The first two gates landed Codex-first (stablyai#17597, stablyai#18266) before the Claude
structured lane existed; they were rollout scoping, not capability limits.
Neither `useNativeChatTurnStatus` nor `useNativeChatImageRuntimeContext` has
any agent-specific logic. The menu now reads `structuredSlashCommands(agent)`,
the function the dispatcher already used, so both read one list.

No new rendering logic: two gates removed and one existing shared function
reused. There are now zero `agent === 'codex' | 'claude'` branches in any
native-chat component.

* docs(native-chat): update structured turn status contract

---------

Co-authored-by: Merge Sim <sim@local>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tool progress (stablyai#18761)

* feat(mobile): port the restructured native-chat turn status and live tool progress

Mobile chat had a single static "Agent is working" row and no live tool
activity, while the desktop restructure (stablyai#17597, stablyai#18705) replaced that with a
per-turn status row and a running-tool label. This brings mobile to parity and
puts the derivation in one place instead of two.

Shared (new, pure, RN-safe — desktop uses them as i18n fallbacks, mobile
directly, matching the native-chat-empty-state pattern):
- `native-chat-turn-status.ts`: duration formatting, label selection, the
  turn-timing state machine, and the active/settled split.
- `native-chat-tool-activity.ts`: command-tool classification, the running-tool
  label descriptor, and running-call selection.

Desktop now consumes both; `NativeChatWorkingStatus`, `NativeChatToolRun` and
`use-native-chat-turn-status` keep their existing behavior and strings.

Mobile gains the "Thinking" / "Working for 12s" / "Worked for 3m 4s" row with a
caret that discloses the turn's tool activity, the pulsing "Running npm test"
row with terminal-vs-wrench glyphs, and desktop's rule that a completed turn's
tool run hides behind the turn caret. The bridge lane is untouched and keeps its
three-dot indicator. Headings, quotes, code, lists and table cells are now
selectable.

Files at their max-lines cap were split rather than bumped: the tool-run subtree,
the prompt card, the session-lane wiring, and the turn-disclosure state each move
to their own module.

* perf(mobile): stop the turn-status rows from re-rendering the whole transcript

A streaming turn re-renders the chat list many times a second. The disclosure
wiring handed every row a fresh status object and a fresh toggle closure on each
of those renders, so `MobileNativeChatMessage`'s memo never held and every
visible row re-rendered per tick — including settled turns that had not changed.

Memoize the status selection on the timing map, and keep one stable toggle
handler per turn (pruned when a turn leaves the transcript) attached only to the
settled rows that can actually disclose anything. Now only the live turn's row
changes identity while the agent works.

* fix(mobile): keep the turn clock running when the optimistic echo is replaced

An accepted send renders as `pending-N` until the transcript echo lands under
its real message id. That flips the active turn key mid-turn, and the timing
reducer treated the new key as a new turn — so a turn that had reached
"Working for 8s" visibly restarted at "Working for 0s".

The reducer now carries the start over when the previous key names a turn that
has since left the transcript, which is exactly the echo-replacement case. A
genuinely new turn (the previous key still in the transcript) and a turn that had
already settled both keep their own clock; both are pinned by tests. Desktop does
not pass the new key and is unaffected.

* fix(mobile): keep the Tools toggle working on settled turns

Hiding a settled turn's tool run behind the turn caret (desktop parity) also
made the composer's global Tools control a no-op on every completed turn: the
run it wanted to expand was not rendered at all. Let that toggle override the
hiding, so it still reveals every run at once the way it did before.

* fix(mobile): re-key the turn timing instead of only carrying its start

The previous fix carried the start forward only while the turn was still
working. When the transcript echo landed after the turn had already settled,
the new key inherited nothing, the settled timing was pruned with the old key,
and the turn's "Worked for N" row disappeared entirely.

Move the timing onto the new key instead, which covers both orderings: an
in-flight turn keeps counting from its original start (and later settles against
it), and an already-settled turn keeps its duration. Both orderings are pinned.

* test(mobile): pin the structured turn-status wiring at the view level

Emulator QA could not reach the structured lane (mobile's Create Tab -> Codex
falls back to a terminal tab when agentSession.createSupport says unsupported),
so the view's own lane wiring had no coverage — the one seam between the shared
turn-timing reducer and the rendered rows.

Assert what the view hands each row: the live user turn gets a status object and
the three-dot indicator is gone on the structured lane; the bridge lane keeps the
indicator and gets no status; a finished turn settles to a numeric duration with
a toggle; and an assistant row never carries a status row of its own.

* fix(mobile): isolate structured chat turn state

* fix(mobile): let the capability RPC actually store what a phone advertises

`runtime.clientCapabilities.update` records the advertised set by assigning
`authenticatedSocket.clientCapabilities`, but the socket handed to the dispatcher
defined that property with a getter only. In strict mode the assignment throws
`TypeError: Cannot set property clientCapabilities ... which has only a getter`,
so the RPC answered `runtime_error` and the set was never stored.

The consequence is not subtle: `supportsStructuredAgentSessions` requires the
capability, so `projectSessionTabAgentStatus` removed every `agent-session` tab
from a phone that had advertised it correctly. A paired phone saw ZERO tabs on a
worktree whose only tab was a structured Codex chat — structured native chat was
unreachable on mobile over this transport, not just missing its new turn UI.

Give the socket a setter that writes through to the channel, which already owns
the set for the connection's lifetime, so later requests on the same socket see
it. Found while trying to capture emulator screenshots of the turn-status port:
two full QA runs reported the new UI "missing" because the phone could only ever
get a bridge/PTY tab.

* fix(mobile): carry the turn key instead of caching a handler in a ref

Builds on the scope-isolation fix: that kept (and extended) a ref that is
written during render — once to memoize a per-turn handler, once to prune dead
turns, once to reset on a scope change. React Doctor's "Ref mutated during
render" is what CI's `check:react-doctor:changed` was failing on (x2), and on
mobile it is a real hazard rather than a style note: react-freeze discards
renders, and a discarded render would leave the cache mutated.

Pass the settled turn's key down the row instead and let it call one stable
handler with it. That preserves both properties the cache was bought for — per
scope isolation, and identity stability so a streaming transcript does not
defeat the row's memo — with no ref writes and no pruning to get wrong. The
scope-keyed expanded set and the 128-turn cap are untouched; their tests move to
the new contract and one now pins handler identity across a re-render.

Note for future changes here: `check:code-quality:changed` does NOT cover this.
CI additionally runs the standalone react-doctor CLI, which has rules the oxlint
plugin config does not enable.

* fix: ship native chat status translations

* test(native-chat): pin the shared copy against the English catalog

The shared constants are desktop's i18n fallback and mobile's actually-rendered
string. If one changes without the other, desktop keeps rendering en.json while
mobile renders the constant — and nothing fails, because a fallback is only used
when the key is missing. That silent divergence is the exact thing the shared
module exists to prevent, and it is now reachable precisely because these strings
are runtime-required rather than statically extracted.

Assert every key in both shared copy objects matches en.json byte for byte, plus
the interpolation placeholders the catalog interpolates on.

---------

Co-authored-by: Merge Sim <sim@local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant