Skip to content

fix(terminal): show AI Vault conversation names in tabs - #12778

Merged
brennanb2025 merged 5 commits into
mainfrom
brennanb2025/provider-native-tab-titles
Aug 6, 2026
Merged

brennanb2025 merged 5 commits into
mainfrom
brennanb2025/provider-native-tab-titles

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • project the matching Claude/Codex AiVaultSession.title into terminal and unified tabs using execution-host + provider-session identity
  • keep AI Vault as the single parser/authority for Claude custom/AI titles, Codex thread names, managed homes, WSL, SSH/relay, paired runtimes, and folder workspaces
  • persist the identity-bound Vault title across restoration while preserving manual rename, quick-command, OpenCode native, Orca-generated, and OSC fallback precedence
  • refresh Codex session_index.jsonl titles even when the transcript parse cache is unchanged; periodically refresh only live tab identities so later Claude/Codex renames propagate

Validation

  • focused title/parser/schema suites: 76 passing
  • runtime/remote/AI Vault integration suites: 232 passing
  • cross-version terminal wire suite: 4 passing
  • pnpm typecheck
  • pnpm lint
  • git diff --check and focused oxfmt --check
  • pnpm run build:electron-vite
  • Electron CDP isolated-profile launch, accessibility snapshot, screenshot, and clean renderer console/page errors

Electron visual gap: the isolated QA profile intentionally contained no real provider session, so the exact title projection is validated by focused integration tests rather than a fabricated screenshot state.

@coderabbitai

coderabbitai Bot commented Aug 5, 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: c550a4e5-3dd3-4534-bee9-0ad3ffe5458d

📥 Commits

Reviewing files that changed from the base of the PR and between f6d0bde and 6fe9e36.

📒 Files selected for processing (22)
  • src/main/ai-vault/session-scanner-codex-cached-title.ts
  • src/main/ai-vault/session-scanner-parse-cache-agents.test.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/AiVaultTabTitleSyncGate.tsx
  • src/renderer/src/lib/ai-vault-tab-title-requests.ts
  • src/renderer/src/lib/ai-vault-tab-title-scan-groups.ts
  • src/renderer/src/lib/ai-vault-tab-title-sync-inputs.ts
  • src/renderer/src/lib/ai-vault-tab-title-sync.test.ts
  • src/renderer/src/lib/ai-vault-tab-title-sync.ts
  • src/renderer/src/runtime/sync-runtime-graph.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/renderer/src/store/slices/tabs-hydration.ts
  • src/renderer/src/store/slices/tabs.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/shared/ai-vault-session-title.ts
  • src/shared/tab-title-resolution.test.ts
  • src/shared/tab-title-resolution.ts
  • src/shared/types.ts
  • src/shared/workspace-session-schema.test.ts
  • src/shared/workspace-session-schema.ts
💤 Files with no reviewable changes (1)
  • src/main/ai-vault/session-scanner.test.ts
🚧 Files skipped from review as they are similar to previous changes (20)
  • src/renderer/src/store/slices/tabs.ts
  • src/shared/workspace-session-schema.ts
  • src/shared/types.ts
  • src/renderer/src/lib/ai-vault-tab-title-scan-groups.ts
  • src/renderer/src/App.tsx
  • src/main/ai-vault/session-scanner-parse-cache-agents.test.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/shared/workspace-session-schema.test.ts
  • src/renderer/src/store/slices/tabs-hydration.ts
  • src/renderer/src/lib/ai-vault-tab-title-sync-inputs.ts
  • src/shared/tab-title-resolution.ts
  • src/shared/tab-title-resolution.test.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/shared/ai-vault-session-title.ts
  • src/renderer/src/components/AiVaultTabTitleSyncGate.tsx
  • src/main/ai-vault/session-scanner-codex-cached-title.ts
  • src/renderer/src/lib/ai-vault-tab-title-requests.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/renderer/src/runtime/sync-runtime-graph.ts
  • src/renderer/src/lib/ai-vault-tab-title-sync.ts

📝 Walkthrough

Walkthrough

The change adds AI Vault session-title types, validation, persistence, and Codex cached-title refresh. The renderer collects and synchronizes titles from retained, sleeping, and active sessions. Terminal and unified-tab state preserves titles across hydration, mirroring, runtime projections, and reconciliation. Title resolution applies AI Vault titles with defined precedence. Tests cover synchronization, persistence, cache reuse, and title precedence.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and validation, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the required sections, including the testing checklist, AI review and cross-platform confirmation, security audit, screenshots or "No visual change," and notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 4.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary user-visible change: showing AI Vault conversation names in terminal tabs.
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.
✨ 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: 3

🧹 Nitpick comments (3)
src/renderer/src/lib/provider-native-tab-title-sync.ts (1)

93-111: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Hoist the request re-collection out of the per-request loop.

collectProviderNativeTitleRequests walks retainedAgentsByPaneKey, sleepingAgentSessionsByPaneKey, agentStatusByPaneKey, and every terminal tab. The loop calls it once per request in the group. setProviderNativeTabTitle only changes tabsByWorktree entries' providerNativeTitle, which does not change any candidate identity, so the recomputation returns the same identities. Collect once before the loop and index by tabId.

⚡ Proposed refactor
+      const currentByTabId = new Map(
+        collectProviderNativeTitleRequests(dependencies.getState()).map(
+          (candidate) => [candidate.tabId, candidate] as const
+        )
+      )
       for (const request of requests) {
         const identity = requestIdentity(request)
         const title = titleByIdentity.get(identity)
         if (!title) {
           markMissing(identity)
           continue
         }
         attempts.delete(identity)
-        const current = collectProviderNativeTitleRequests(dependencies.getState()).find(
-          (candidate) => candidate.tabId === request.tabId
-        )
+        const current = currentByTabId.get(request.tabId)
         if (current && requestIdentity(current) === identity) {
src/renderer/src/store/slices/terminals.ts (1)

2087-2100: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Skip the unified-tab write when no unified tab matches.

unifiedTabs.map(...) always allocates a new array and always writes unifiedTabsByWorktree[ownerWorktreeId]. A terminal tab can exist in tabsByWorktree without a matching unified terminal tab, for example before reconciliation restores it. In that case this write changes the map reference without changing any member. Unified-tab subscribers, including the session writer, then run for nothing.

updateTabTitle in this same file avoids that: updateUnifiedTerminalLabel returns null when nothing changed and the caller omits the key. Mirror that pattern.

♻️ Proposed refactor
       const unifiedTabs = s.unifiedTabsByWorktree[ownerWorktreeId] ?? []
-      const nextUnifiedTabs = unifiedTabs.map((tab) =>
-        tab.contentType === 'terminal' && tab.entityId === tabId
-          ? { ...tab, providerNativeTitle }
-          : tab
-      )
+      let unifiedChanged = false
+      const nextUnifiedTabs = unifiedTabs.map((tab) => {
+        if (tab.contentType !== 'terminal' || tab.entityId !== tabId) {
+          return tab
+        }
+        unifiedChanged = true
+        return { ...tab, providerNativeTitle }
+      })
       scheduleRuntimeGraphSync()
       return {
         tabsByWorktree: { ...s.tabsByWorktree, [ownerWorktreeId]: ownerTabs },
-        unifiedTabsByWorktree: {
-          ...s.unifiedTabsByWorktree,
-          [ownerWorktreeId]: nextUnifiedTabs
-        }
+        ...(unifiedChanged
+          ? {
+              unifiedTabsByWorktree: {
+                ...s.unifiedTabsByWorktree,
+                [ownerWorktreeId]: nextUnifiedTabs
+              }
+            }
+          : {})
       }
src/shared/workspace-session-schema.test.ts (1)

278-284: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Assert the complete provider-native title object.

The test checks only title. agent and sessionId identify the provider session and drive synchronization. Assert the complete object for both terminal and unified tabs. Otherwise, the test can pass after title text survives but session identity is lost.

Proposed test assertion
-      expect(result.value.tabsByWorktree.wt[0].providerNativeTitle?.title).toBe(
-        'Provider thread name'
-      )
+      expect(result.value.tabsByWorktree.wt[0].providerNativeTitle).toEqual({
+        agent: 'codex',
+        sessionId: 'session-1',
+        title: 'Provider thread name'
+      })

-      expect(result.value.unifiedTabs?.wt[0].providerNativeTitle?.title).toBe(
-        'Provider thread name'
-      )
+      expect(result.value.unifiedTabs?.wt[0].providerNativeTitle).toEqual({
+        agent: 'codex',
+        sessionId: 'session-1',
+        title: 'Provider thread name'
+      })

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 75ca0b3d-dd05-4e18-8002-8be82cfa4e9f

📥 Commits

Reviewing files that changed from the base of the PR and between 73cd4c3 and e532edd.

📒 Files selected for processing (28)
  • src/main/ai-vault/session-list-result-validation.test.ts
  • src/main/ai-vault/session-list-result-validation.ts
  • src/main/ai-vault/session-scanner-accumulator.ts
  • src/main/ai-vault/session-scanner-claude-title.test.ts
  • src/main/ai-vault/session-scanner-codex-cached-title.ts
  • src/main/ai-vault/session-scanner-codex-parser.ts
  • src/main/ai-vault/session-scanner-parse-cache-agents.test.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-primary-parsers.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/ProviderNativeTabTitleSyncGate.tsx
  • src/renderer/src/lib/provider-native-tab-title-requests.ts
  • src/renderer/src/lib/provider-native-tab-title-sync.test.ts
  • src/renderer/src/lib/provider-native-tab-title-sync.ts
  • src/renderer/src/runtime/sync-runtime-graph.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/renderer/src/store/slices/tabs-hydration.ts
  • src/renderer/src/store/slices/tabs.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/shared/ai-vault-types.ts
  • src/shared/provider-native-session-title.ts
  • src/shared/tab-title-resolution.test.ts
  • src/shared/tab-title-resolution.ts
  • src/shared/types.ts
  • src/shared/workspace-session-schema.test.ts
  • src/shared/workspace-session-schema.ts
💤 Files with no reviewable changes (1)
  • src/main/ai-vault/session-scanner.test.ts

Comment on lines +28 to +31
function activePaneKey(state: AppState, tabId: string): string | null {
const activeLeafId = state.terminalLayoutsByTabId[tabId]?.activeLeafId
return activeLeafId ? `${tabId}:${activeLeafId}` : null
}

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm makePaneKey is exported from the shared pane-id module and matches the literal format.
fd -t f 'stable-pane-id.ts' src/shared --exec sh -c 'echo "== $1"; rg -n -C4 "export function (makePaneKey|parsePaneKey)" "$1"' sh {}

Repository: stablyai/orca

Length of output: 892


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate file imports and activePaneKey"
file="src/renderer/src/lib/provider-native-tab-title-requests.ts"
rg -n -C3 "import .*stable-pane-id|activePaneKey|makePaneKey|parsePaneKey" "$file"

echo
echo "== stable-pane-id export"
fd -t f 'stable-pane-id.ts' src/shared --exec sh -c 'sed -n "22,30p" "$1"' sh {}

echo
echo "== terminals.ts usages of makePaneKey"
if [ -f src/renderer/src/store/slices/terminals.ts ]; then
  rg -n -C2 "makePaneKey\(" src/renderer/src/store/slices/terminals.ts
fi

Repository: stablyai/orca

Length of output: 2369


Use makePaneKey for the active-pane lookup.

activePaneKey duplicates the pane-key separator convention. Import makePaneKey from src/shared/stable-pane-id.ts and reuse it here so this active-pane comparison stays aligned with the shared pane-key builder used elsewhere.

Comment on lines +57 to +64
const markMissing = (identity: string): void => {
const count = (attempts.get(identity)?.count ?? 0) + 1
const delay = RETRY_DELAYS_MS[count - 1]
attempts.set(identity, {
count,
retryAt: delay === undefined ? Number.POSITIVE_INFINITY : now() + delay
})
}

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 | 🟠 Major | ⚡ Quick win

A missing title parks the session for the whole process lifetime.

markMissing sets retryAt to Number.POSITIVE_INFINITY after the third attempt. reconcile then never adds that identity to ready, because retryAt <= now() is never true. The total retry window is 1 s + 5 s + 20 s. Claude and Codex often write the conversation name later than that, for example after the first assistant turn completes. In that case the tab never receives its provider-native title until the app restarts.

The attempts map also keeps entries for tabs that were closed, because only reconcile and scanGroup delete them and both require the identity to still be collected.

Consider one of these:

  • Repeat the last delay instead of parking, so a late title still lands.
  • Reset the attempt count when the pane's agent status or provider session changes.
  • Prune attempts entries whose identity is absent from the collected requests.
🔁 Proposed change: repeat the final delay and prune stale identities
 const markMissing = (identity: string): void => {
   const count = (attempts.get(identity)?.count ?? 0) + 1
-  const delay = RETRY_DELAYS_MS[count - 1]
-  attempts.set(identity, {
-    count,
-    retryAt: delay === undefined ? Number.POSITIVE_INFINITY : now() + delay
-  })
+  // Why: providers can name a conversation minutes after launch, so keep polling on the longest delay.
+  const delay = RETRY_DELAYS_MS[count - 1] ?? RETRY_DELAYS_MS[RETRY_DELAYS_MS.length - 1]
+  attempts.set(identity, { count, retryAt: now() + delay })
 }
     const ready: ProviderNativeTitleRequest[] = []
+    const liveIdentities = new Set(requests.map(requestIdentity))
+    for (const identity of attempts.keys()) {
+      if (!liveIdentities.has(identity) && !inFlight.has(identity)) {
+        attempts.delete(identity)
+      }
+    }
     for (const request of requests) {

If you keep a terminal cap, add a longer final delay tier instead of Infinity so the ladder still ends but stays useful.

Comment thread src/shared/workspace-session-schema.ts Resolved
@brennanb2025 brennanb2025 changed the title fix(terminal): show provider-native conversation names in tabs fix(terminal): show AI Vault conversation names in tabs Aug 5, 2026

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/shared/workspace-session-schema.ts (1)

75-82: 🩺 Stability & Availability | 🟠 Major

Add a field-level fallback for malformed aiVaultTitle.

aiVaultTitle is optional session metadata, but the nested object can reject an unknown agent, a non-object value, or malformed field types. The error can propagate through terminalTabSchema or tabSchema and make workspaceSessionStateSchema reject the complete workspace session.

Add .catch(undefined) after .optional() at Line 75 and Line 123. This is the same failure previously reported for providerNativeTitle; the rename did not change the failure mode.

Proposed fix
     .nullable()
-    .optional(),
+    .optional()
+    .catch(undefined),

Apply this change to both aiVaultTitle schemas.

Also applies to: 123-130


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d174353-43c2-441c-8ff8-6919bb48f18a

📥 Commits

Reviewing files that changed from the base of the PR and between e532edd and b9843e6.

📒 Files selected for processing (19)
  • src/main/ai-vault/session-scanner-codex-cached-title.ts
  • src/main/ai-vault/session-scanner-parse-cache-agents.test.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/AiVaultTabTitleSyncGate.tsx
  • src/renderer/src/lib/ai-vault-tab-title-requests.ts
  • src/renderer/src/lib/ai-vault-tab-title-sync.test.ts
  • src/renderer/src/lib/ai-vault-tab-title-sync.ts
  • src/renderer/src/runtime/sync-runtime-graph.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/renderer/src/store/slices/tabs-hydration.ts
  • src/renderer/src/store/slices/tabs.ts
  • src/renderer/src/store/slices/terminals.ts
  • src/shared/ai-vault-session-title.ts
  • src/shared/tab-title-resolution.test.ts
  • src/shared/tab-title-resolution.ts
  • src/shared/types.ts
  • src/shared/workspace-session-schema.test.ts
  • src/shared/workspace-session-schema.ts
💤 Files with no reviewable changes (1)
  • src/main/ai-vault/session-scanner-parse-cache-agents.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/renderer/src/store/slices/tabs.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/renderer/src/store/slices/tabs-hydration.ts
  • src/shared/workspace-session-schema.test.ts
  • src/shared/tab-title-resolution.test.ts

// Why: the host transport carries no generated title, so rebuilding the tab
// without this dropped the client's agent-prompt label on every snapshot.
...(existing?.generatedTitle ? { generatedTitle: existing.generatedTitle } : {}),
...(existing?.aiVaultTitle ? { aiVaultTitle: existing.aiVaultTitle } : {}),

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
git ls-files | rg '(^|/)src/renderer/src/runtime/(web-session-tabs-sync|sync-runtime-graph)\.ts$|(^|/)TerminalSurface|web-session-tabs-sync\.ts|sync-runtime-graph\.ts' || true

echo "== relevant line counts =="
for f in src/renderer/src/runtime/web-session-tabs-sync.ts src/renderer/src/runtime/sync-runtime-graph.ts; do
  if [ -f "$f" ]; then
    echo "--- $f wc ---"
    wc -l "$f"
  fi
done

echo "== snippets around mentioned lines =="
for f in src/renderer/src/runtime/web-session-tabs-sync.ts src/renderer/src/runtime/sync-runtime-graph.ts; do
  if [ -f "$f" ]; then
    echo "--- $f lines 480-680 ---"
    sed -n '480,680p' "$f" | nl -ba -v480
  fi
done

echo "== search aiVaultTitle references =="
rg -n "aiVaultTitle|TerminalSurface|activeSurface" src/renderer/src/runtime src/renderer/src -g '*.{ts,tsx,js,jsx,json,jsonc}' | head -n 200

Repository: stablyai/orca

Length of output: 664


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
for f in ['src/renderer/src/runtime/web-session-tabs-sync.ts', 'src/renderer/src/runtime/sync-runtime-graph.ts']:
    p = Path(f)
    lines = p.read_text(encoding='utf-8').splitlines()
    print(f'--- {f} lines 480-690 ---')
    for i in range(480, min(len(lines), 690)):
        print(f'{i+1}: {lines[i]}')
PY

echo "== search aiVaultTitle references =="
rg -n "aiVaultTitle|TerminalSurface|activeSurface" src/renderer/src/runtime src/renderer/src -g '*.{ts,tsx,js,jsx,json,jsonc}' | head -n 300

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('src/shared')
for f in sorted(p.rglob('*')):
    if f.is_file() and f.name.endswith(('.ts', '.tsx', '.d.ts')):
        s = f.read_text(encoding='utf-8', errors='ignore')
        if 'RuntimeMobileSessionTerminalClientTab' in s or 'TerminalSurface' in s or 'aiVaultTitle' in s:
            print(f'--- {f} ---')
            lines = s.splitlines()
            for i,l in enumerate(lines, 1):
                if any(x in l for x in ['RuntimeMobileSessionTerminalClientTab', 'TerminalSurface', 'aiVaultTitle', 'generatedTitle', 'quickCommandLabel']):
                    print(f'{i}: {l}')
PY

echo "== focused RuntimeMobileSessionTerminalClientTab definitions =="
rg -n "type RuntimeMobileSessionTerminalClientTab|interface RuntimeMobileSessionTerminalClientTab|RuntimeMobileSessionTerminalClientTab|GeneratedTitle|aiVaultTitle" shared src -g '*.{ts,tsx,d.ts}' | head -n 200

Repository: stablyai/orca

Length of output: 15935


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
for name in ['src/shared/runtime-types.ts', 'src/shared/workspace-session-schema.ts']:
    p = Path(name)
    print(f'--- {name} ---')
    lines = p.read_text(encoding='utf-8').splitlines()
    start = None
    end = None
    if name == 'src/shared/runtime-types.ts':
        for i,l in enumerate(lines, 1):
            if 'export type RuntimeMobileSessionTerminalClientTab' in l or 'export interface RuntimeMobileSessionTerminalClientTab' in l:
                start = i
            if start and (i > start + 100 or ('| RuntimeMobileSessionTerminalClientTab' in l and i > start + 30)):
                if not end:
                    end = i
                break
        if end is None:
            end = min(len(lines), start + 80)
    else:
        for i,l in enumerate(lines, 1):
            if 'aiVaultTitle' in l or 'generatedTitle' in l:
                line_i = i
                start = max(1, line_i - 6)
                end = min(len(lines), line_i + 12) if line_i > i else min(len(lines), line_i + 12)
                print(f'{max(1,line_i-8)}-{min(len(lines),line_i+14)}:')
                for j in range(max(1,line_i-8), min(len(lines),line_i+14)+1):
                    print(f'{j}: {lines[j-1]}')
    if start is not None and start <= end:
        for i in range(start, end + 1):
            print(f'{i}: {lines[i-1]}')
PY

echo "== inspect sync graph projection/construction around terminal surface tabs =="
python3 - <<'PY'
from pathlib import Path
p = Path('src/renderer/src/runtime/sync-runtime-graph.ts')
lines = p.read_text(encoding='utf-8').splitlines()
for a,b in [(1814,1925), (1508,1560)]:
    print(f'--- {p} lines {a}-{b} ---')
    for i in range(a, min(b, len(lines))+1):
        print(f'{i}: {lines[i-1]}')
PY

Repository: stablyai/orca

Length of output: 14707


Read the host aiVaultTitle when rebuilding a mirrored tab.

buildRuntimeMobileTabsProjection carries tab.aiVaultTitle, but buildMirroredTerminalTabs keeps only an existing value for the mirrored tab. On a fresh mirror this drops the host title; on an updated mirror it keeps a stale title when the host changes or clears aiVaultTitle.

Read activeSurface.aiVaultTitle when the host surface has it, use the existing only when omitted, and preserve an explicit null so host clears remove the local title. If the mobile terminal surface contract does not include aiVault, add it before using this value at this call site.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review follow-up pushed in 6f81eec:

  • Prevents live agent-status churn from bypassing the 20-second title refresh cadence, while still reacting immediately to provider identity and execution-host/path changes. Host scans now batch scope paths within the 64-path wire bound.
  • Treats malformed optional persisted AI Vault titles as field-local corruption instead of rejecting the workspace session.

Validation:

  • 69 focused tests passed across title sync, session persistence, title resolution, and provider parsing.
  • Typecheck, native/type-aware lint, max-lines ratchet, formatting, diff check, and relay builds passed.
  • Electron QA verified a real Codex hook changed the tab to Provider-native title review and that the title survived renderer reload with no console/page errors.
  • SSH QA connected a Linux relay, added a remote Git repository, opened a real SSH PTY, and completed a host-scoped AI Vault request without cross-host title leakage or scan issues. The disposable remote tree was removed.

Restored provider-native tab title

@brennanb2025

Copy link
Copy Markdown
Contributor Author

CI follow-up: every test shard on Node 24 and 26, typecheck, packaging (including Windows), Git compatibility, shell contracts, and cross-version wire compatibility passed. The only failing root check is static analysis (and its aggregate verify job): full-repo lint flags mobile/src/session/use-mobile-native-chat-controller.ts from the base branch for exceeding max lines. This PR does not touch mobile, so I left that unrelated base-branch issue out of scope.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@brennanb2025
brennanb2025 merged commit 18b27ac into main Aug 6, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(terminal): use provider-native session titles

* refactor(terminal): source session names from AI Vault

* fix(tabs): harden AI Vault title sync
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