Give a hand-renamed window's name to its session #339

Open
nelson wants to merge 1 commit from ses-325-window-rename into main
Owner

Work package: https://openproject.home.romaine.life/wp/SES-325

Renaming an at-claude window by hand (tmux's rename-window, prefix ,) left its Claude session under the old name: other sessions and resume-claude listed the old one, and a restarted or resumed window took it back. The window only ever copied the session's name onto tmux, never the other way.

Added

  • The window sets tmux's window-renamed hook on its tmux window, in the pane's own slot (window-renamed[<pane>]), and clears it as it quits. The hook runs at-claude renamed -pane <n>, which reads the window as tmux has it now and, when automatic-rename is off (a rename, not tmux's automatic name) and the pane has a host, hands the name over through a new renamed host role. It says nothing and always exits 0, since tmux shows a run's output in the pane; failures go to the log.
  • The host passes it to the attached window as a window-renamed event, not kept with the conversation (Claude Code has the name by then, which a later window reads).
  • The window takes a name that isn't already its own as the session's given name: kept in claude-title, given to Claude Code (rename), and final over a late Haiku answer. at-claude's own renames fire the hook too and are passed over, since the name is already the window's.

Left alone: the protocol number (an older window drops the event, an older host closes the unknown role), Low integrity clients (the role isn't allowed below Medium), and how a session's own /rename or Haiku name the window.

Checked on a throwaway tmux server with this build: a hand rename wrote custom-title "Hand Named" to the session and its claude-title file; resuming the session opened the window as "Hand Named"; a second rename landed the same way; at-claude's own renames logged no hand rename. ci-check passed. TestLowIntegrityChild fails on this PC on main too (its Low temp write is refused here), not touched by this change.

🤖 Generated with Claude Code

Work package: https://openproject.home.romaine.life/wp/SES-325 Renaming an at-claude window by hand (tmux's rename-window, `prefix ,`) left its Claude session under the old name: other sessions and `resume-claude` listed the old one, and a restarted or resumed window took it back. The window only ever copied the session's name onto tmux, never the other way. **Added** - The window sets tmux's `window-renamed` hook on its tmux window, in the pane's own slot (`window-renamed[<pane>]`), and clears it as it quits. The hook runs `at-claude renamed -pane <n>`, which reads the window as tmux has it now and, when `automatic-rename` is off (a rename, not tmux's automatic name) and the pane has a host, hands the name over through a new `renamed` host role. It says nothing and always exits 0, since tmux shows a run's output in the pane; failures go to the log. - The host passes it to the attached window as a `window-renamed` event, not kept with the conversation (Claude Code has the name by then, which a later window reads). - The window takes a name that isn't already its own as the session's given name: kept in `claude-title`, given to Claude Code (`rename`), and final over a late Haiku answer. at-claude's own renames fire the hook too and are passed over, since the name is already the window's. **Left alone:** the protocol number (an older window drops the event, an older host closes the unknown role), Low integrity clients (the role isn't allowed below Medium), and how a session's own `/rename` or Haiku name the window. **Checked** on a throwaway tmux server with this build: a hand rename wrote `custom-title` "Hand Named" to the session and its `claude-title` file; resuming the session opened the window as "Hand Named"; a second rename landed the same way; at-claude's own renames logged no hand rename. `ci-check` passed. `TestLowIntegrityChild` fails on this PC on main too (its Low temp write is refused here), not touched by this change. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Give a hand-renamed window's name to its session (SES-325)
Some checks failed
Suite default / scope (pull_request) Successful in 22s
Suite go / scope (pull_request) Successful in 20s
Suite default / check-fetches (pull_request) Has been skipped
Suite go / check-test-windows (pull_request) Has been skipped
Suite go / check-services (pull_request) Has been skipped
Suite release / scope (pull_request) Successful in 23s
Suite release / module (pull_request) Has been skipped
Suite release / reserve (pull_request) Has been skipped
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite release / home-sync (pull_request) Has been skipped
Suite release / deliver (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite release / deliver-prune (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 25s
Suite default / check-logs (pull_request) Successful in 27s
Suite go / check-format (pull_request) Successful in 37s
Suite release / reused-checks (pull_request) Successful in 34s
Suite default / reused-checks (pull_request) Successful in 29s
Suite go / check-test-linux (pull_request) Failing after 22s
merge-queue CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran)
go.mod merge conflicts in internal/host/host.go, internal/host/host_test.go, internal/host/protocol.go too, not only go.mod and go.sum
Suite go / reused-checks (pull_request) Successful in 5s
8bdf3916f0
Renaming an at-claude window by hand (rename-window, prefix ,) left the
session under its old name everywhere else, and a restarted or resumed
window took the old name back. The window now sets tmux's window-renamed
hook on its tmux window; its at-claude renamed run reads the window as tmux
has it, and hands a hand rename (automatic-rename off) to the window
through its host's new renamed role. The window keeps it as the session's
given name and gives it to Claude Code, as it does Haiku's.
Collaborator

merge-queue stopped this at 8bdf391: CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at 8bdf391: CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
Collaborator

merge-queue stopped this at 8bdf391: conflicts with main: conflicts in internal/host/host.go, internal/host/host_test.go, internal/host/protocol.go too, not only go.mod and go.sum. Push a fix, or once it is fixed outside this pull request, remove and re-add the queue label.

merge-queue stopped this at 8bdf391: conflicts with main: conflicts in internal/host/host.go, internal/host/host_test.go, internal/host/protocol.go too, not only go.mod and go.sum. Push a fix, or once it is fixed outside this pull request, remove and re-add the `queue` label.
Collaborator

merge-queue stopped this at 8bdf391: CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at 8bdf391: CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
Collaborator

merge-queue stopped this at 8bdf391: conflicts with main: conflicts in internal/host/host.go, internal/host/host_test.go, internal/host/protocol.go too, not only go.mod and go.sum. Push a fix, or once it is fixed outside this pull request, remove and re-add the queue label.

merge-queue stopped this at 8bdf391: conflicts with main: conflicts in internal/host/host.go, internal/host/host_test.go, internal/host/protocol.go too, not only go.mod and go.sum. Push a fix, or once it is fixed outside this pull request, remove and re-add the `queue` label.
Collaborator

merge-queue stopped this at 8bdf391: conflicts with main: conflicts in internal/host/host.go, internal/host/host_test.go, internal/host/protocol.go too, not only go.mod and go.sum. Push a fix, or once it is fixed outside this pull request, remove and re-add the queue label.

merge-queue stopped this at 8bdf391: conflicts with main: conflicts in internal/host/host.go, internal/host/host_test.go, internal/host/protocol.go too, not only go.mod and go.sum. Push a fix, or once it is fixed outside this pull request, remove and re-add the `queue` label.
Collaborator

merge-queue stopped this at 8bdf391: CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran). Push a fix. A failure fixed on main lands once the queue label is removed and added again: the queue merges main in and CI runs on the new head.

merge-queue stopped this at 8bdf391: CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran). Push a fix. A failure fixed on main lands once the `queue` label is removed and added again: the queue merges main in and CI runs on the new head.
Some checks failed
Suite default / scope (pull_request) Successful in 22s
Required
Details
Suite go / scope (pull_request) Successful in 20s
Required
Details
Suite default / check-fetches (pull_request) Has been skipped
Required
Details
Suite go / check-test-windows (pull_request) Has been skipped
Required
Details
Suite go / check-services (pull_request) Has been skipped
Required
Details
Suite release / scope (pull_request) Successful in 23s
Required
Details
Suite release / module (pull_request) Has been skipped
Required
Details
Suite release / reserve (pull_request) Has been skipped
Required
Details
Suite release / check-build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Required
Details
Suite release / check-package (pull_request) Has been skipped
Required
Details
Suite release / build (go, ubuntu-latest) (, go, false, ubuntu-latest, , go) (pull_request) Has been skipped
Required
Details
Suite release / finalize (pull_request) Has been skipped
Required
Details
Suite release / publish (pull_request) Has been skipped
Required
Details
Suite release / home-sync (pull_request) Has been skipped
Required
Details
Suite release / deliver (pull_request) Has been skipped
Required
Details
Suite release / deploy-image (pull_request) Has been skipped
Required
Details
Suite release / deliver-prune (pull_request) Has been skipped
Required
Details
Suite default / check-rules (pull_request) Successful in 25s
Required
Details
Suite default / check-logs (pull_request) Successful in 27s
Required
Details
Suite go / check-format (pull_request) Successful in 37s
Required
Details
Suite release / reused-checks (pull_request) Successful in 34s
Required
Details
Suite default / reused-checks (pull_request) Successful in 29s
Required
Details
Suite go / check-test-linux (pull_request) Failing after 22s
Required
Details
merge-queue CI failed: Suite go / check-test-linux (pull_request), Suite go / reused-checks (pull_request) (never ran)
go.mod merge conflicts in internal/host/host.go, internal/host/host_test.go, internal/host/protocol.go too, not only go.mod and go.sum
Suite go / reused-checks (pull_request) Successful in 5s
Required
Details
This pull request has changes conflicting with the target branch.
  • internal/host/host.go
  • internal/host/host_test.go
  • internal/host/protocol.go
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'ses-325-window-rename:ses-325-window-rename'
git switch 'ses-325-window-rename'
Sign in to join this conversation.
No reviewers
No labels
queue
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/at-claude!339
No description provided.