Skip to content

Read a failed CLI by how it ended, and let a person retry a summary that gave up - #20

Open
shooma wants to merge 3 commits into
gsamat:masterfrom
shooma:mike/summary-recovery
Open

shooma wants to merge 3 commits into
gsamat:masterfrom
shooma:mike/summary-recovery

Conversation

@shooma

@shooma shooma commented Sep 24, 2026 •

Copy link
Copy Markdown

Two meetings of mine ended with a transcript and no summary, marked «не вышло». The session log showed why, but not all of it:

summary via claude-cli failed: exited 1: Failed to authenticate: OAuth session expired and could not be refreshed
summary via codex-cli failed: exited 1: OpenAI Codex v0.156.1 -------- workdir: … model: gpt-5 …   ← the error itself was cut off
summary via ollama failed: … Could not connect to the server.
every backend failed for good — giving up on the summary

A fourth problem, codex being handed gpt-5, is #14 and is left to it; nothing here touches codexCLI. This PR covers the other two points of #13: the log that kept codex's banner instead of its error, and summary_status: failed blocking both Finish processing and amanu process.

A failed CLI is read by how it ended

codex exec writes a banner to stderr, then echoes its whole input (the transcript), then the error. LLMBackend.run kept the first 600 bytes of stderr, which is the banner. So the log never said why codex failed, and a spent codex allowance could never match usageLimitMarkers.

LLMBackend.failureText now keeps the tail: the last 1000 characters of stderr and the last 400 of stdout, joined with a line break and started at a line boundary. Before that, it drops everything up to the end of the echo. The echo is found by searching backwards for the input's last line, so a CLI that rewraps or shortens the start still has it dropped. Otherwise the end of a meeting that talked about a quota or a timeout would sit in the window the usage-limit and transient checks read.

A signed-out CLI is named, not deferred

LLMError.isSignedOut recognises what claude and codex print when nobody is signed in. The phrases come from the binaries: Please run /login, run codex login, Not logged in, OAuth session expired, access token could not be refreshed, …. It reads only the last four lines, and leaves out generic phrases such as failed to authenticate that an MCP server's own OAuth could also print.

The log now says claude-cli is signed out — sign it back in; trying the next backend, and analytics reports no_key instead of unknown.

It is deliberately not transient. A CLI found inside a desktop app and never signed in would otherwise keep every session deferred, and retried at every launch and network change, for ever. A lapsed sign-in is recovered with the retry below. Bounded deferral, which would also fix the same problem that already exists for ollama, is #21.

A person can retry what gave up

A failed step was final everywhere. That is right for the sweep, but Finish processing was disabled for it and amanu process said "Nothing to do". So a summary lost to a wrong model name or an expired login could only be recovered by editing meta.json.

PostProcessor.outstanding and finish take retryingFailed:, which only the button and amanu process pass; the sweep never does. The button is enabled for a session whose names or summary failed. After a retry the window says whether it failed again (and points at transcribe.log) or reached no model and will retry on its own, so a retry that didn't work does not look like a button that did nothing. The summary column is 90 pt wide, too narrow for an inline button beside «не вышло», so the existing button is the way back. docs/specs/2026-08-18-speaker-names-design.md has a Changed later note.

Test plan

  • New tests: signedOutCLIIsRecognised, failureTextKeepsTheEndAndDropsTheEcho, failureTextDropsAReformattedEcho, failureTextSeparatesTheStreams, failureTextKeepsTheTail, failedWorkComesBackWhenAskedFor, plus a check that a retired session is still owed nothing with retryingFailed.
  • swift test: 472 of 476 pass. The four failures also happen without this change: three RetranscriptionTests need the LocalVQE dylib, which isn't fetched in this checkout, and MeetingLanguagesTests:25 depends on locale collation. Building on Swift 6.2.3 needs the MicRecorder.swift:656 fix from Slice OpenAI uploads that are under 25 MB but longer than the model allows #18; it was applied locally for the run and is not in this branch.
  • Recovered the two real sessions with amanu process after signing claude back in (before this change, by clearing summary_status by hand).
  • Recordings window: select a session with a failed summary; Finish processing is enabled and writes summary.md.

🤖 Generated with Claude Code

shooma and others added 3 commits September 24, 2026 12:51
…gned out.

codex echoes its whole input to stderr before the error, so the first 600
bytes the log kept were a banner, and a spent codex allowance could never be
recognised. The failure is now the tail of what the command wrote, with the
echoed input cut out so that a meeting about a quota does not read as a spent
one. A claude or codex CLI whose sign-in lapsed is treated like a spent
allowance: transient, reported as no_key, and retried later rather than
written off.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A failed step stayed failed for good: the sweep is right not to retry it, but
Finish processing was disabled and amanu process said there was nothing to do,
so a summary lost to a model name or an expired login could only be recovered
by editing meta.json. Both now try failed steps again, and the window says so
when the retry fails too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… CLI is read.

A CLI found inside a desktop app and never signed in would have kept every
session deferred and retried at each launch for ever; now that Finish
processing retries failed work, a lapsed sign-in is named in the log and left
for the person to fix. The markers are the CLIs' own phrases read from the last
lines only, the echo is found by the input's last line so a rewrapped start
still drops it, the two streams are joined with a line break, and a retry that
reached no model says so.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@shooma shooma changed the title Recover summaries lost to a signed-out CLI, and let a person retry failed ones Read a failed CLI by how it ended, and let a person retry a summary that gave up Sep 24, 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