discover_session polled `rclaude list sessions` for the freshly spawned
session but filtered rows with `r.host == host` where host is the
canonical name (e.g. "plum"), while rclaude labels the calling machine's
own sessions "local". "local" == "plum" is always False, so discovery
matched nothing and timed out even though the session's JSONL was already
on disk (observed: 18s after spawn, inside the 30s window). dispatch then
falsely returned "spawned but not discovered", orphaning the live session
until a manual pull.
Root cause is a missing host-label normalization the pull loop already
does. Fix discover_session to canonicalize both sides via
resolve_host_label, and key local-path symlink resolution on the ROW's
raw label. Apply the same normalization to dispatch_task's pre_uuids
filter (identical mismatch left it empty, risking a stale-sibling match
at a shared cwd). 2 regression tests reproduce rclaude's "local" labeling
(the old fake echoed the dispatch host, masking the bug). 310 tests pass.
Committed manually with ALLOW_COMMIT=1 per user authorization: the
auto-commit service's message LLM was timing out on this repo.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ChatRole.CLAIRE now persists as "claire" everywhere. Migration 0010
rewrites both the chat_messages.role column and the chat_message_posted
event payloads in one transaction so a future replay reconstructs the
same projection.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>