Skip to content

fix(mobile): keep Claude chat after a pane rename drops the glyph - #22865

Closed
innocarpe wants to merge 1 commit into
stablyai:mainfrom
innocarpe:fix/mobile-chat-after-rename
Closed

innocarpe wants to merge 1 commit into
stablyai:mainfrom
innocarpe:fix/mobile-chat-after-rename

Conversation

@innocarpe

Copy link
Copy Markdown
Contributor

Description

Renaming a Claude pane with orca terminal rename emptied the phone's chat until the original title was restored.

A manual title replaced the agent's OSC title. Headless projection treated any title without the agent glyph as the shell taking the pane back and dropped the hook session, so mobile chat had nothing to open. The transcript file was still there.

The rename now keeps that session when the pane's own OSC title is still an agent title.

Focused fix

  • In scope: headless mobile agent-status projection after a manual terminal rename.
  • Out of scope: changing rename itself, and chat for panes that never reported a provider session.

Preserves

  • A shell title that is also the pane's OSC title still clears a stuck agent status.
  • A pane that never reported a provider session still has no transcript address.
  • Live hook signals on a real shell reclaim are unchanged.

Evidence

  • Test: pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime-hook-agent-status-projection.test.ts src/main/runtime/runtime-mobile-agent-status-builder.test.ts
  • The new case fails before the fix because agentStatus is missing after the rename.

User-regression-tradeoffs

  • A renamed pane whose OSC title is still the agent keeps its chat even if the visible title has no glyph.

Fixes #20626

A manual terminal rename outranks the agent OSC title. Headless session
projection treated any title without the agent glyph as the shell
reclaiming the pane and dropped the hook provider session, so mobile
chat had no transcript to open until the original title was restored.

The rename now keeps that session when the pane's own OSC title is
still an agent title. A shell that never reported a session still does
not gain one.
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: 855e34ff-a521-431e-8fa0-ad33a553719a

📥 Commits

Reviewing files that changed from the base of the PR and between 646e9a5 and 333fedb.

📒 Files selected for processing (2)
  • src/main/runtime/orca-runtime-hook-agent-status-projection.test.ts
  • src/main/runtime/runtime-mobile-agent-status-builder.ts

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


📝 Walkthrough

Walkthrough

The runtime status builder now distinguishes a manual rename of an agent pane from a shell-reclaimed pane and bypasses shell-title suppression for that rename. Other non-agent titles retain the existing suppression check. Tests cover preserving an existing provider session after a rename and cases where a renamed pane has no provider session.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 333fe

The rename change preserves access to an existing transcript without changing the inspected shell-reclaim behavior. No actionable merge risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 333fe

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in src/main/runtime/orca-runtime-hook-agent-status-projection.test.ts: Adds a test that a completed hook row’s provider session remains in terminal agent status after renaming an agent-titled pane to a manual label.
  • observed — Modified behavior in src/main/runtime/orca-runtime-hook-agent-status-projection.test.ts: Adds a test that renaming a shell pane does not produce a provider-session address.
  • observed — Modified behavior in src/main/runtime/orca-runtime-hook-agent-status-projection.test.ts: Adds a test that renaming an agent-titled pane does not produce a provider-session address when the hook row has no provider session.
  • observed — Modified behavior in src/main/runtime/runtime-mobile-agent-status-builder.ts: The builder now identifies a non-agent title that differs from the OSC title while the OSC title still identifies an agent, and bypasses shell-title suppression for that manual-rename case. Other non-agent titles still enter the existing suppression check.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the bug, fix, scope, regression trade-offs, linked issue, and test command. It does not follow the required template and omits the required Visual Proof section, testing check… Update the description to include the template sections. Add before-and-after visual proof, or write N/A with a reason if no visual proof applies. Record manual testing, automated test updates, tested platforms, AI disclosure status, agent-…
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. 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 describes the main change: preserving Claude chat after a pane rename removes the agent glyph.
Linked Issues check ✅ Passed Issue #20626 requires the mobile projection to retain the agent transcript after a manual terminal rename. The builder now detects a non-agent visible title while the pane OSC title remains an agent t…
Out of Scope Changes check ✅ Passed The changes stay within issue #20626. The five-line builder change implements manual-rename detection, and the added tests cover transcript-address retention and the required no-session cases. No unre…
Full details: Description check

Explanation

The description explains the bug, fix, scope, regression trade-offs, linked issue, and test command. It does not follow the required template and omits the required Visual Proof section, testing checkboxes and platform coverage, checklist items, and other required headings.

Resolution

Update the description to include the template sections. Add before-and-after visual proof, or write N/A with a reason if no visual proof applies. Record manual testing, automated test updates, tested platforms, AI disclosure status, agent-skill boundary status, review notes, and checklist results.

  • Fix all pre-merge checks with AI

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

A targeted fix so a manual terminal rename no longer drops a headless mobile session's agent/chat identity.

  • src/main/runtime/runtime-mobile-agent-status-builder.ts:68-72 — adds a manualTitleOverridesAgentOsc guard that skips the shell-reclaim suppression when the pane's raw lastOscTitle is still an agent title and differs from the resolved latest title (i.e. a custom pty.title is newest).
  • src/main/runtime/orca-runtime-hook-agent-status-projection.test.ts:282-355 — a regression test for the rename case plus two negative guards (renamed shell pane; renamed pane whose hook row has no providerSession).

I verified the regression test fails with the guard reverted and passes with it in place, and that the full two-file suite is green. The condition is sound: renameTerminal stamps titleUpdatedAt with Date.now(), which dominates the sequence-number timestamps OSC updates use, so after a rename the manual title is always "latest" and lastOscTitle is the only evidence that the agent still owns the pane. The guard reads exactly that, and because a reclaimed shell rewrites lastOscTitle to its own non-agent title, the #1437 suppression path is untouched. Mobile chat eligibility keys off agentStatus.agentType/providerSession (not terminalTitle), so keeping the session is what restores the transcript view.

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

@nwparker

Copy link
Copy Markdown
Contributor

Thank you @innocarpe for this fix. Merged the adapted and native-verified change in #31358; Wooseong Kim [email protected] is credited with a Co-authored-by trailer in the merged squash commit 8bec732. Closing this superseded PR to keep one merged implementation.

@nwparker nwparker closed this Oct 21, 2026
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.

Mobile: renaming a Claude pane with orca terminal rename empties its chat view until the original title is restored

2 participants