Repository navigation
Board: moving a session that is not running no longer crashes, and the move shows - #17
Conversation
…e move shows Pressing m on a session known only from its status file (not running, so it has no live record, and its row sits on Needs you) and choosing a group crashed the app: the move looked up the session's working folder and session id in the live records with a plain index, which raised KeyError. The move now reads the live record, else the Needs-you row's record, so it rewrites the same pins a live move wrote, by name and by session id. Without either, it pins the session by name and its folder gives no group (Other). Such a session also stayed under Other after the move: the board's group map held only sessions with a live row, so the overrides were never consulted for it. Sessions with no live row now fall back to the overrides, matched by name and by the session id the Needs-you row carries. That row now takes the session id from the status file when the record has none, since a pin written while the session ran is keyed by it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Semgrep (OSS): no findingsClean scan. Posted before the Claude review. |
CI TestsTests passed: ruff lint and the unittest matrix (Python 3.11 to 3.14, Linux and macOS) are green on 8ebfdb0. Posted before the Claude review so the test outcome is folded into the review. |
|
Claude finished @daniel-pittman's task in 58s —— View job Review of PR #17
SummaryI found no correctness bugs, security problems or CLAUDE.md violations (the repo has no CLAUDE.md). There is one LOW note.
Findings
Scan and CI results
Test coverageThe new test
What it doesn't test:
Neither gap blocks the merge. Public-repo checkThe diff adds no home-directory paths, real names or emails, cloud-drive paths or credentials. |
| upd = to_epoch(sf.get("updated")) | ||
| # A file-only record carries no session id; the status file names it, and a | ||
| # group pin written while the session ran is keyed by it. | ||
| sid = r.get("sessionId") or (sf.get("sessionId") if isinstance(sf.get("sessionId"), str) else None) |
There was a problem hiding this comment.
LOW: this also changes how Enter reopens a session that is not running. offer_reopen (fleetwatch/app.py:1648-1651) matches a Resume entry by rec["sessionId"] first and only falls back to the name when that finds nothing. Before this change, a file-only record had sessionId=None here, so reopen always matched by name. Now it matches by the status file's id first.
That is usually the better match. If the status file is stale, though, its id can point at an older transcript than the one the name match would find. One way this happens: the session got a new id (after /clear, say) and never rewrote its status file. I'm not sure this happens in practice. If the id should only feed the group pins, the narrowest fix is to keep it out of r["sessionId"] and give gone_row a separate field for the pin lookup. Otherwise, a line in the PR body saying reopen now prefers this id would cover it.
What was wrong
mon a session known only from its status file (not running, so it has no live record; its row is on Needs you) and choosing a group crashed the board withKeyErrorinaction_regroup. The move looked up the session's folder and session id in the live records with a plain index.groups.tomlwere never consulted for it.The fix
How it was checked
tests/test_gone_rows.pyEnterTests.test_m_moves_a_session_that_is_not_runningdrives the board. It pressesmon a not-running session's Needs-you row that carries a pin from when it ran, and checks:KeyError; reverting the grouping fallback leaves it under Other; reverting the status-file id leaves the old id pin.tests.test_gone_rows,tests.test_v6andtests.test_resumepass.test_index_clitests and onetest_notifytest. They depend on the calling session's environment; filed as Three tests fail when the suite runs inside a Claude Code session #16.Not part of this change:
panduon such a row say "no session is highlighted", because parking needs a live record. That gets a follow-up ticket.Also changes: pressing Enter on such a row to reopen the session now matches its Resume entry by the session id from the status file first, then by name (the cloud review's LOW note). That id is usually the better match; a status file left with an old id could pick an older transcript.
🤖 Generated with Claude Code