#78

Fix search-jump session targeting and worktree CLI detection

Openparzival1lwants to merge intofrom

Summary

Patches two unpatched Python bugs:

#76 — Cross-session search jump targeted the old session. Jumping to an FTS hit in a session that was not in the sidebar loaded the right transcript, but g (copy resume), Enter (reply), and observe still used the previously highlighted row. Replies could silently go to the wrong session.

  • Pin the jumped-to session into the sidebar (even if it is outside the days/cap/archive window).
  • Resolve copy/reply/observe from _selected_session_id, not the stale highlight.
  • If that id is missing from the visible list, refuse rather than acting on the old highlight.

#70 — threadhop tag failed inside --worktree sessions. claude --worktree <name> is an interactive session, but the process parser only treated --resume / --continue / */claude as interactive. Bare claude --worktree … has last-arg = the worktree name and argv0 = claude (which does not end with /claude), so auto-detect returned nothing.

Left alone on purpose (not correctness bugs):

  • #59 Option+Backspace in inputs (macOS papercut)
  • #58 turn-as-unit rendering (design follow-up)

Test plan

  • tests/test_search_jump_session.py — pinned-session visibility + action targeting
  • tests/test_session_detection.py — --worktree process parsing
  • Full suite: 249 passed
  • In the TUI: search-jump to a session outside --days, confirm sidebar highlights it, g copies that id, Enter replies to it
  • From a claude --worktree … terminal: threadhop tag in_progress auto-detects the session