Skip to content

Answer a browser retry through the append door alone - #2458

Merged
leaf-agent merged 1 commit into
mainfrom
survey-request-path-f17
Oct 12, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
survey-request-path-f17

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Code-quality survey item F17. The event endpoint read a browser retry's attempt in _accepted_retry before admission, merging the stored comment anchor into the retry first, and append_admitted read it again under the same lease, and the append a third time. The anchor merge answered an enrichment only the MCP Apps transport made, removed in #1465.

append_admitted now returns (record, appended), so the endpoint gates the nudge and the thread-title request on whether this request appended, and answers AttemptConflict with the same 409. The endpoint stamps the author once, before validation, and browser_command_error no longer restates the rule. Attempt identity is derived from the append envelope, $events.ownership.derived, author and publication; events.md and the registry description stop saying browser_discard shapes it, and both name post_reply's looser CLI retry rule.

Also: the stale append_admitted docstring about contract_writer exiting (gone since #2328), and presence reads the claim's id and turn fields directly, since readable_claim always supplies them.

No user-visible behavior changes.

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

The event endpoint read an attempted retry twice before admission: once in
`_accepted_retry`, which also merged the stored comment anchor into the retry
so a server-enriched anchor would not read as a conflict, and again inside
`append_admitted`, whose append then scanned a third time. Nothing enriches a
browser anchor since the MCP Apps transport went (#1465), so the merge was
dead.

`append_admitted` now returns the record and whether it appended it. The
endpoint stamps the author once, before validation, gates the nudge and the
thread-title request on that flag, and answers `AttemptConflict` with the same
409. The append itself no longer looks for the attempt, since the door read it
under the same lease. Attempt identity is derived from the declarations it
mirrors (the append envelope, `$events.ownership.derived`, author and
publication) rather than a literal set, and events.md and the registry no
longer say `browser_discard` shapes it. `post_reply`'s looser CLI retry rule
is named in its docstring and in events.md.

Also drops the stale claim that `contract_writer` turns a refusal into a CLI
exit, and reads the claim's id and turn fields directly in presence, since
`readable_claim` always supplies them.

No behavior a user sees changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@leaf-agent
leaf-agent merged commit 8f36194 into main Oct 12, 2026
3 checks passed
@leaf-agent
leaf-agent deleted the survey-request-path-f17 branch October 12, 2026 02:12
max-sixty added a commit that referenced this pull request Oct 12, 2026
`readable_claim`, which every claim reader goes through, always supplies
`id`, `turn`, `turn_opened` and `turn_closed`. #2458 dropped presence's
`.get` on them; `codex.py`, `delivery.py`, presence's wait mark,
`session.py`'s wake check and `tasks.py` still used `.get` as if a claim
might lack them. They now read the fields directly. No behavior changes;
`test_tasks.py` and `test_interact_session.py` pass.

(This branch also fixed the gallery isolation test's `LIVE_ROOT` import,
which #2469 fixed on main meanwhile; the merge takes main's version.)

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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