Repository navigation
Record no reads for a passive leaf.page visitor - #3453
Merged
Merged
Conversation
On leaf.page, the `read` event the runtime posts once an agent message has been on screen no longer starts a private container for a visitor who has only read the page. The Worker answers it with a final refusal, as `page check --render` does, so nothing is recorded and the tab doesn't send it again that visit. Once the visitor's page is active, reads reach the container and are recorded as before. Max's decision #19 on the overnight report. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 21, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
A passive read's final refusal persists after the visitor activates this page. createReadTracking puts the message/version in refusedThisVisit; its present() keeps that key while the message remains unread, and scan() skips it. If a visitor sees a reply and then comments in a different thread, the newly active session never receives a read for that reply during the same focused visit. The unread mark and Next unread destination remain, despite the reply having been shown. Please clear or reconsider these refused keys when the page becomes active, then rescan the visible messages.
A passive leaf.page visitor's runtime now sends no read at all, as it sends no viewport report, and scans again when its session turns active, so a reply shown after the visitor acts is recorded in the same visit. The edge's final refusal stays for a tab whose runtime predates this. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On leaf.page, a visitor who has only read a page no longer starts a private container by being shown an agent message. The runtime used to post a
readevent on its own once a message had been fully on screen, and the Worker forwarded it to a new private container. Now the runtime sends no read until the visitor's session is active, as it already sends no viewport report (user-view.js), and the Worker answers any read that arrives from a passive session itself without recording it. Once the visitor acts on the page, reads are recorded as before, including for a message already in view. This implements Max's decision #19 on the overnight report.Until the visitor acts, their read messages keep their unread marks and Next unread keeps stopping on them. Before this change, each published example with an agent reply in it (ship-review, review-a-plan, log-retention) started Python and Codex App Server in a container for every visitor who opened that reply, and the container then idled for ten minutes.
How
thread/read.jscounts a message's exposure only whilesessionIsActive(), and scans again onlf-session-active. When the visitor's first gesture activates the session, a reply in view is marked read in the same visit. On a locally served page and in a live sample the session is always active, so nothing changes there. The kernel is rebuilt.readitself, beside the viewport report it already drops ("disposable observation, not a gesture that opens private state"). It reads the event'skindin the same bounded parse that recognizes a page fault (passiveEvent). The answer is a final refusal under a 200,{ok: false, final: true, findings: [], attempt}, aspage check --renderhas answered since Let page check --render pass a page with an unread agent message #3299, and not the viewport report's empty 204. The runtime treats an empty answer as unreached and would send the read again on every later pass, and those passes run on each scroll. This answer only reaches a tab whose runtime predates the gate above.Checks
leaf-dev verify-site'slocal_worker), withship-reviewbuilt from this branch, a fresh visitor opened both threads witht. No/api/eventwas posted and no container started. The session was then turned active over its session channel, the way another tab's activation reaches it. The same tab then posted reads for both replies,91f7c2a8and64df0b27. A control tab whose state answers saidactivefrom the start posted the same two reads.pnpm run checkpasses.uv run leaf-dev sitethenuv run leaf-dev verify-site website-workerpasses. Two earlier runs on a host at load 20–25 timed out on the container's first activation read, and the same timeout hit main's Worker on that host.