Repository navigation
fix(mobile): preserve custom title when renaming agent terminal tabs - #28713
zhangxaochen wants to merge 10 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🟠 High · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
069a0d04-6e4b-4f4a-88de-c12ff9533e63
📒 Files selected for processing: 11
mobile/src/session/use-mobile-session-close-actions.test.tsmobile/src/session/use-mobile-session-close-actions.tssrc/main/runtime/orca-runtime-persist-headless-terminal-title.tssrc/main/runtime/orca-runtime-resolve-worktree-removal-target.tssrc/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.tssrc/main/runtime/orca-runtime-write-orchestration-pointer-pty.tssrc/main/runtime/runtime-mobile-session-projection.tssrc/renderer/src/runtime/sync-runtime-graph/graph-publication.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-terminal-tabs.tssrc/shared/runtime-mobile-session-tab-contracts.tssrc/shared/runtime-session-contracts.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.
| const nextSessionTabs = sessionTabsRef.current.map((tab) => | ||
| tab.type === 'terminal' && tab.terminal === target.handle | ||
| ? { ...tab, title: title || 'Terminal' } | ||
| : tab | ||
| ) | ||
| sessionTabsRef.current = nextSessionTabs | ||
| setSessionTabs(nextSessionTabs) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '30,85p' mobile/src/session/use-mobile-session-close-actions.ts
rg -n 'sessionTabs|handleRenameTerminal|fetchSessionTabs' mobile/src/session | head -100Repository: stablyai/orca
Length of output: 12383
🏁 Script executed:
set -u
printf '%s\n' '--- mobile title/header bindings ---'
rg -n -F --glob '*.{ts,tsx}' -e 'sessionTabs' -e 'MobileSessionTab' -e 'title' mobile/src/session mobile/src | head -240
printf '%s\n' '--- fetchSessionTabs definitions/callers ---'
rg -n -F --glob '*.{ts,tsx}' -e 'function fetchSessionTabs' -e 'const fetchSessionTabs' -e 'fetchSessionTabs =' -e 'sessionTabsListRead' mobile/src/session | head -160
printf '%s\n' '--- rename operation bindings ---'
rg -n -F --glob '*.{ts,tsx}' -e 'sessionTerminalRename' -e 'terminalRename' src mobile | head -200Repository: stablyai/orca
Length of output: 29090
🏁 Script executed:
set -u
printf '%s\n' '--- tab rendering and state composition ---'
rg -n -F --glob '*.{ts,tsx}' -e 'sessionTabs.map' -e 'sessionTabsRef.current' -e 'setSessionTabs' -e 'SessionHeader' -e 'session header' mobile src | head -260
printf '%s\n' '--- read/write operation definitions ---'
sed -n '80,125p' mobile/src/session/mobile-session-read-operations.ts
sed -n '75,110p' mobile/src/session/mobile-session-write-operations.ts
printf '%s\n' '--- RPC rename symbols and likely host handlers ---'
rg -n -F --glob '*.{ts,tsx}' -e 'session.terminal.rename' -e 'terminal.rename' -e 'sessionTerminalRename' -e 'terminalRename' src mobile | head -260
printf '%s\n' '--- controller and screen state ---'
sed -n '1,180p' mobile/src/session/use-mobile-session-controller.ts
sed -n '1,180p' mobile/src/session/use-mobile-session-screen-state.tsRepository: stablyai/orca
Length of output: 31360
🏁 Script executed:
set -u
printf '%s\n' '--- MobileSessionHeader ---'
sed -n '1,190p' mobile/src/session/MobileSessionHeader.tsx
printf '%s\n' '--- session tab application and read flow ---'
sed -n '1,135p' mobile/src/session/use-mobile-session-tab-application.ts
sed -n '1,210p' mobile/src/session/use-mobile-session-terminal-list.ts
rg -n -F --glob '*.ts' -e 'fetchSessionTabs' -e 'sessionTabsListRead.request' mobile/src/session src/main/runtime | head -120
printf '%s\n' '--- terminal rename handler ---'
sed -n '90,160p' src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts
printf '%s\n' '--- terminal title construction ---'
rg -n -F --glob '*.ts' -e 'customTitle' -e 'generatedTitle' -e 'title:' src/main/runtime src/shared | head -240Repository: stablyai/orca
Length of output: 41827
🏁 Script executed:
set -u
printf '%s\n' '--- header tab label ---'
sed -n '125,215p' mobile/src/session/MobileSessionHeader.tsx
printf '%s\n' '--- fetchSessionTabs binding ---'
rg -n -F --glob '*.ts' -e 'fetchSessionTabs' mobile/src/session | head -100
sed -n '1,240p' mobile/src/session/use-mobile-session-tab-reconciliation.ts
printf '%s\n' '--- terminal rename implementation ---'
sed -n '105,145p' src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts
rg -n -F --glob '*.ts' -e 'renameTerminal(' -e 'resolveTerminalTabTitle' -e 'session-tabs-snapshot' src/main/runtime | head -120
printf '%s\n' '--- title projection definitions ---'
sed -n '105,215p' src/main/runtime/runtime-leaf-record-projection.ts
sed -n '100,135p' src/main/runtime/orca-runtime-write-orchestration-pointer-pty.tsRepository: stablyai/orca
Length of output: 29113
🏁 Script executed:
set -u
printf '%s\n' '--- mobile title helper and visible tabs ---'
rg -n -F --glob '*.ts' -e 'getMobileSessionTabTitle' -e 'visibleTabs' mobile/src/session | head -100
sed -n '1,220p' mobile/src/session/mobile-terminal-tab-agent.ts
sed -n '1,180p' mobile/src/session/use-mobile-session-presentation.ts
printf '%s\n' '--- session tabs fetch implementation ---'
sed -n '1,330p' mobile/src/session/use-mobile-session-tabs-reconciliation.ts
printf '%s\n' '--- runtime rename clear path ---'
sed -n '200,275p' src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts
printf '%s\n' '--- shared title resolution ---'
rg -n -F --glob '*.ts' -e 'function resolveTerminalTabTitle' -e 'export function resolveTerminalTabTitle' src/shared
sed -n '1,220p' src/shared/tab-title-resolution.tsRepository: stablyai/orca
Length of output: 22052
🏁 Script executed:
set -u
printf '%s\n' '--- mobile snapshot touch methods ---'
rg -n -F --glob '*.ts' -e 'touchMobileSessionSnapshotsForPty' -e 'touchMobileSessionTabsForWorktree' -e 'immediate:' src/main/runtime | head -140
printf '%s\n' '--- snapshot publication implementation ---'
rg -n -F --glob '*.ts' -e 'mobileSession' -e 'sessionTabs' src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts src/main/runtime | grep -E 'touchMobile|Snapshot|snapshot|session.tabs' | head -180
printf '%s\n' '--- rename tests ---'
sed -n '675,755p' src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts
sed -n '375,420p' src/main/runtime/orca-runtime-tests/terminal-side-effect-facts.spec.ts
printf '%s\n' '--- title retention tests ---'
sed -n '1,125p' src/main/runtime/orca-runtime-terminal-rename-retention.test.tsRepository: stablyai/orca
Length of output: 38849
🏁 Script executed:
set -u
printf '%s\n' '--- touch implementation ---'
sed -n '1,125p' src/main/runtime/orca-runtime-touch-mobile-session-tabs-for-worktree.ts
sed -n '1,190p' src/main/runtime/orca-runtime-publish-pty-backed-mobile-session-terminal.ts
printf '%s\n' '--- notification scheduling ---'
sed -n '1,190p' src/main/runtime/orca-runtime-schedule-mobile-session-tabs-changed.ts
printf '%s\n' '--- snapshot refresh coalescing ---'
sed -n '1,125p' src/main/runtime/mobile-session-tabs-churn-coalescing.test.tsRepository: stablyai/orca
Length of output: 23556
🏁 Script executed:
set -u
printf '%s\n' '--- coalescer definition and delay ---'
rg -n -F --glob '*.ts' -e 'mobileSessionTabsNotifyCoalescer' -e 'class .*Coales' -e 'schedule(worktreeId' src/main/runtime | head -160
printf '%s\n' '--- rename response contract ---'
rg -n -F --glob '*.ts' -e 'RuntimeTerminalRename' -e 'terminal-renamed' -e 'rename: RuntimeTerminalRename' src/shared src/main/runtime mobile/src | head -100
sed -n '1,80p' src/shared/runtime-types.tsRepository: stablyai/orca
Length of output: 4493
🏁 Script executed:
set -u
printf '%s\n' '--- exact decisive excerpts ---'
nl -ba mobile/src/session/use-mobile-session-close-actions.ts | sed -n '41,76p'
nl -ba mobile/src/session/MobileSessionHeader.tsx | sed -n '165,205p'
nl -ba mobile/src/session/mobile-terminal-tab-agent.ts | sed -n '42,70p'
nl -ba src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts | sed -n '210,268p'
nl -ba src/main/runtime/orca-runtime-touch-mobile-session-tabs-for-worktree.ts | sed -n '14,48p'
printf '%s\n' '--- coalescer binding ---'
nl -ba src/main/runtime/orca-runtime-runtime-id.ts | sed -n '235,260p'
rg -n -F --glob '*.ts' -e 'export class MobileSessionTabsNotifyCoalescer' -e 'class MobileSessionTabsNotifyCoalescer' src/main/runtime src/sharedRepository: stablyai/orca
Length of output: 11139
Do not show Terminal while clearing a custom title.
The host returns no live OSC title in the rename response. Keep the previous session-tab title until the authoritative session snapshot arrives. The host can publish that snapshot before the 300 ms refresh, so the exact delay is not fixed.
Suggested fix
- ? { ...tab, title: title || 'Terminal' }
+ ? { ...tab, title: title || tab.title }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const nextSessionTabs = sessionTabsRef.current.map((tab) => | |
| tab.type === 'terminal' && tab.terminal === target.handle | |
| ? { ...tab, title: title || 'Terminal' } | |
| : tab | |
| ) | |
| sessionTabsRef.current = nextSessionTabs | |
| setSessionTabs(nextSessionTabs) | |
| const nextSessionTabs = sessionTabsRef.current.map((tab) => | |
| tab.type === 'terminal' && tab.terminal === target.handle | |
| ? { ...tab, title: title || tab.title } | |
| : tab | |
| ) | |
| sessionTabsRef.current = nextSessionTabs | |
| setSessionTabs(nextSessionTabs) |
… field - Store manual renames in customTitle on RuntimePtyWorktreeRecord and update both renameTerminal branches - Read customTitle instead of pty.title for manualTitle in mobile session and terminal summary projections - Ensure controller-seeded titles do not shadow live Agent OSC updates - Eliminate type assertions in mobile and runtime tests to comply with strict code quality linting
|
@coderabbitai review |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b425fbd2-2a66-4990-98dc-a3b9dfb51218
📒 Files selected for processing: 6
src/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.tssrc/main/runtime/terminal/identity/pty-worktree-record.tssrc/main/runtime/workspaces/workspace-file-session-targets.tssrc/main/runtime/workspaces/workspace-removal-target.tssrc/renderer/src/runtime/sync-runtime-graph/graph-publication.tssrc/shared/runtime-session-contracts.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.
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Allow clearing the terminal title · MobileSessionHeader.tsx:175-186
mobile/src/session/MobileSessionHeader.tsx:175-186
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAllow clearing the terminal title
The double-tap path and the action-sheet Rename path both open this modal. The modal omits
allowEmpty, soTextInputModalrejects an empty submission. A user cannot clear an existing custom title. AddallowEmptyonly to the terminal rename modal so empty input reaches the rename handler and restores the live OSC title.Suggested fix
<TextInputModal visible={renameTarget != null} title="Rename Terminal" defaultValue={renameTarget?.title || 'Terminal'} placeholder="Terminal name" + allowEmpty onSubmit={(value) => void handleRenameTerminal(value)} onCancel={() => setRenameTarget(null)} />
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bdbac445-4ac0-41be-a3f2-5897f962c011
📒 Files selected for processing: 3
src/main/runtime/orca-runtime-terminal-rename-retention.test.tssrc/main/runtime/orchestration/terminal-authority/write-orchestration-pointer-pty.tssrc/main/runtime/workspaces/workspace-file-session-targets.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| ...(normalizedTitle === null && fallbackTitle !== null | ||
| ? { title: fallbackTitle } | ||
| : {}) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Persist the fallback title when clearing a headless custom title.
If no matching leaf supplies fallbackTitle, clearing the custom title sets the in-memory and mobile titles to Terminal. This branch leaves the persisted tab’s previous title unchanged. A later session rebuild can therefore restore the old manual title. Persist the same fallback title used by the in-memory paths.
…y cards and resume
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments: 1
src/main/runtime/workspaces/workspace-removal-target.ts: 1
252-253: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the duplicate session-title write.
persistHeadlessTerminalTitlealready callsresolveSessionIdForTab(tabId)andsetSessionCustomTitle. The nextrememberTerminalSessionTitlecall does the same work again, with the handle added. Each rename therefore writes the workspace session twice. If the two calls resolve different session IDs, one rename stores two aliases. Passhandleto the session-ID resolution insidepersistHeadlessTerminalTitle, or remove that resolution from it, so each rename has one write path.Also applies to: 259-262, 276-276
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
74a214e4-5b27-493d-a9dc-9d95a799c58d
📒 Files selected for processing: 46
mobile/src/agent-history/agent-history-session-card.tsmobile/src/session/ai-vault-resume-launch.test.tsmobile/src/session/ai-vault-resume-launch.tsmobile/src/worktree/agent-row-display.tssrc/main/orca-profiles/profile-project-session-field-disposition.tssrc/main/persistence/restoring-sessions/session-worktree-ownership.tssrc/main/persistence/runtime-authored-workspace-session-fields.tssrc/main/runtime/orca-runtime-terminal-rename-retention.test.tssrc/main/runtime/rpc/methods/ai-vault.tssrc/main/runtime/rpc/rpc-params-type-parity.tssrc/main/runtime/runtime-terminal-spawn-placement.tssrc/main/runtime/runtime-terminal-state-records.tssrc/main/runtime/runtime-worktree-agent-rows.tssrc/main/runtime/runtime-worktree-agent-source.tssrc/main/runtime/runtime-worktree-pty-agent-sources.tssrc/main/runtime/session-graph/session-graph-promotion.tssrc/main/runtime/session-graph/session-window-graph-titles.tssrc/main/runtime/session-graph/session-window-graph.tssrc/main/runtime/session-lifecycle/projection/build-headless-mobile-session-browser-tabs.tssrc/main/runtime/session-lifecycle/projection/headless-browser-tab-projection.tssrc/main/runtime/session-tabs/structured-session-tab-restoration.tssrc/main/runtime/terminal/launch/terminal-create.tssrc/main/runtime/workspaces/workspace-file-session-targets.tssrc/main/runtime/workspaces/workspace-process-listing.tssrc/main/runtime/workspaces/workspace-removal-target.tssrc/main/runtime/workspaces/workspace-session-custom-titles.tssrc/main/startup/main-window-agent-status.tssrc/main/startup/main-window-structured-status-filter.test.tssrc/renderer/src/components/right-sidebar/AiVaultSessionRow.structured-title.test.tsxsrc/renderer/src/components/right-sidebar/ai-vault-session-launch-actions.tssrc/renderer/src/components/right-sidebar/use-ai-vault-session-display-title.tssrc/renderer/src/lib/launch-ai-vault-session.tssrc/renderer/src/runtime/sync-runtime-graph/graph-publication.tssrc/renderer/src/runtime/web-session-tabs-sync/terminal-surfaces.tssrc/renderer/src/store/terminals/terminal-actions.tssrc/renderer/src/store/terminals/terminal-tab-appearance.tssrc/renderer/src/store/terminals/terminal-tab-creation.tssrc/shared/ai-vault-types.tssrc/shared/runtime-mobile-session-tab-contracts.tssrc/shared/runtime-session-contracts.tssrc/shared/workspace-layout/workspace-layout-beside.tssrc/shared/workspace-session-host-field-ownership.tssrc/shared/workspace-session-schema-field-coverage.test.tssrc/shared/workspace-session-schema.tssrc/shared/workspace-session-state-types.tssrc/shared/wsl-move/wsl-move-dispositions.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| }) | ||
| }) | ||
|
|
||
| <<<<<<< HEAD |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
rg -n '^(<<<<<<<|=======|>>>>>>>)' src/main/runtime/orca-runtime-terminal-rename-retention.test.tsRepository: stablyai/orca
Length of output: 168
Resolve the leftover merge-conflict marker.
src/main/runtime/orca-runtime-terminal-rename-retention.test.ts contains <<<<<<< HEAD at line 161. Resolve the conflict and remove all conflict markers so the test file can be parsed.
🧰 Tools
🪛 Biome (2.5.14)
[error] 161-161: Expected an expression but instead found '<<'.
(parse)
[error] 161-161: Expected an expression but instead found '<<'.
(parse)
Source: Linters/SAST tools
| if (session.structuredSession) { | ||
| runtime.setSessionCustomTitle(session.structuredSession.sessionId, customTitle) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
# Inspect title-key normalization and the structured-tab rename path.
rg -n -C 6 'getSessionCustomTitle\s*\(|setSessionCustomTitle\s*\(' src/main/runtime
sed -n '20,36p' src/renderer/src/store/terminals/terminal-tab-appearance.tsRepository: stablyai/orca
Length of output: 13223
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- workspace-session-custom-titles.ts ---'
nl -ba src/main/runtime/workspaces/workspace-session-custom-titles.ts | sed -n '1,90p'
printf '%s\n' '--- ai-vault.ts ---'
nl -ba src/main/runtime/rpc/methods/ai-vault.ts | sed -n '90,170p'
printf '%s\n' '--- stable pane parser ---'
rg -n -C 8 -F -- 'parsePaneKey' src/shared src/main/runtime | head -160Repository: stablyai/orca
Length of output: 23833
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- session title tab resolution ---'
nl -ba src/main/runtime/workspaces/workspace-session-custom-titles.ts | sed -n '104,156p'
printf '%s\n' '--- rename callers and agent-session identity ---'
rg -n -C 10 -F -- 'aiVault.renameSession' mobile src/main src/renderer | head -240
rg -n -C 8 -F -- "contentType: 'agent-session'" src/main mobile src/renderer | head -200Repository: stablyai/orca
Length of output: 26836
Keep provider and structured-session title keys consistent.
getSessionCustomTitle checks the exact key first, while setSessionCustomTitle writes or clears only the exact key. If provider and structured-session IDs differ, listing can copy a provider-keyed title to the structured-session key. Clearing the structured-session key then leaves the provider title, which a later list can restore.
Store one canonical title key, or clear every alias.
| for (const tab of tabs) { | ||
| const customTitle = tab.customTitle?.trim() || null | ||
| const previousCustomTitle = previousTabs.get(tab.tabId)?.customTitle?.trim() || null | ||
| if (customTitle) { | ||
| rememberTitle(tab.tabId, customTitle) | ||
| } else if (previousCustomTitle) { | ||
| rememberTitle(tab.tabId, null) | ||
| } | ||
| } |
There was a problem hiding this comment.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
Write session titles only when the custom title changes.
syncWindowGraph calls this function on every graph publish. Each tab with a custom title calls rememberTitle. That call runs resolveSessionIdForTab and setWorkspaceSession, even when the title is unchanged. Graph publishes are frequent, so this causes repeated full session writes and linear scans. Compare customTitle with previousCustomTitle and skip equal values.
⚡ Proposed fix
- if (customTitle) {
+ if (customTitle === previousCustomTitle) {
+ continue
+ }
+ if (customTitle) {
rememberTitle(tab.tabId, customTitle)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for (const tab of tabs) { | |
| const customTitle = tab.customTitle?.trim() || null | |
| const previousCustomTitle = previousTabs.get(tab.tabId)?.customTitle?.trim() || null | |
| if (customTitle) { | |
| rememberTitle(tab.tabId, customTitle) | |
| } else if (previousCustomTitle) { | |
| rememberTitle(tab.tabId, null) | |
| } | |
| } | |
| for (const tab of tabs) { | |
| const customTitle = tab.customTitle?.trim() || null | |
| const previousCustomTitle = previousTabs.get(tab.tabId)?.customTitle?.trim() || null | |
| if (customTitle === previousCustomTitle) { | |
| continue | |
| } | |
| if (customTitle) { | |
| rememberTitle(tab.tabId, customTitle) | |
| } else if (previousCustomTitle) { | |
| rememberTitle(tab.tabId, null) | |
| } | |
| } |
| const normalized = title?.trim() || null | ||
| if (normalized) { | ||
| this.inMemorySessionCustomTitles.set(sessionId, normalized) | ||
| } else { | ||
| this.inMemorySessionCustomTitles.delete(sessionId) | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Do not write titles longer than 256 characters into sessionCustomTitles.
setSessionCustomTitle stores any trimmed title. The schema in src/shared/workspace-session-schema.ts accepts only values with .max(256). salvagingRecord therefore drops longer entries on the next load, so a long rename is lost after restart. Truncate or reject the title here so the stored value matches the schema.
🐛 Proposed fix
--- "a/src/main/runtime/workspaces/workspace-session-custom-titles.ts"
+++ "b/src/main/runtime/workspaces/workspace-session-custom-titles.ts"
@@ -32,7 +32,7 @@
if (!sessionId) {
return
}
- const normalized = title?.trim() || null
+ const normalized = title?.trim().slice(0, 256) || null
if (normalized) {
this.inMemorySessionCustomTitles.set(sessionId, normalized)
} else {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const normalized = title?.trim() || null | |
| if (normalized) { | |
| this.inMemorySessionCustomTitles.set(sessionId, normalized) | |
| } else { | |
| this.inMemorySessionCustomTitles.delete(sessionId) | |
| } | |
| const normalized = title?.trim().slice(0, 256) || null | |
| if (normalized) { | |
| this.inMemorySessionCustomTitles.set(sessionId, normalized) | |
| } else { | |
| this.inMemorySessionCustomTitles.delete(sessionId) | |
| } |
| { | ||
| agent: session.agent, | ||
| worktreeId: targetId.worktreeId, | ||
| customTitle: session.customTitle ?? session.title ?? null, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Pass only the manual title as customTitle.
When session.customTitle is null, this expression passes session.title as a custom title. The local launch path then stores it in TerminalTab.customTitle. A resumed Agent consequently treats a scanned title as a manual rename and keeps it over later OSC titles. Pass session.customTitle without the scanned-title fallback.
| // Why: a manual rename lives only on the client; re-nulling it here made | ||
| // every host snapshot silently discard the user's title. | ||
| customLabel: existing?.customLabel ?? null, | ||
| customLabel: existing?.customLabel ?? tab.customTitle ?? null, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Allow host title updates after the first mirrored snapshot.
When the first snapshot supplies tab.customTitle = 'A', this line stores 'A' in customLabel. On the next snapshot, existing.customLabel wins even if the host changes the title to 'B' or clears it. The mirrored tab remains at 'A'. Track whether a label was edited locally, or otherwise reconcile host-supplied labels with the current host snapshot.
| .flat() | ||
| .find((t) => t.id === tabId)?.aiVaultTitle?.sessionId | ||
| if (sessionId) { | ||
| callRuntimeRpc({ kind: 'local' }, 'aiVault.renameSession', { sessionId, title }).catch( |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Send the rename to the session’s execution host.
When item.executionHostId identifies a remote host, { kind: 'local' } writes the title to the desktop runtime instead. The owning host keeps its old title and restores it on refresh. Route aiVault.renameSession to the unified tab’s execution host, as the other remote tab operations do.
| callRuntimeRpc({ kind: 'local' }, 'aiVault.renameSession', { sessionId, title }).catch( | ||
| () => {} | ||
| ) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Preserve the order of successive rename writes.
If a user renames a tab twice before the first RPC finishes, both writes run independently. The first write can finish last and restore the older title on the next refresh. Serialize writes for the session, or attach a revision that makes an older write ineffective.
|
Thanks for the report and the root-cause notes. This is superseded by #30163, a leaner fix for the same bug, so I'm closing this one. |
ELI5
When you rename an Agent terminal tab in the Orca mobile app, the new custom title is now immediately visible in the mobile tab bar and preserved across runtime updates, without breaking the Agent status indicator (working/permission/idle) or Agent provider icon.
What Changed
handleRenameTerminal, optimistically updatessessionTabsRefandsessionTabsstate (which powers the mobile header tab bar) upon RPC acceptance, and schedules refreshes for bothsession.tabs.listandterminal.list.customTitle. Both live PTY and bound PTY leaf fallback branches inrenameTerminalsetcustomTitle, updatetitle, and notify/touch mobile session snapshots.projectRuntimeMobileSessionTabsandbuildTerminalSummary, prioritizescustomTitleahead of Agent title normalization while preservingliveTitleEvidence(leafTitle ?? ptyTitle) for Agent activity status detection and icon resolution. Clearing custom titles restores the live Agent OSC title.Why
Previously, mobile tab renames only updated
terminal.listinstead ofsession.tabs.list, and the runtime projection prioritized live OSC titles over custom titles for active agent panes. Additionally, controller-provided PTY titles could shadow OSC updates if manual titles were not isolated in a dedicatedcustomTitlefield. StoringcustomTitleseparately guarantees that manual renames take precedence without corrupting OSC-driven state transitions or controller inventory fallbacks.Linked Issue
Fixes #28665
Visual Proof
N/A - Mobile UI title text update and host projection state alignment verified via automated unit and integration tests.
Testing
mobile/src/session/use-mobile-session-close-actions.test.ts: Verifies optimisticsessionTabsstate updates and fetch schedules on terminal rename.src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: Verifies leaf-backed agent terminal renaming, custom title persistence through OSC updates, clearing to restore live OSC titles, and ensuring controller-seeded titles do not lock custom titles.AI Disclosure
Assisted by Google DeepMind Antigravity agentic coding assistant for implementation, static analysis review resolution, and unit test coverage.
Review
Follows Orca runtime session projection contract and mobile action conventions.
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)