Skip to content

daemon: call reconcile_window_names() each tick#12

Merged
Devail1 merged 1 commit into
mainfrom
fix/wire-reconcile-window-names
Jun 8, 2026
Merged

daemon: call reconcile_window_names() each tick#12
Devail1 merged 1 commit into
mainfrom
fix/wire-reconcile-window-names

Conversation

@Devail1

@Devail1 Devail1 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Problem

reconcile_window_names() (in chela/agent_manager.py) relabels any tmux window running claude to its cwd basename — but it was dead code: defined and tested in isolation, yet never invoked by the daemon. The only code path that renamed a window was start_agent() (the dashboard Start button).

Consequence: a claude session started or resumed by hand inside a tmux window kept its stale window name, so the dashboard sidebar showed the wrong label (e.g. a window resumed in ~/ stayed researcher instead of becoming ec2-user).

Fix

Wire reconcile_window_names() into the cmd_run() daemon loop, right after scheduler.tick():

  • Idempotent — only acts on a name/cwd mismatch, so it's a no-op once names are settled (no flapping).
  • Exception-wrapped — a tmux hiccup logs and continues; it can't take down the daemon loop.
  • Quiet — logs only when it actually renames something.

Verification

  • pytest: 16/16 pass.
  • Live: restarted the daemon against a window named researcher running claude in ~/ → reconciled to ec2-user within one poll cycle, logged once, then stayed put (confirmed no repeat-rename spam).

🤖 Generated with Claude Code

reconcile_window_names() relabels any window running claude to its cwd
basename, but it was dead code — defined in agent_manager.py and never
invoked. The only rename path was start_agent() (the dashboard Start
button), so a claude session started/resumed by hand in tmux kept its
stale window name and showed wrong in the sidebar.

Wire it into the cmd_run() daemon loop right after scheduler.tick().
It's idempotent (acts only on a name mismatch) and wrapped so a tmux
hiccup can't take down the loop. Logs only when it actually renames.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Devail1 Devail1 merged commit 2e12a16 into main Jun 8, 2026
0 of 2 checks passed
@Devail1 Devail1 deleted the fix/wire-reconcile-window-names branch June 8, 2026 13:04
Devail1 added a commit that referenced this pull request Jun 22, 2026
reconcile_window_names() relabels any window running claude to its cwd
basename, but it was dead code — defined in agent_manager.py and never
invoked. The only rename path was start_agent() (the dashboard Start
button), so a claude session started/resumed by hand in tmux kept its
stale window name and showed wrong in the sidebar.

Wire it into the cmd_run() daemon loop right after scheduler.tick().
It's idempotent (acts only on a name mismatch) and wrapped so a tmux
hiccup can't take down the loop. Logs only when it actually renames.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Devail1 added a commit that referenced this pull request Jun 23, 2026
reconcile_window_names() relabels any window running claude to its cwd
basename, but it was dead code — defined in agent_manager.py and never
invoked. The only rename path was start_agent() (the dashboard Start
button), so a claude session started/resumed by hand in tmux kept its
stale window name and showed wrong in the sidebar.

Wire it into the cmd_run() daemon loop right after scheduler.tick().
It's idempotent (acts only on a name mismatch) and wrapped so a tmux
hiccup can't take down the loop. Logs only when it actually renames.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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