Skip to content

Error attention: raised only if unseen; an API error reads as itself - #376

Merged
SSFSKIM merged 3 commits into
masterfrom
fix/api-error-items
Oct 30, 2026
Merged

SSFSKIM merged 3 commits into
masterfrom
fix/api-error-items

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 30, 2026

Copy link
Copy Markdown
Owner

The owner's ruling (2026-10-30), verbatim: "Only if unseen: raise the error item only when the error is newer than the last time you saw that session in MAWS. An old session's error you already saw stays quiet; a session that failed while you weren't looking still tells you once. also the error should just show how session shows -- like if there's API error, then display that API error happened, not make the whole session end with error."

The bug

Opening an old session whose last turn ended in an API error weeks ago showed "! Error · The turn ended with an error · 3 weeks ago · Dismiss" in the composer and a Needs-you item. The engine host's disk backfill writes turn.ended { isError: true } after an isApiErrorMessage record, and the attention service raised an error item from every such event, read from disk or not. Once seen, E11 F2b kept the item as the session's "ended with an error" fact: the notice stayed in the composer and the session glyph read "✕ Ended with an error ".

What "seen" means, as built

Seen = the session's last-seen mark, C4's unread rule (SessionRecord.lastSeen.at in the index, under src/services/index/):

  • The mark moves to now when a client starts showing the session. Showing means the session is the active tab of a pane, or is drawn by the floating card or the Side pane, in a focused, visible window: session.setVisible → IndexSessionSource.onSetVisible.
  • It moves again at each transcript advance while a client shows the session, and on Mark all read.
  • It also moves when an error arrives while a client shows the session (IndexSessionSource.seenNow). That makes "seen as it arrived" durable after the reader leaves.

How the attention service uses it:

  • An error item (a failed turn or a failed background task) is raised only when its createdAt is later than the mark. A session MAWS never showed has no mark, so its error tells once.
  • An error that arrives while a client shows the session is not raised.
  • When the mark moves past an open error, the error is retired. It is also retired when it is dismissed, or seen in the composer: L102's 2 s dwell stays as a backstop for when the index cannot mark the session.
  • Retired is final. A replay, a restart, or a store that lost the item does not raise it again, because the gate stops it.
  • The X1 state confirmed is no longer used for errors. A confirmed error from an earlier build loads as retired. A pending one loads as retired if the session has been seen since.
  • Both shapes are covered through startSpine: main on the embedded shape, mawsd on the daemon shape.

One consequence: a glance now counts as seen, the same as for the unread dot. Opening the session retires its error at once; it no longer waits for the 2 s dwell.

An API error reads as itself

  • Needs you, the composer notice and the notification: the summary of an unseen error is the engine's own text. It comes from the turn's API error envelope, or live from the result's text with terminal_reason: 'api_error'. For example: "API Error: 529 Overloaded. This is a server-side issue, usually temporary — try again in a moment." An open item stored with the old generic words takes the real ones when its transcript replays.
  • Transcript: the API error row (✕ and the engine's text, the existing error-row style) stays where it happened. The divider of a turn that ended on an API error now reads the turn's work ("Worked for 1m · 3 tool calls") instead of "Failed after". Claude Desktop does the same: it drops its turn-error card when the turn already has an API-error row.
  • A live API error is now flagged at all. The live stream-json frame spells the flag is_api_error_message (snake case), and the normaliser read only the transcript's isApiErrorMessage. Live API errors were therefore drawn as ordinary assistant text. The snapshot pass2/auto-unrouted.rows.json is updated to match.
  • Session state: a live turn with terminal_reason: 'api_error' leaves the digest idle instead of failed. The "Ended with an error" glyph is withdrawn, and so is the composer notice kept after the error was seen.

The charter's Decision Log records the amendment of §5.7 and of the 2026-10-08 E11 line (2026-10-30 entry).

Wire and schema

There are no schema changes: no IPC, event or record field was added or changed.

  • Normaliser: it now reads the live wire's snake-case is_api_error_message. The X1 event field it fills already existed.
  • Spine: AttentionService gains seen(appSessionId, at) and an optional seenAt dep.
  • Index: IndexSessionSource gains seenNow.
  • IPC: attention.acknowledge keeps its schema; how no longer changes the outcome.

Tests

  • Service tests:
    • an old seen error raises nothing;
    • an unseen one raises once, in the API error's words;
    • seeing or dismissing retires it, across a replay, a restart and a store that lost it;
    • a stored confirmed or seen-since error loads retired;
    • a live API error raises the item while nobody shows the session and nothing while someone does.
  • Index-backed tests, on a real Index and IndexSessionSource:
    • a mark move retires the error;
    • an error newer than the mark is raised;
    • an error seen as it arrives leaves a durable mark.
  • Digest: the recorded api_error result reads idle.
  • Normaliser and derive tests on the recorded pass2/auto-unrouted envelope.
  • Divider tests, and a new disk fixture (transcript-d1-api-error-after-work.jsonl, a backfilled API error after tool work).
  • Updated glyph, swap and composer tests.
  • e2e/supervisor.spec.ts reworked for the new rule:
    • the control run, with its session shown, leaves no open error;
    • in the relaunch, the error raised while the app was closed retires once its restored session shows, and the glyph then reads the pending request.

Review: one doperpowers:reviewer-medium round found three issues. All three were real and are fixed in 4dae018: the live flag spelling, a durable seen mark for an error seen as it arrived, and refreshing the stored generic words.

Gates on 4dae018: class 1a (static, unit, probes) and e2e supervisor, supervisor-daemon, c7, transcript all green, run https://github.com/SSFSKIM/MAWS/actions/runs/41132612927 (macOS e2e lane, class 1a on the pool). Earlier: class 1a on 2bae9ff green (run 41130713207); the first class 1a on 66ba554 (run 41129471059) went red only on an unrelated daemon.test.ts lock race.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

…mark, retired for good once seen or dismissed; an API error reads as itself (the engine's words in Needs you, the transcript row where it happened, the divider the turn's work, the digest idle); the 'ended with an error' glyph and kept notice withdrawn; charter Decision Log 2026-10-30

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…g (every index change of the record reaches it)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
…liser reads the wire's snake-case is_api_error_message as well as the transcript's isApiErrorMessage; pass2/auto-unrouted's envelopes now draw api error rows, snapshot updated); an error seen as it arrives leaves a durable mark (IndexSessionSource.seenNow replaces isVisible and writes the record's last-seen mark through the unread rule, so a replay after the reader left, or after a restart, raises nothing); an open item stored in the old generic words takes the derived words when the transcript replays it (state and moments kept, a retired one left alone)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T21:53:06.693221Z 4dae018 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit 6aa8d67 into master Oct 30, 2026
SSFSKIM added a commit that referenced this pull request Oct 30, 2026
…ion Log 155: B4 step 0's O8 and Q10 questions answered

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 30, 2026
…-load; the window's fields take WIRE_MINOR 9 beside #374's resume

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 30, 2026
…E's document)

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
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