Skip to content

[Bug]: Renaming an Agent terminal tab on Mobile does not take effect #28665

Closed

Description

@zhangxaochen

Summary

On the mobile app (Android/iOS), long-pressing an Agent terminal tab in the session header opens the action sheet with a Rename option (Rename Terminal modal). Submitting a new name returns accepted: true from terminal.rename, but the tab title in the mobile tab bar never changes.

Root Cause

  1. Mobile client updates terminals instead of sessionTabs (mobile/src/session/use-mobile-session-close-actions.ts):
    • MobileSessionHeader renders visibleTabs = sessionTabs (session.tabs.list), which is the UI authority for the mobile tab strip.
    • handleRenameTerminal only mutated setTerminals(...) and scheduled fetchTerminals() (terminal.list), never updating sessionTabs (setSessionTabs / sessionTabsRef) or calling fetchSessionTabs().
  2. Host projectRuntimeMobileSessionTabs shadows customTitle with live Agent OSC titles (src/main/runtime/runtime-mobile-session-projection.ts):
    • When a desktop leaf is mounted (liveLeaf !== null), const pty = liveLeaf ? null : ... forces pty = null (ignoring liveLeafPty.title), while leafTitle is computed from displayLeaf.paneTitle and displayLeaf.lastOscTitle (which hold the raw Agent OSC title such as "✳ Claude Code" or "Codex").
    • projectRuntimeMobileSessionTabs evaluated trackerOnlyTitle ?? leafTitle ?? ptyTitle ?? syncedTab?.title ?? tab.title, so any Agent terminal that emitted an OSC title short-circuited on leafTitle (or trackerOnlyTitle) and ignored the user's customTitle in syncedTab.title / tab.title.
    • Similarly, buildTerminalSummary (src/main/runtime/orca-runtime-write-orchestration-pointer-pty.ts) passed tab?.title with updatedAt: 0 to getLatestLeafTitle, losing to leaf.paneTitleUpdatedAt / leaf.lastOscTitleAt.
  3. Host renameTerminal skips PTY title & snapshot updates on leaf-backed handles (src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts):
    • When a handle is bound to a leaf (record.tabId is a tab UUID rather than 'pty:...'), getLivePtyForHandle(handle) returns null, skipping pty.title updates, persistHeadlessTerminalTitle, and touchMobileSessionSnapshotsForPty.

Expected Behavior

  • Renaming an Agent terminal tab from the mobile tab action sheet immediately updates the tab title in the mobile header (sessionTabs) and persists across session.tabs.list and terminal.list refreshes.
  • Subsequent Agent OSC title updates (working / permission / idle spinner frames) continue to update agentStatus and preserve the Agent icon without overwriting the user's custom title.
  • Clearing the custom title restores the live Agent OSC title.

Activity

  1. AmethystLiang commented on Oct 14, 2026

    @AmethystLiang
    Contributor

    Thanks for reporting. Looking into it

  2. zhangxaochen commented on Oct 14, 2026

    @zhangxaochen
    ContributorAuthor

    Hi @AmethystLiang, I've submitted PR #28713 to resolve this issue with test coverage. Feel free to review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions