Skip to content

fix(native-chat): show new Claude and Codex chats in the workspace sidebar before the first send - #47929

Merged
nwparker merged 2 commits into
stablyai:mainfrom
dzkchen:dzkchen/show-chat
Nov 24, 2026
Merged

nwparker merged 2 commits into
stablyai:mainfrom
dzkchen:dzkchen/show-chat

Conversation

@dzkchen

@dzkchen dzkchen commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When you open a new Claude or Codex chat, it now shows up under its workspace in the sidebar right away, the same way a terminal agent does. Before, it only showed up after you sent the first message.

What Changed

  • Before: a new Chat view tab for Claude or Codex had no row under the workspace until the first send. Terminal (TUI) agents got a row as soon as they started.
  • After: the chat gets an idle row as soon as the host publishes it. The first send updates that same row in place, so you never see a duplicate.

How it works: the chat journal publishes a summary with status: null until the first request is recorded. The renderer projection (structured-agent-session-status-projection.ts) used to treat that like "no session" and removed the row. Now a summary with no status becomes an idle session-boundary row. That is the same shape a terminal agent row has after SessionStart, so the dot, card rollup and notes menu read it exactly like a fresh TUI row. A missing summary still removes the row, and a failed launch still marks it failed. When the host republishes the empty journal, it stamps it with the current time. The opened row keeps its first clock anyway, so its age does not reset. The comments in the notes and send-target helpers now match this behavior.

Why

The bug lives in one place: the projection drops the published-but-unsent summary. Fixing it there keeps a single source for agent rows, so the sidebar, notes menu and CLI all read the same store entry. The wire contract and host stay unchanged, so mixed-version hosts keep working. We looked at adding a separate synthetic "open chat" row in the dashboard rows stage. That adds a second row source that every consumer would have to filter, so we chose this narrower change.

Linked Issue

Fixes #47919

Original fix by @dzkchen in #47929; final version reworked during the bug bash.

Reported by @dzkchen

Visual Proof

N/A: we did not capture new screenshots in this step. This change only moves where the row's data comes from (a renderer store projection). The before/after UI is what the original PR showed: the empty chat now has its row under the workspace. The new unit tests cover this behavior.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Repro on main: open a Claude or Codex chat in Chat view from the tab bar's + menu. No row appears under the workspace until you send a message.

New structured-agent-session-status-projection.test.ts (3 tests, real store):

  • An unsent chat becomes an idle session-boundary row. An unchanged host tick does not write the store. The first send updates the same pane-key row in place.
  • A null summary still removes the row, and a failed launch still projects a failure.
  • A republish of an unsent chat keeps the opened stateStartedAt.

Ran the targeted vitest suites for native-chat status and agent-session messaging, oxlint, oxfmt, anti-slop oxlint, native-plugins oxlint, ast-grep and the changed-code quality gate on the touched files. All clean. Tested on macOS. The change is renderer-only and has no platform-specific code.

Performance

None that matters. This runs in the renderer status bridge once per host status emission, and only for chats whose input changed. It is not on a typing, terminal-stream or polling path, and it adds no I/O, timers or subprocesses. Microbench with the real store, 1000 chats in one transaction, 3 runs each:

  • Unsent chat (new path): create 21.9-23.1 ms, republish 21.5-23.2 ms.
  • Sent idle chat (main's existing path): create 20.2-23.0 ms, republish 20.1-21.3 ms.

One chat costs about 0.02 ms. A 1000-chat burst only happens at restart, and it costs the same as 1000 sent chats on main.

Risk

Level: Low

An unsent chat now has a row that reads "done + session boundary", like a fresh terminal agent. If the boundary flag were mishandled, the row could show a stale age or look finished. Tests cover the clock and the in-place update. Known limit, unchanged from main: host and mobile orca worktree ps still leave out unsent chats, because their status is null on the wire. A plain revert backs this out.

Review

Reviewed the projection's remove/failed/opened branch table, the clock continuity rule, and the notes and send-target consumers of status-less chats.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only. Security, cross-platform, SSH, mobile and backwards-compatibility impact: none, because the wire contract and host are unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The status projection now publishes an idle session-boundary row when a chat has a summary but no status. It handles launch failures and removes the row when the summary is absent. Row-clock retention covers session boundaries and matching non-done rows. Tests cover idle-row publication, first-send updates, unchanged host ticks, row removal, launch failure, and opened-time preservation. Messaging comments now describe chats not yet published by the host.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 5fc88

New Claude and Codex chat sessions now appear in the sidebar as idle rows before the first message, and the first send updates that same row. The change is small and tested, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: new Claude and Codex chats now appear in the workspace sidebar before the first send. It is specific and matches the objectives and the summarized code changes. It use…
Description check Passed The description follows the template well. It has ELI5, What Changed, Why, a Linked Issue (Fixes #47919), Visual Proof marked N/A with a reason, Testing with checkboxes and test details, Performance w…
Linked Issues check Passed Directly linked issue #47919 has one coding requirement group. A new Claude or Codex Chat row must appear under its workspace before the first send. Clicking it must select the chat. The first send mu…
Out of Scope Changes check Passed The changes in the projection serve the linked feature. The opened-summary branch implements the idle row. The projectFailedStart branch covers a refused create or failed launch. The keptRowStateStart…
Full details: Title check

Explanation

The title names the main change: new Claude and Codex chats now appear in the workspace sidebar before the first send. It is specific and matches the objectives and the summarized code changes. It uses the conventional fix(scope) form and stays within a single sentence.

Full details: Description check

Explanation

The description follows the template well. It has ELI5, What Changed, Why, a Linked Issue (Fixes #47919), Visual Proof marked N/A with a reason, Testing with checkboxes and test details, Performance with a stated reason and microbenchmark, Risk with level Low and a revert note, Review, the upstream boundary checkbox, Notes, and Checklist. Two items are weak. The Visual Proof section refers to screenshots from the original PR rather than new before/after material, and the Linked Issue section says the original fix was by another contributor. The AI Disclosure section is left as template text. These gaps are minor, so the check passes.

Full details: Linked Issues check

Explanation

Directly linked issue #47919 has one coding requirement group. A new Claude or Codex Chat row must appear under its workspace before the first send. Clicking it must select the chat. The first send must update the same row. At head 5fc88ed, projectStatus in structured-agent-session-status-projection.ts sets opened = !summary.status. An opened summary projects sessionBoundary: true with an idle agent status. It is written under the same paneKey from structuredAgentSessionPaneKey(tab.id, tab.entityId). A later summary with a status overwrites that entry in place, because the paneKey is the same and sessionBoundary becomes false. A null summary still removes the row. A null-status summary with launchFailedAt set goes to projectFailedStart, which publishes a failure row. Opened-row clock continuity is handled by keptRowStateStartedAt, which keeps stateStartedAt when the current row is already a session boundary. This prevents the row age from resetting on an empty host republish. The change path is read from the head file. Test results (structured-agent-session-status-projection.test.ts, 3 tests) are reported by the PR and the raw summary. They were not rerun in this review. The runtime click-to-select behavior is not established by this projection diff. It depends on existing row selection code that was not inspected.

Full details: Out of Scope Changes check

Explanation

The changes in the projection serve the linked feature. The opened-summary branch implements the idle row. The projectFailedStart branch covers a refused create or failed launch. The keptRowStateStartedAt helper keeps the opened row clock stable. Its non-boundary branch also keeps stateStartedAt for a non-done row when state and workingMode are unchanged. That branch applies to sent chats too. It is a general continuity rule, but its stated purpose is to match host continuity in the same projection, and no unrelated code path is demonstrated. The comment-only edits in notes-send-agent-targets.ts and running-agent-targets.ts describe the new idle-row behavior and do not change logic. No unrelated change is demonstrated. The non-boundary clock rule is the main point to watch in review. Its effect on sent-chat clocks was not verified by a test run in this review.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7673e245-ba6c-4df1-80b0-2c531b01e00e
Commits

Reviewing files that changed from the base of the PR and between 60af895 and 5fc88ed.

Files selected for processing: 1

  • src/renderer/src/components/native-chat/session/status/structured-agent-session-status-projection.test.ts

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

…debar before the first send

A chat's journal publishes status null until its first request, and the
renderer projection dropped the row for that summary. Project a published
summary with no status as an idle session-boundary row, the same shape a TUI
has after SessionStart, so the first send updates the same row in place.
A missing summary still removes the row and a failed launch still marks it
failed. The opened row keeps its first clock when the host republishes the
empty journal.

Fixes stablyai#47919

Co-authored-by: David Chen <[email protected]>
@nwparker nwparker changed the title fix(sidebar): show native chats before the first prompt fix(native-chat): show new Claude and Codex chats in the workspace sidebar before the first send Nov 24, 2026
@nwparker
nwparker merged commit bd67f13 into stablyai:main Nov 24, 2026
55 checks passed
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.

[Bug]: New Claude and Codex chats are missing from the workspace sidebar until first send

2 participants