Skip to content

fix(session-tabs): let a chat tab's name reach every paired client - #19859

Closed
brennanb2025 wants to merge 4 commits into
mainfrom
brennanb2025/paired-client-propagation
Closed

brennanb2025 wants to merge 4 commits into
mainfrom
brennanb2025/paired-client-propagation

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​585 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​584
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​202 $\color{#cf222e}{\Huge{\mathbf{−}}}$​36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​166

What breaks today

Rename a structured chat tab on the Mac and the phone keeps showing Claude Chat. Rename it on a second desktop and nothing moves.

Every other tab kind already has a host-owned name. A terminal's rename goes to the host over terminal.rename on its pty handle (orca-runtime-resolve-worktree-removal-target.ts:118-143), which persists customTitle and pushes the change back through the renderer, so a paired client sees it.

A structured chat has no pty, so it has no such channel. Three facts compose:

  1. The renderer never publishes an agent-session tab at all. buildMobileSessionTabSnapshots walks terminal | editor | browser and nothing else (sync-runtime-graph/mobile-session-snapshots.ts:114-146). The host mints the tab once, with a placeholder.
  2. That copy is preserved verbatim through every renderer republish — shouldPreserveHeadlessMobileSessionTab returns true unconditionally for agent-session (orca-runtime-stored-mobile-snapshot-has-stale-preserved-tab.ts:50-52).
  3. So the rename lands only in this client's store, as customLabel on the unified tab. The mirror side already said so out loud: "a manual rename lives only on the client" (web-session-tabs-sync/terminal-surfaces.ts:118-120).

STA-6934 and STA-6806 are the same defect from the two ends of the wire.

The change

The tab's owner holds the name. It joins color, pin and view mode on session.tabs.setTabProps — the channel that already exists for exactly this reason — so there is no parallel path.

  • SetTabProps gains optional title: string | null; RuntimeSessionTabProps is now the one shape both the RPC handler and setMobileSessionTabProps take.
  • The host persists it and applies it to the published snapshot. resolveHeadlessSessionTabDisplayTitle is the single place precedence is decided, so clearing a name republishes the agent placeholder rather than an empty label. The terminal half of that precedence is the existing projection expression, extracted as resolveHeadlessTerminalTabTitle rather than duplicated.
  • publishStructuredAgentSessionTab seeds the name from the persisted customLabel, so it survives the host forgetting the live tab.
  • The attached-window gate in setMobileSessionTabProps stays for renderer-owned tabs: its stated premise is that the renderer republishes the tab, true for terminals and false for chats. It is lifted only for a chat that is actually in the host's snapshot.
  • Desktop routes a chat rename to that tab's owner — the environment for a runtime-hosted workspace, the local host otherwise. Terminal renames are untouched and keep using terminal.rename.

Convergence between clients, and the three-state field

resolveUnifiedTabLabel prefers customLabel over label unconditionally (src/shared/tab-title-resolution.ts:33-42), and ingestion used to carry customLabel forward from existing?.customLabel. Publishing the name alone would therefore not converge: client A renames to Alpha, B renames to Beta, the host publishes Beta, and A keeps rendering Alpha indefinitely, across restarts. The first client to rename a chat would pin its own name forever.

So the host now publishes the raw name as RuntimeMobileSessionAgentTab.customTitle, beside the resolved title, and ingestion takes it — for agent-session tabs only. Terminals and editors legitimately own customLabel locally (tab-builders.ts:32 mirrors customTitle into it) and are deliberately untouched; resolveUnifiedTabLabel is not changed globally.

The two fields are separate on purpose. The host must be able to say "this chat has no name" distinctly from "its name happens to equal the placeholder" — otherwise a client would adopt the placeholder as a real user-given name and persist it as one.

customTitle is gated by its own presence, the three-state shape this repo already documents for agentWait:

  • present string — the host owns chat names and this is the one the user gave.
  • present null — the host owns chat names and this chat has none. The client clears its local name.
  • absent — the host predates host-owned names. The client keeps its local name. Absence must never read as "unnamed": a host that strips title still publishes its placeholder, so an unconditional clear would stomp a legitimate local rename against an old host.

That is the escape hatch Rule 1 requires, and it is why the earlier no-gate reasoning did not hold. It is carried in-band rather than as a capability-list lookup because the consumer is a per-frame reducer: the marker and the frame then come from the same publisher in the same message, and cannot be resolved against the wrong host — a real hazard here, since this ingestion serves both the local host and a runtime environment.

This also closes the durability loop. The renderer rewrites the whole persisted unified-tab array on any tab change (workspace-session-unified-tabs.ts), and the host seeds a restored chat from that same customLabel. Ingestion writing the host's name into customLabel means the desktop persists the host's own value back, instead of erasing it.

Mixed-version behaviour, both directions

  • New client → old host. The host strips the unknown title and answers {updated:true}; the rename stays local, exactly as today. The old host also omits customTitle, so the client keeps its local name rather than having it cleared. Degrades to current behaviour in both halves.
  • New host → old client. No wire shape changes. title was always a required string meaning "what to display", and now carries the user's name instead of the placeholder — a Rule 3 content change every shipped client interprets correctly (terminal-surfaces.ts:117; mobile renders title directly). customTitle is a new optional field an old client ignores, so it keeps its existing local-override behaviour and is no worse off than before.
  • No new stream opcode, no new frame, no RUNTIME_PROTOCOL_VERSION bump. The cross-version harness does not cover the session-tab sync channel, so this reasoning is the record.

Tests and ablations

orca-runtime-tests/structured-chat-tab-name.spec.ts (6+1), runtime/structured-chat-name-convergence.test.ts (8), additions to store/terminals/structured-chat-tab-rename.test.ts (4 new, 8 total) — 19 new tests.

The convergence file covers the three name states twice, at both entry points a frame can arrive through: the local-options shape and the bare three-argument shape a paired host takes (web-runtime-session-snapshot.ts, web-session-tabs-sync/global-session-events.ts). They behave identically today, which is a fact about today's code rather than a guarantee — a regression on the paired path would otherwise have left every other arm green.

The host tests assert what a subscribed client receives — frames delivered through onMobileSessionTabsChanged, the real subscription path. The convergence tests assert what the tab bar paints, through resolveUnifiedTabLabel, and what buildPersistedUnifiedTabSessionData writes. The renderer tests drive the real store action, so severing the wiring reddens them.

Every production lever reverted individually, at this head:

Reverted Result
all 14 production files → main, tests kept 16 of 19 failed
ingestion takes the host name 6 failed
the three-state gate — absence collapsed into null 2 failed — the old-host arm at both entry points
the two name fields collapsed into one, by comparing title to the placeholder 3 failed
the two name fields collapsed into one, taking title directly 5 failed
snapshot title application 4 failed
snapshot customTitle application 1 failed
agent-session: → unified-tab id matching 2 failed
renderer mirrorTabCustomTitleToHost call site 3 failed
mirror body (local host branch) 2 failed
restore-path name seeding 2 failed
attached-window gate relaxation 1 failed
gate removed entirely (over-widening) 1 failed
placeholder resolution on clear 1 failed
title on the SetTabProps schema 1 failed

Three of the 19 pass with all production code at main, all by construction: the two "keeps a local rename when the host predates host-owned chat names" arms assert preserved behaviour, and "leaves a terminal rename on its own host channel" is a negative control asserting that no round trip happens. None is left unproven — collapsing absence into null reddens both of the first, and the renderer call-site arm covers the path the third guards.

Bad-case-worse arms: clearing a name must never publish an empty label; the gate relaxation must not widen to renderer-owned terminal tabs; an old host must not have a local rename stomped; and a chat the user deliberately names after its own placeholder must keep that name. That last one is why the two fields are separate rather than one — both frames carry the identical rendered title, so a client with only that field has to guess by comparing against the placeholder, and throws the user's real name away. Both plausible one-field collapses are ablated above.

Green: tsc --noEmit separately on the node, web and CLI projects and on mobile/; check:code-quality:changed 0 findings across 18 files; 19958 passed across src/main/runtime, src/renderer/src/runtime, src/renderer/src/store and src/shared. The native-plugins oxlint run reports two import(no-cycle) warnings in mobile/src/transport/, byte-identical to main and in files this PR no longer touches at all.

Mixed-version check against live released hosts

Two paired runtime environments on the development machine were read read-only — openclaw 6768 on 1.4.190 and M4Air mac on 1.4.198, four read-only calls, nothing mutated.

This is not a live wire capture. No orca CLI command calls session.tabs.*, and the transport is end-to-end encrypted with per-device credentials, so capturing the literal frame would have meant reconstructing the handshake or pairing a fresh instance — a mutation, declined. The contract below is derived from those released hosts' own source at their exact live versions:

  • at 1.4.198 RuntimeMobileSessionAgentTab has no customTitle, and its sole producer emits exactly six keys, so JSON.stringify omits it — absent, not null;
  • at 1.4.190 the symbol does not exist at all; that release publishes no agent-session tab kind on this channel.

Client behaviour was then checked against a frame built from that released producer literal and JSON-round-tripped, with sensitivity arms confirming the rig detects the opposite outcomes.

A collapse-hop audit over the eight hops a frame crosses in receive order found none: parseRemoteRuntimeJsonText (plain JSON.parse), the runtime-rpc envelope (result: z.unknown() returned by reference, .strip() on envelope keys only, no .default()/.nullable()), runtime-rpc-result pass-through, the IPC structured clone, the retirement-proof ledger, orphan recovery, apply-preparation-base (filters rows, never rebuilds one), and terminal-surfaces.ts as the sole consumer. Repo-wide, every ?? null on customTitle reads the local TerminalTab, where the field is non-optional, and state-equality-tabs.ts:24 compares with ===, so undefined stays distinct from null.

Not validated: no Electron or device run, and no host running this branch. The desktop rename UI is asserted at unit level only, and the fix working end to end against a paired host cannot be shown without deploying this build to one.

What this does not close

The client→desktop direction is deliberately out of scope, filed as STA-7157. A rename from a phone lands host-side, but the desktop rewrites the whole persisted unified-tab array on its next tab action, so the host's value is clobbered and the following restore republishes the placeholder — the rename would work, propagate, then quietly revert. Both tickets here are desktop-to-everywhere, so that direction was scope beyond either, and it is the only part that carried a silent-loss path. The mobile Rename sheet and the session.tabs.setTabProps mobile-allowlist entry were removed along with it; this PR changes no mobile file.

The other four tickets in the surveyed cluster are separate mechanisms:

  • STA-6997 — settings write scope: settings.ts:208-241 routes only worktreeVisibilityDefaults and activeRuntimeEnvironmentId to the attached environment.
  • STA-6412 — applyBackendSpawnedDraftViewMode returns early on if (!backendSpawned || !request.launchDraftPrompt) (worktree-creation-agent-seeds.ts:57-58), so viewMode is never chosen.
  • STA-3868 — mobile-new-tab-agent-loader.ts:11-14,56-60 resolves the detection host from repo.connectionId alone, with no environment delegation in rpc/methods/.
  • STA-6693 — transcript delivery scheduling for a TUI agent, not tab-metadata publication.

Also found and left alone: with a desktop window attached, a paired client's color / isPinned / viewMode change is dropped by the same early return, because nothing forwards session.tabs.setTabProps to the renderer. This PR narrows the gate only for chat tabs, where the premise is provably false; widening it needs that forwarding path and belongs with STA-7157.

Closes STA-6934
Closes STA-6806

A structured chat is the one tab kind with no host-owned name. A terminal's
rename goes through terminal.rename on its pty handle; a chat has no pty, so
the rename only ever reached this client's customLabel while the host kept
publishing the placeholder it minted at create time and preserved verbatim on
every renderer republish. The phone, the web client and a second desktop all
read that placeholder.

Name is now carried on session.tabs.setTabProps beside color, pin and view
mode, so the tab's owner holds it, persists it, resolves the placeholder when
it is cleared, and republishes to every subscriber. The attached-window gate
in setMobileSessionTabProps stays for renderer-owned tabs and is lifted for
chats, whose copy the renderer never republishes.

Mobile gains the matching affordance: chat tabs get Rename, and a runtime that
cannot name one says so instead of silently dropping it.

Closes STA-6934, STA-6806
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1c21a119-ddd3-4b5b-b6d0-459273d8044f

📥 Commits

Reviewing files that changed from the base of the PR and between 240eeef and bfd0c56.

📒 Files selected for processing (1)
  • src/renderer/src/runtime/structured-chat-name-convergence.test.ts

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


📝 Walkthrough

Walkthrough

The change adds nullable title support to session-tab contracts and RPC handling. Renderer chat renames now mirror titles to local or environment runtimes. Runtime code persists custom titles, resolves display titles, restores titles, and publishes title state. Mobile session snapshots expose separate title and customTitle values. Renderer synchronization applies host-owned title changes while preserving legacy behavior. Tests cover renaming, clearing, persistence, restoration, mirroring, convergence, and schema validation.

Merge Risk: ⚪ Minimal · up to bfd0c

Structured chat renames now persist and converge through the owning host while preserving legacy-host behavior. The covered tests address renaming, clearing, persistence, and paired-client convergence, with no current merge blocker identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 24 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: propagating structured chat tab names to paired clients.
Description check ✅ Passed The description is detailed and on topic. It explains the problem, implementation, scope, linked issues, testing, mixed-version behavior, and known limitations. It omits several template headings, inc…
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.
  • Fix all pre-merge checks with AI
✨ 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.

@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

  • session.tabs.setTabProps gains title — a new optional title: string | null on SetTabProps / RuntimeSessionTabProps, joined to the existing color/pin/viewMode channel so a chat tab's name has the same host-owned propagation path.
  • Host persistence + single precedence resolver — persistHeadlessSessionTabProps writes customTitle / customLabel; resolveHeadlessSessionTabDisplayTitle decides named vs placeholder vs terminal projection, so clearing republishes the placeholder rather than an empty label.
  • Restore seeds the name — publishStructuredAgentSessionTab reads the persisted customLabel via resolveStructuredAgentSessionTabTitle, so a name survives the host forgetting the live tab.
  • Gate relaxed only for chats — the attached-window early return in setMobileSessionTabProps is lifted solely for an agent-session tab present in the host snapshot; terminal tabs keep the renderer-authoritative path.
  • Desktop + mobile wiring — mirrorTabCustomTitleToHost routes a chat rename to the runtime environment or the local host; mobile gains the Rename sheet, the allowlist entry, and an unsupported-host branch.

The host tests assert what a subscribed client receives through onMobileSessionTabsChanged, and the renderer tests drive the real setTabCustomTitle action. The terminal-rename no-op, clear→placeholder, restore-after-forget, and gate-holds-for-terminals arms all redden when their lever is severed, and I verified the id conventions (agent-session:<sessionId> on the wire, entityId === sessionId on unified rows, the hostSessionTabIdByLocalKey mapping for the web path) line up across host, renderer, and mobile.

ℹ️ Remote-runtime path is the one surface without end-to-end coverage

The desktop's runtime-hosted branch routes the rename through setWebRuntimeTabProps, whose host-tab-id resolution depends on the hostSessionTabIdByLocalKey mapping populated during web-session-tabs-sync (layout-groups.ts updateHostSessionTabIdMappings). The renderer test mocks setWebRuntimeTabProps entirely, so a real runtime-hosted pairing is the only path whose correctness is argued rather than exercised — consistent with the PR's own "no Electron or device run" note. Mergeable as-is; noting it only because this is exactly where a stale mapping would silently drop the rename.

Pullfrog  | 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: Advanced

Run ID: e4173250-a85d-4234-946c-92c16083ecbb

📥 Commits

Reviewing files that changed from the base of the PR and between 2bf298d and 7b4c61e.

📒 Files selected for processing (21)
  • mobile/src/session/MobileSessionSheets.tsx
  • mobile/src/session/mobile-agent-session-tab-rename.test.ts
  • mobile/src/session/mobile-agent-session-tab-rename.ts
  • mobile/src/session/use-mobile-session-close-actions.ts
  • mobile/src/session/use-mobile-session-tab-action-targets.ts
  • src/main/runtime/mobile-session-terminal-projection.ts
  • src/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.ts
  • src/main/runtime/orca-runtime-persist-headless-session-tab-props.ts
  • src/main/runtime/orca-runtime-restore-structured-agent-session-tabs-once.ts
  • src/main/runtime/orca-runtime-tests/structured-chat-tab-name.spec.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/rpc/methods/session-tab-mutation-methods.ts
  • src/main/runtime/rpc/methods/session-tabs-schemas.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-mobile-method-allowlist.ts
  • src/renderer/src/runtime/web-runtime-terminal-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-host-mirroring.ts
  • src/renderer/src/store/terminals/structured-chat-tab-rename.test.ts
  • src/renderer/src/store/terminals/terminal-tab-attention.ts
  • src/shared/runtime-mobile-session-tab-contracts.ts
  • src/shared/runtime-session-contracts.ts
  • src/shared/runtime-types.ts

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

)}
actions={[
{
label: 'Rename',

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Localize the new rename strings.

Replace the raw strings with intent-named localization IDs. Otherwise, localized clients show English for this new flow.

Based on learnings: new user-facing strings must use intent-named localization IDs with named interpolation placeholders.

Also applies to: 287-289

Source: Learnings

…ile entry point

Review found two problems with the first pass.

The client kept its own customLabel across every host frame, and
resolveUnifiedTabLabel prefers customLabel over label unconditionally. So the
first client to rename a chat pinned its own name forever: rename to Alpha
here and Beta anywhere else, and this client renders Alpha across restarts.
Multi-client convergence, which is the whole point, did not work between Orca
clients.

The host now publishes the raw name as `customTitle` beside the resolved
`title`, and ingestion takes it for agent-session tabs only. The three states
matter and absence is not "unnamed": a host that omits the key predates
host-owned names and cannot be told apart from one reporting no name, so that
case keeps the local name instead of stomping it. Terminals and editors keep
owning customLabel locally and are untouched. Publishing the raw name beside
the resolved one is what stops an unnamed chat persisting its own placeholder
as a name.

The mobile rename entry point is removed. It landed host-side but the
renderer rewrites the whole persisted unifiedTabs array on any tab action
(workspace-session-unified-tabs.ts), so a phone rename was clobbered back to
null and the next restore republished the placeholder — a silent-loss path
where main simply had no capability. Both tickets are desktop-to-everywhere;
that direction was scope beyond either. Filed as a follow-up.

Closes STA-6934, STA-6806

@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 deliberately dropped the mobile rename entry point, but the PR description still claims mobile rename and still closes STA-6806, which will falsely auto-close that ticket on merge.

Reviewed changes

  • Added customTitle to the agent-tab wire contract — a new optional customTitle?: string | null on RuntimeMobileSessionAgentTab with three states (present string = named, present null = unnamed, absent = host predates host-owned names), so a client can finally tell "cleared back to the placeholder" apart from "named after the placeholder". This is an additive optional field, so it is safe under the wire-compatibility rules and needs no protocol bump.
  • Host now ships both the resolved and the raw name — publishStructuredAgentSessionTab seeds title (resolved) and customTitle (raw) from the renamed resolveStructuredAgentSessionTabName, and applyHeadlessSessionTabPropsToSnapshot republishes both on a rename, trimming props.title before persisting.
  • Desktop mirror converges on the host instead of pinning the local name — buildMirroredAgentTabs sets customLabel from tab.customTitle with the three-state fallback, so another client's rename wins and the host's name survives the next desktop session write.
  • Replacement conversations reset their name — structured-conversation-tab-replacement.ts now emits customTitle: null.
  • Dropped the mobile rename entry point — the Rename sheet, mobile-agent-session-tab-rename.ts (+ test), and the session.tabs.setTabProps allowlist entry are gone; mobile can still see a chat's resolved name (it renders title), it just can no longer initiate a rename.

The convergence path is covered end-to-end at the unit level in both directions: the new renderer test drives applyWebSessionTabsSnapshot against a real host frame (asserting the local name is kept, replaced, and cleared across the three customTitle states, plus persistence), and the host spec asserts the exact title/customTitle a subscribed client receives through onMobileSessionTabsChanged. The three-state semantics are load-bearing here, and each arm reddens when the mirror's customTitle branch is severed.

⚠️ PR description still describes and closes the removed mobile rename path

The code no longer adds a mobile rename affordance — the Rename sheet, mobile-agent-session-tab-rename.ts, and the session.tabs.setTabProps allowlist entry are all removed — but the PR body still says "Mobile gets the matching affordance: chat tabs gain Rename", still closes STA-6806 ("try to rename one from the phone and there is no way to"), still carries the "From mobile the failure is louder…" mixed-version paragraph, and still lists mobile allowlist entry / mobile: unsupported-host branch / mobile: publish '' instead of clearing rows in the ablation table. As written, merging auto-closes STA-6806 without resolving it, and reviewers are told the PR ships a surface it no longer ships.

Technical details
# PR description out of sync with the dropped mobile entry point

## Affected sites
- PR body (not a code line) — claims mobile Rename, "Closes STA-6806", mobile mixed-version paragraph, and three now-deleted ablation rows.

## Required outcome
- Either remove "Closes STA-6806" and the mobile-rename prose/ablation rows (if mobile rename is now out of scope), or restore the mobile entry point (if STA-6806 is still intended to land here).

## Open questions for the human
- Is STA-6806 (rename from the phone) now deliberately out of scope for this PR, or planned as a follow-up?

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

A chat the user deliberately names after its own placeholder publishes the
same rendered title as one that was never named. Only customTitle separates
them, and nothing asserted that: collapsing the two fields back into one --
by comparing the title against the placeholder to guess whether a chat is
named -- passed every existing arm while silently discarding that user's name.

@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

  • Re-synced the PR body with the code — the description no longer claims a mobile rename affordance, explicitly scopes the client→desktop direction to STA-7157 ("this PR changes no mobile file"), and re-frames STA-6806 as the receiving-end twin of STA-6934 rather than a phone-initiated rename, resolving the prior must-address finding.
  • Pinned the "named after its own placeholder" case — a fifth convergence test asserts that a chat deliberately named Codex Chat keeps customLabel: 'Codex Chat' (and that it survives buildPersistedUnifiedTabSessionData) while an unnamed chat stays null, even though both frames render an identical title; it reddens if the mirror ever collapses the two name fields back into one.

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

The convergence arms ingested with the local options; a paired host arrives
through the bare three-argument shape used by web-runtime-session-snapshot
and global-session-events, which had no test on this branch. The two behave
identically today, but that is a fact about today's code, not a pin: a
regression on the paired path -- the path both tickets are about -- would
have left every other arm green.

Covers the three states at that entry point, including a released host that
omits customTitle entirely, which must keep the local rename rather than
read absence as "unnamed".
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Status: ready

All three readiness gates cleared at bfd0c567d4. Typecheck clean on node, CLI and web (run separately, exit read directly); no lockfile in any of the four commits; no NUL bytes; zero mobile files changed.

Scope: 2 of 6

STA-6934 and STA-6806 are one defect seen from both ends of the wire. The other four candidates were investigated and declined with named evidence, and spot-checked in review as genuinely different mechanisms rather than convenient deferrals: STA-6997 is settings write-scope, STA-6412 is a renderer-local view-mode early return, STA-3868 is host resolution from repo.connectionId, STA-6693 is transcript delivery scheduling.

The "one channel" framing this started from was half right. The channel already exists and already carries colour, pin and view mode — it simply never carried the name, and only for one tab kind. Every other tab kind already has a host-owned name; a structured chat has no pty, so it fell through three composing gaps plus an RPC allowlist gap.

Independent review — CLEAN WITH NITS, after one NOT CLEAN round

The first round found two blockers:

  • A stale local name won permanently. resolveUnifiedTabLabel prefers customLabel over label, while ingestion carried the local value forward — so client A renames to "Alpha", client B renames to "Beta", the host publishes "Beta", and A renders "Alpha" indefinitely, across restart. The "old-host fallback" framing was wrong: it was an unconditional preference. Multi-client convergence, the point of the change, did not work between clients.
  • A new silent-loss path. A mobile rename landed host-side but the renderer rewrites unifiedTabs wholesale on any tab change, so the next desktop action clobbered it back to null and the next restore republished the placeholder. Both tickets are desktop→everywhere, so that entry point was scope beyond either issue — it was cut entirely (zero mobile files remain, and the RPC allowlist is untouched), and filed as STA-7157 with the clobber path named.

The fix for the first blocker forced two things worth recording. It needs two fields, because the host must distinguish "unnamed" from "named exactly like the placeholder" — otherwise a client adopts the placeholder as a real name and persists it. And the gate had to become in-band three-state (present string / present null / absent = keep local) rather than a capability list: this ingestion serves both the local host and a runtime environment, so an out-of-band capability lookup can be resolved against the wrong host. remote-wire-compatibility.md:162-181 documents exactly this shape for agentWait, and doc:157-160 notes the cross-version harness does not cover this channel, so a capability list would have been equally unenforced.

Mixed-version — derived from the hosts actually running

This is not a live wire capture, and should not be read as one. No CLI command calls session.tabs.*, and the transport is E2EE with per-device credentials, so capturing the literal frame would have required reconstructing the handshake or pairing a fresh instance — a mutation, which was declined.

What was measured instead, read-only against the real paired environments: openclaw 6768 runs 1.4.190 and M4Air mac runs 1.4.198, both reachable. Reading those exact released tags' own source: at 1.4.198 RuntimeMobileSessionAgentTab has no customTitle and the sole producer emits exactly six keys, so JSON.stringify omits it — absent on the wire, not null. At 1.4.190 the symbol does not exist at all; that release publishes no agent-session tab kind on this channel.

Client behaviour was then exercised against a frame built from that released producer literal and JSON-round-tripped, with sensitivity arms proving the rig detects the opposite (customTitle: null clears the name; 'Beta' adopts it).

Collapse-hop audit: none found, checked in receive order across eight hops — JSON.parse, the RPC envelope (result: z.unknown() returned by reference, .strip() on envelope keys only, no .default() or .nullable()), the result pass-through, the IPC structured clone, the retirement-proof ledger, orphan recovery, apply-preparation filtering, and the sole consumer. Repo-wide, every ?? null on customTitle reads the local TerminalTab where the field is non-optional, and state-equality-tabs.ts:24 uses ===, so undefined stays distinct from null.

Tests

19 new tests; full production revert fails 16 of them. The three that pass at main do so by construction and are named as such: two preserved-behaviour arms whose catcher is the absence-collapse ablation, and one negative control asserting no call.

Validation found the paired-host entry point had no committed test — the convergence tests used the local options while a paired host uses the bare remote shape. Three arms were added there. Both collapses a future simplification might attempt are pinned: inferring "unnamed" by comparing title to the placeholder fails 3, taking title directly fails 5. And an arm proves the remote block actually reaches ingestion rather than passing inertly — without it, "keeps Alpha" would have passed equally well if the bare shape silently dropped the frame.

Not validated

No Electron or device run. No host running this branch — the fix working end to end against a paired host cannot be shown without deploying this build to one, which was deliberately not done. The two mobile/src/transport/ cycle warnings from the native-plugins oxlint config are pre-existing: the branch changes zero files in that directory, and a sorted diff against the main baseline is identical.

@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

  • Pinned the paired-host call shape with three new convergence tests — a new ingestRemote helper drives applyWebSessionTabsSnapshot through its real three-argument form (the shape web-runtime-session-snapshot.ts and global-session-events.ts actually use), and three tests assert the keep / adopt / clear customLabel outcomes at that entry point rather than only the local-options shape, so a regression on the paired path would redden independently of the local arm.

The new tests drive the real applyWebSessionTabsSnapshot against a real host frame and assert exact customLabel and renderedLabel outcomes, so they exercise the same buildMirroredAgentTabs ingestion the production path uses — not a mock. They pass (8/8 in the file).

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

@FranzFelberer

Copy link
Copy Markdown
Contributor

Thanks for this. It covers what I asked for in #24512: an agent hook that sets a short topic title on its own chat tab via session.tabs.setTabProps.

One thing I ran into while prototyping the same change locally, in case it helps: with a desktop window, the host calls a chat tab agent-session:<sessionId>, while the renderer keeps it as structured-agent-session-<sessionId>. A rename forwarded over ui:renameTerminal found no tab until findRenamableUnifiedTab also matched agent-session:${entityId}. I haven't checked whether #19859 already handles that path, so please ignore this if it does. I'm happy to share the test I wrote for it.

@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

Closing as superseded by #31602, which saves a chat's name and sends renames to the host that owns the chat, so every paired client gets it. Together with #31384 (terminal tabs) and #33743 (restarts), that fixed #8705. If there's a case this PR covered that #31602 doesn't, say so and I'll reopen.

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.

3 participants