Skip to content

fix: verify title marker in ensure_pane() fast path (#93)#132

Merged
bfly123 merged 1 commit intobfly123:mainfrom
LeoLin990405:fix/ensure-pane-stale-id
Mar 11, 2026
Merged

fix: verify title marker in ensure_pane() fast path (#93)#132
bfly123 merged 1 commit intobfly123:mainfrom
LeoLin990405:fix/ensure-pane-stale-id

Conversation

@LeoLin990405
Copy link
Contributor

Summary

Fixes #93ensure_pane() trusts stale pane_id without title verification, routing messages to the wrong tmux pane after CCB restart.

Root cause: All 8 session modules have the same fast path that returns immediately when pane_id is alive, without checking if the title marker resolves to a different pane. When tmux recycles a pane ID to another process, messages are silently delivered to the wrong target.

Fix: Add title marker verification to the fast path in all 8 session modules. If the marker resolves to a different alive pane, update the cached pane_id and route to the correct pane.

Files changed:

  • lib/gaskd_session.py (Gemini)
  • lib/caskd_session.py (Codex)
  • lib/oaskd_session.py (OpenCode)
  • lib/daskd_session.py (Droid)
  • lib/baskd_session.py (CodeBuddy)
  • lib/haskd_session.py (Copilot)
  • lib/laskd_session.py (Claude)
  • lib/qaskd_session.py (Qwen)
  • test/test_ensure_pane_stale.py (40 new tests)

Test plan

  • 40 new tests: 8 session modules × 5 scenarios (marker match, stale ID switch, no marker, dead pane fallback, resolver exception)
  • 175 existing tests pass (0 regressions)
  • Manual: restart CCB, verify ask gemini routes to correct pane after tmux pane ID recycling

When tmux recycles a pane ID after CCB restart, ensure_pane() trusted
the cached pane_id without verifying the title marker, routing messages
to the wrong process. Add title marker verification to the fast path
in all 8 session modules.
@bfly123 bfly123 merged commit 5077c6c into bfly123:main Mar 11, 2026
3 of 13 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.

Bug: ensure_pane() trusts stale pane_id without title verification — messages sent to wrong process

2 participants