Skip to content

fix(init): say why trail init couldn't read past sessions - #589

Open
rushabhnagda11 wants to merge 1 commit into
mainfrom
fix/trail-init-past-sessions-error
Open

rushabhnagda11 wants to merge 1 commit into
mainfrom
fix/trail-init-past-sessions-error

Conversation

@rushabhnagda11

Copy link
Copy Markdown

Found while rehearsing the new onboarding (#585) for the 2026-10-19 metrics review.

What

When the past-session read fails, trail init printed:

· couldn't read your past sessions this time; trail init again tries again

In rehearsal the cause was a claude CLI whose OAuth session had expired (claude -p returns is_error: true, "Failed to authenticate: OAuth session expired"). Running trail init again just fails the same way. Now:

· couldn't read your past sessions: Claude Code didn't answer. Check `claude` is signed in, then run trail init again

reason: "no_claude" (no claude on PATH) used to print nothing at all. It now gets its own line.

Safety

  • Copy only. finishPastRead, the read mark and the retry behaviour are untouched; both reasons already left the mark unwritten, so "run trail init again" is accurate.
  • graft init never runs the past read (it's gated on TRAIL), so graft output is unchanged.

Test

Built the branch and ran trail init in a sandboxed $HOME with four seeded transcripts and a signed-out claude. The new line prints as above.

🤖 Generated with Claude Code

When the headless `claude -p` call failed, init printed "couldn't read your
past sessions this time; trail init again tries again", with no cause. In
practice the cause is a `claude` CLI whose sign-in has expired: it answers,
with an auth error. Say so, and name the fix. A missing `claude` command
(reason no_claude) used to print nothing; it now says that too.

Copy only: what is read, when, and when it retries are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trailhq-graft

trailhq-graft Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🌱 graft blast radius

Nothing outside this diff depends on it. 1 area changed; no indexed dependents at depth 2.
Tests: no test reaches CLI Initialization.
Tag: @anirudhkumar-nanonets — CLI Initialization · @shhdwi — CLI Initialization

Who knows this code — 2 people across 1 area
Area Who knows it
CLI Initialization · changed @anirudhkumar-nanonets — 53 commits, last today · @shhdwi — 23 commits, last 2mo ago

Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

Test signal per changed area — 1 ✗

Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.

  • ✗ CLI Initialization — 0 of 1 reached · no test file reaches it
    • not reached: runInitCommand

graft blast · origin/main...HEAD · depth 2 · 1 changed file

Open the interactive graph → — click an area to see its dependent symbols at file:line.

github-actions Bot added a commit that referenced this pull request Oct 13, 2026

This branch has not been deployed

No deployments
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.

1 participant