Skip to content

A model failure at the landing serves the static close, never a bare 500 - #19

Open
LeavesJ wants to merge 2 commits into
mainfrom
fix/close-converse-model-failure
Open

LeavesJ wants to merge 2 commits into
mainfrom
fix/close-converse-model-failure

Conversation

@LeavesJ

@LeavesJ LeavesJ commented Sep 4, 2026

Copy link
Copy Markdown
Owner

What was wrong

SessionRegistry.close() and .converse() let the authoring call raise straight through the route. FastAPI answered Internal Server Error as text, the shell's r.json() threw, the End button offered "connection lost, try again" over a server that was up, the sitting stayed live, and every retry paid for one more identical failure. The handoff names it: the last thing a learner sees at the moment the product tries to land.

What changed (540f101)

  • close: traceback server side first (Invariant 10), then a static close with the village, and the sitting still ends.
  • converse: a nudge that says nothing was sent, so the shell's unwindSay hands her words back; the turn claim is released so the retry is real.
  • steer capture: the mapper is the second paid call on a converse turn and runs after the reply was authored; its failure now takes no steer instead of throwing away a reply that was paid for.

except Exception, not except ModelError: the ceiling arrives as ModelError, but a 401 or a 529 arrives as the SDK's own class, since _TimedMessages._timed wraps only BudgetExceeded. The worker's net is broad for the same reason, and the close test is parametrized over a plain RuntimeError and a ModelError so a narrowing cannot pass silently.

The review round (c0460af)

Isolated T2 review at 540f101: three lenses (escape paths, learner-facing doctrine, state and concurrency), each executing its claims in its own worktree, then two independent refuters per finding. Nine raw findings; six refuted as pre-existing or out of scope. Three fixed here, each behind a test watched to fail first:

  1. The static close said "You took a position" on a plateau or budget stop that never landed. Converged now serves that line; anything else serves the close-shaped static that claims no arrival.
  2. The lost-context second screen (voice.egress_safe_reply against the lost exp, ModelError-only catch) still escaped as a 500. One net now covers the author call and that screen; nothing is persisted before either.
  3. A label attach failure after the pair was persisted rode out as a 500, and the retry duplicated the turn. The reply is served without the label.

Recorded, not fixed, all pre-existing: voice.close and voice.sitting_close serve the same "took a position" static on a refusal or leak with no stop_reason in hand; the nudge's "Try again" loops identically once the ceiling has fired; close() takes no turn claim (two concurrent End clicks both pay the author, benign); _end_sitting sits outside the net so a store failure at the very end still 500s with the sitting live and a retry possible.

Verified

Ten tests across the two commits, each watched to fail on the escaping exception or the 500 before its fix. Two of them are over HTTP with raise_server_exceptions=False, so the 500 itself is what fails. Nothing in index.html changed; the shell already renders both the nudge and the close kinds.

felix gate pass: 1449 passed, 35 skipped.

Tier T2: a learner sees it. The reviewer executed the claims rather than reading the diff.

Jarron Deng added 2 commits September 4, 2026 00:18
…er a bare 500

The close and converse authors could raise straight through the route:
FastAPI answered `Internal Server Error`, the shell rendered "connection
lost -- try again" over a server that was up, the sitting stayed live, and
every retry paid for one more identical failure. The ceiling fires here as
ModelError; a 401 or an overload arrives as the SDK's own class, which
`_timed` does not wrap, so the net is broad like the worker's.

close: traceback server side (Invariant 10), then the same static `voice`
already serves on a refusal, with the village, and the sitting still ends.
converse: a nudge that says nothing was sent, so the shell hands her words
back; the turn is released so the retry is real. The steer mapper is the
second paid call on a converse turn and runs after the reply was authored;
its failure now takes no steer instead of throwing the reply away.

Seven tests, each watched to fail on the escaping exception or the 500
before the fix. Gate: 1446 passed, 35 skipped.
…teau, one net over the lost-context screen, the label as chrome

Three findings from the isolated T2 review at 540f101, each read at the
cited span and each fixed behind a test watched to fail first.

The static close lied on a plateau. Every stop lands post-Earned-Landing,
so a plateau or budget record reaches the close author too, and on an
author failure the first fix served "You took a position and reasoned the
trade-offs" to a learner who never landed the call. Converged now serves
that line, which is then true; anything else serves the close-shaped
static that claims no arrival.

The lost-context second screen escaped. The net wrapped only the author
call; the lost-context branch then ran egress_safe_reply against the lost
exp, whose own catch is ModelError-only, so an SDK-class error there was
still a bare 500. One net now covers both; nothing is persisted before
either, so the nudge stays true.

A label attach failure after persist duplicated the turn. The wind-down
label runs after the you/vera pair is on disk and makes no model call; a
raise rode out as a 500 and the retry re-sent a persisted text. The reply
is now served without the label, traceback logged.

Gate: 1449 passed, 35 skipped.
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