Skip to content

A failed background save reports only exited 1 in hook-errors.log; the real cause goes to the daily log and nowhere else #694

Closed

Description

@fdaviddpt

Logging gap: the real cause of a failed background save is written only to the daily narrative log, never to hook-errors.log

Surfaced by @Mega-Therion while diagnosing #693. Their installation failed every background summarize for several days, and the only thing hook-errors.log had to say about it was:

save-session.sh --force exited 1

The actual cause was sitting in ~/.remember/logs/memory-*.log the whole time:

[haiku] ERROR: call-haiku error: claude exited 1: Credit balance is too low | ...ANTHROPIC_API_KEY or another auth source is set and takes precedence over your claude.ai login

_failure_detail() (pipeline/haiku.py:404) already does the hard part -- it digs the real message out of the CLI's stdout JSON, which is where auth and billing failures live (#129/#152). That message reaches the daily log. It does not reach the log an operator actually looks at when saves stop working, which surfaces only a return code.

Why this is its own issue

A return code with no cause is the shape this project exists to avoid: something ran, produced a clean-looking failure line, and said nothing about why. 12 occurrences across several days were needed before the reporter went digging in a second log file to find a message that had been written every single time.

This is independent of whichever fix #693 lands on. Any nested-call failure -- expired OAuth, rate limit, exhausted balance, a CLI that will not start -- has the same shape: diagnosed correctly, recorded in one place, and reported as an exit code in the other.

Shape of a fix

save-session.sh's failure path should carry the child's own failure detail into hook-errors.log, not just its exit status. The detail is already computed and already length-capped (_FAILURE_DETAIL_MAX, 500 chars), so this is about propagation, not about producing new information.

A test wants both directions: a failing nested call whose reason reaches hook-errors.log (must-fire), and an ordinary successful save that writes nothing there (must-not-fire).

[AI-generated]

Activity

  1. added
    cohort-12
    on Sep 15, 2026
  2. added
    priority:medium
    lane-capture
    on Sep 16, 2026
  3. self-assigned this
    on Sep 16, 2026
  4. added a commit that references this issue on Sep 16, 2026
  5. added 3 commits that reference this issue on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cohort-12lane-capturepriority:medium

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions