Skip to content

fix(runtime): a restarted managed server republishes restored tab titles right away - #29654

Merged
nwparker merged 1 commit into
mainfrom
nwparker/seeded-title-republish
Oct 16, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/seeded-title-republish

Conversation

@nwparker

@nwparker nwparker commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2

ELI5

After an SSH host's Orca server restarts, its terminal tabs used to show "Terminal 1", "Terminal 2" for a while before their real titles came back. Now the real titles come back right away.

What Changed

Before: #29623 made a restarted managed server read each surviving terminal's title from the daemon when it re-attaches. But the session-tabs feed had already been published once with default titles, and nothing republished after the title arrived. So a tab showed Terminal 1 until something unrelated triggered the next publication, which was over 15s in the soak.

After: the tab shows Terminal N for about 0.5s (the first snapshot sent before the re-attach), then the real title. Measured live: title-pub-99 → Terminal 2 → title-pub-99 within 503 ms of the reconnect.

Mechanism: seedTerminalRestoreTail now calls touchMobileSessionSnapshotsForPty after it seeds a restored title. That is the same coalesced publication path a live OSC title already takes in terminal-title-tracker.

Why

Why this approach: the seed only wrote the records. Live titles and seeded titles should reach clients the same way, so I reused the existing publication call rather than adding one.

Alternative considered: having the renderer keep its old title when the host sends a default one. I rejected it because a client connecting for the first time has no old title to keep.

No wire change.

Linked Issue

No pre-existing issue. Follow-up to #29623, found in the SSH soak.

Visual Proof

N/A. Title text only. The live trace of the tab titles is under Testing.

Testing

Live, on an isolated desktop and managed server on Linux (omarchy): I set an OSC title, killed orcad, and polled the desktop's tab titles every 500 ms.

  • Before: the default title stayed until the next unrelated publication, observed at more than 15s.
  • After: the real title was back 503 ms after the default flashed.

Tests:

  • pnpm test src/main/runtime/terminal-restore-record-seed.test.ts. New: a seeded title republishes session tabs. It fails on main.

  • Full local replay of the pr.yml static-analysis job (typecheck via pnpm tc).

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

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

Notes

The publication is coalesced. A spawn-path reattach seed now also touches publication once, which costs the same as one live title change.

Checklist

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

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Review in 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: f0e50746-54dd-4730-9514-942b3da0a206
📥 Commits

Reviewing files that changed from the base of the PR and between 5db05e8 and 591a13d.

📒 Files selected for processing: 2
  • src/main/runtime/terminal-restore-record-seed.test.ts
  • src/main/runtime/terminal/output/terminal-buffer-operations.ts

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

📝 Walkthrough

When a restore payload contains a title, seedTerminalRestoreTail now touches mobile session snapshots for the PTY after applying seeded agent status. A test verifies that the touch call receives the seeded PTY ID.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 591a1

Restored nonempty titles now trigger the mobile snapshot refresh; no concrete user-impacting issue warrants blocking merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: republishing restored tab titles after a managed server restart.
Description check Passed The description is complete and relevant. It explains the user impact, mechanism, rationale, alternative considered, testing, and checklist items. The Linked Issue section references follow-up to #296…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
Full details: Description check

Explanation

The description is complete and relevant. It explains the user impact, mechanism, rationale, alternative considered, testing, and checklist items. The Linked Issue section references follow-up to #29623 but does not use the requested “Fixes #” format.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@nwparker
nwparker merged commit 93ca977 into main Oct 16, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant