Skip to content

Rename live Copilot sessions and find titled ones remotely - #957

Merged
scgopi merged 2 commits into
mainfrom
fix/copilot-session-rename
Nov 4, 2026
Merged

scgopi merged 2 commits into
mainfrom
fix/copilot-session-rename

Conversation

@scgopi

@scgopi scgopi commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Problem

A blank-titled Copilot loop launches as graphcode-<uuid>, because its suggested title only arrives after the session has started. Only Claude Code was sent /rename, so the Copilot session kept that name for good, and later loop renames were lost the same way.

Separately, the remote Copilot lookups still matched the bare name exactly, so they never found a session named Title · <id>. That affects the remote summary, the resume ID banking, presence and transplant.

Fix

  • CLISessionBackendKind.renameCommand gives each backend its rename text. Copilot gets /rename Title · <8-char id>, because its name is also its lookup key.
  • GraphStore.renameSession uses it instead of checking for Claude Code. It stays behind the sessionNaming ramp and still skips the NewNode placeholder.
  • ZmxSessionLauncher.awaitRenameWindow holds a Copilot rename, for up to three minutes, until no first pass is in flight, no permission dialog or ask_user is open, and a session with an opening prompt has shown it. If the wait runs out, nothing is typed and dials.log records window-closed. Claude Code's timing is unchanged.
  • copilotNameMatcher replaces the exact grep at all four remote sites and accepts the bare name or the titled one, quoted or not.
  • Titled Copilot names drop double quotes and fit 100 characters, which Copilot's rename requires. Session labels for every backend drop control characters, because a tab moved Copilot to another screen.

Evidence

Copilot 1.0.96-2 with an isolated daemon and real loops:

Case name: in workspace.yaml Result
Rename during a foreground tool call 'Fix: live · 94184782' Applied in 1.1s, one user.message, turn not interrupted
Rename as soon as the session directory appears Early Rename · 59A3B883 Held until the session opened, landed after about 10s
Rename at an open permission dialog (ask) Stayed bare After 35s: 0 permission.completed, tool not run
Rename while a goal loop under ask sits silent before its first message Stayed bare Nothing typed in 190s; window-closed logged

RED: xcodebuild test -only-testing SessionNamingTests with the matcher and Copilot rename reverted -> exit 65, 9 issues; with the window ignored, the matcher loosened and quotes kept -> exit 65, 5 issues
GREEN: xcodebuild test -only-testing CopilotRenameTests and SessionNamingTests -> exit 0, 33 tests passed
REGRESSION: xcodebuild -scheme graphcode test -> exit 0, 2349 tests, 2348 passed, 0 failed, 1 skipped; make check -> exit 0; graphcoded and graphcode-cli builds -> exit 0; portable package -> exit 0; cli-smoke with a separate SwiftPM build -> exit 0

Not covered

  • The remote reads were tested by running the emitted shell against a fake home and fake zmx, not on a live remote or codespace, and not against GNU grep.
  • Only a first pass and open questions hold the rename. A person's draft in the composer can still interleave with /rename.
  • A rename made while the session is down, or one whose wait ran out, does not arrive later.
  • A goal loop under ask that stays silent keeps its bare name.
  • A person typing /rename in Copilot still drops the suffix.
  • Claude Code's rename has no window, so its keystrokes can still reach an open dialog. pi, OpenCode and Codex renames, title-call session clutter, and the stable ramp are unchanged.

scgopi and others added 2 commits November 2, 2026 19:00
A blank-titled Copilot loop launched as graphcode-<uuid> and kept that name,
because its suggested title arrives after launch and only Claude Code was sent
/rename. Later renames were lost the same way. Copilot now gets /rename with the
node's short id kept, since the name is also its lookup key.

The remote lookups still matched the bare name exactly, so they never found a
session named after its loop. All four now accept both forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
The review of this PR found that /rename shared the session with things it could
collide with. The first pass types outside GraphStore's chain, so the two could
merge into one name and lose the lookup key. A liveness gate alone also let Enter
land on a permission dialog, or /rename answer an open ask_user.

A Copilot rename now waits, for up to three minutes, until no first pass is in
flight, no question is open and the session has opened. If the wait runs out, the
name stays stale and nothing is typed.

Also keep titles inside what Copilot's rename accepts, drop control characters from
session labels, tighten the remote matcher to a real closing quote, and pin the
summary and presence reads with tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
@scgopi
scgopi merged commit d1023f9 into main Nov 4, 2026
27 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