You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(telemetry): an empty worktree id in the journal reads as not stated, as its comment promises #826
parseWorktree in cli/src/contexts/telemetry/infrastructure/run-journal-reader-adapter.ts has a comment that says: "asString rejects "", so a torn or empty value reads as 'not stated' rather than as a worktree named nothing". The adapter's asString returns any string, "" included. So a session_start carrying "worktree_id": "" is read as a worktree named nothing, which is exactly what the comment says cannot happen. The #799 mutation pass found it.
Scope
Pick one and make the code and the comment agree:
Keep the guarantee (recommended):parseWorktree treats an empty worktree_id or worktree_repo_id as absent. Add a test that is red on next.
Drop the guarantee: rewrite the comment to say an empty value is kept as given.
Acceptance criteria
The comment on parseWorktree states what the code does.
If the guarantee is kept, a journal line with "worktree_id": "" reads with no worktree_id, and a test proves it (red before, green after).
Prior art in this repository
asString in the per-tool formats (domain/formats/*.ts) also accepts "". The worktree fields are the only place a comment promises otherwise.
Out of scope
How the journal hook computes the worktree fields. It never writes "" today, which is why this path is not reached in practice.
Activity
fix(telemetry): an empty worktree id in the journal reads as not stat…