Skip to content

Mark a failure receipt as one, and write it from one place - #783

Merged
max-sixty merged 2 commits into
mainfrom
session-logs
Sep 18, 2026
Merged

max-sixty merged 2 commits into
mainfrom
session-logs

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

fallback_reply was the name for the thing that answers a reader when no agent answer is coming — the Worker's rate limiter, a dispatch that threw — and #779 added a second implementation of the same idea for a turn the container followed to nothing. Neither was a fallback: they are how a failure reaches the reader instead of being swallowed.

But the page never drew one. failure was set on the reply and schema-validated, and read by nothing outside the deploy gate, so "I couldn't generate a reply just now" arrived in the agent's own first person, in the same bubble, under the thread's own agent name — indistinguishable from an answer, which is the one thing the field exists to prevent.

What changed

One writer, one vocabulary. write_failure_receipt is now the only code that appends a reply carrying failure, and FAILURE_RECEIPTS declares each of the three codes beside the words the reader gets for it. The Worker sends {event, failure} and no longer carries a copy of that wording across the HTTP hop; turn_failed is derived out of the door's accepted set, because a receipt claiming a turn was observed should come only from the code that observed it. Removing text from that request left _agent_event's text half with no callers, so it goes too.

The writer names only the move. A reply's address is not always the move — a gesture on a widget frozen into thread markup is answered on the conversation holding it — but cmd_reply resolves that from the same reading, so working it out beforehand was a second answer to a question the writer already answers, and the wrong one on a repeat: the Worker retries, and once the first receipt has settled the move, nothing outside the log can say where its reply went. Doing it early got the gesture back and refused its own earlier receipt as another event's, turning the retry into a 400. The durable attempt is what makes the repeat idempotent, and the writer reads it before the address.

The head says the rest. A reply carrying failure wears one mark, Not answered, in the panel and inline both — the only thing in a message head that is not muted metadata, because it is the only thing there a reader has to act on. The three texts now speak in the host's voice rather than the agent's first person.

A failure receipt deliberately does not enter the panel's "On you" list: awaits means the agent's reply left a question and the banner counts it as an Ask, which is a package-owned semantic, so the chip and "Send it again to retry" carry it instead.

Checks

Everyday suite (1,142), test_render_conversations.py + test_chrome_contracts.py under --run-nightly (105), worker typecheck and vitest (62), pre-commit, and one real hosted Codex turn through scripts/verify_site.py local — published revision 2 and replied in 17.2 s through the changed reply door. The new render test is bug-back checked against both the runtime's read of failure and the chip's styling; the retry regression is bug-back checked against resolving the address ahead of the write.

🤖 Generated with Claude Code

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits September 17, 2026 23:04
`fallback_reply` was the name for the thing that answers a reader when no agent answer
is coming — the Worker's rate limiter, a dispatch that threw — and #779 added a second
implementation of the same idea for a turn the container followed to nothing. Neither
was a fallback: they are how a failure reaches the reader instead of being swallowed.

But the page never drew one. `failure` was set on the reply and schema-validated, and
read by nothing outside the deploy gate, so "I couldn't generate a reply just now"
arrived in the agent's own first person, in the same bubble, under the thread's own
agent name — indistinguishable from an answer, which is the one thing the field exists
to prevent.

One writer, `write_failure_receipt`, now appends all three codes, and one declaration,
`FAILURE_RECEIPTS`, holds each code beside the words the reader gets for it. The Worker
sends `{event, failure}` and no longer carries a copy of that wording across the HTTP
hop; `turn_failed` stays out of that door, because a receipt claiming a turn was
observed should come only from the code that observed it. The voice is the host's
rather than the agent's, and `_agent_event` loses the text half nothing asks for any
more.

The writer names only the move. A reply's address is not always the move — a gesture on
a widget frozen into thread markup is answered on the conversation holding it — but
`cmd_reply` resolves that from the same reading, so working it out beforehand was a
second answer to a question the writer already answers, and the wrong one on a repeat:
the Worker retries, and once the first receipt has settled the move, nothing outside the
log can say where its reply went. Doing it early got the gesture back and refused its
own earlier receipt as another event's. The durable attempt is what makes the repeat
idempotent, and the writer reads it before the address.

The head says the rest. A reply carrying `failure` wears one mark, `Not answered`, in
the panel and inline both — the only thing in a message head that is not muted
metadata, because it is the only thing there a reader has to act on.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 9bbd250 into main Sep 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the session-logs branch September 18, 2026 06:41
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.

2 participants