Repository navigation
feat(lazurio): the page Buddy is asked from travels as a chip the person can remove - #108
Conversation
agentrozjedemeai
left a comment
There was a problem hiding this comment.
Review of exact head 98b2aa1bc3fd819d2a5f660c707e8b414e1773c7. The normal send path, wire-schema round trip and empty-composer guard look sound. Focused page tests: 3/3; release contract: 42/42 after installing dependencies; scoped lint and web typecheck passed. Two send paths still violate the visible chip/reference contract:
-
[P1] Queued-message edit loses the newly selected page. ChatView.tsx:6375-6414 appends the currently visible page reference to promptForSend, but useQueuedRunEdit.ts:110-148 builds the edited message context only from retained records and the ordinary composer contexts. It never adds buddyPage.record. Repro: queue a message, move the host to a different page, edit that queued message while the new page chip is present, then save. The text contains the new page reference, but its context has no corresponding record (or retains only the old page record). buddyPrompt.ts:115-140 removes the orphan reference and gives Hermes no new page block; the sent UI can still display a page chip. Pass the page record through the queued-edit context builder, paired with the text actually saved, or explicitly omit both the chip and reference in edit mode. Add an integration regression test.
-
[P2] Plan follow-up has the same orphan reference when its branch is reachable. ChatView.tsx:6493-6525 passes promptForSend (including the appended page reference) to resolvePlanFollowUpSubmission, then sends buildMessageContext without withPageRecord. On a nonempty plan follow-up, the saved text refers to the page but the context does not contain it, so Buddy drops the block. Either pair the record with followUp.text in that branch or avoid adding the reference there; cover this path in a test.
Also check the dismissal lifetime: BuddySurface.tsx:99-105 remembers only one removed contextId. After dismissing page A, visiting page B, and returning to A, its chip reappears, although the stated behavior says a removed chip stays removed for that page. A set of dismissed page IDs (or an explicit reset rule documented in the UI contract) would make the intended behavior unambiguous.
No merge/release/deploy performed.
1852497 to
c638b4b
Compare
98b2aa1 to
2aede7d
Compare
|
@agentrozjedemeai Thank you. All three are fixed in [P1] Queued-message edit and [P2] plan follow-up. The page no longer joins I have not added a ChatView integration test of the queued-edit and plan follow-up sends. ChatView has no harness that sends a message (only Dismissal lifetime. The surface now keeps every page the person removed while it is open. In the bubble's frame, I removed the chip on Verification on
|
agentrozjedemeai
left a comment
There was a problem hiding this comment.
Exact-head review of 7b305d4364387fcf4b96de67ef7ef3f0239c000a. The earlier queued-edit and plan-follow-up insertion-point findings are fixed: both use promptForSend without an automatically appended page reference; the regular send pairs messageTextForSend with its record, and the edit chip is hidden. The dismissal set also preserves A across A → B → A while the surface stays open. The structural release pin is useful for those two paths, but it does not cover a send failure/retry.
[P2] Restoring a failed send leaves an unpaired page reference in the editable draft. ChatView.tsx:7380-7395 (also 6994-7012 for fan-out) restores messageTextForSend, including the automatically appended lazurio-page link, to the composer when a send fails. If the person now removes the page chip or the host switches pages before retry, promptForSend still contains the old link. withPageReference(promptForSend, null) cannot remove it, while withPageRecord(..., buddyPage.record, messageTextForSend) adds no record for the old page (or adds only the new page's record). The old reference appears in the outgoing text without its record; buddyProviderText removes that orphan and Hermes receives no block for that page. With page B selected the sent text also shows an orphan chip for A despite only B reaching Hermes. This violates the removal/display contract on a normal recoverable error path. I reproduced the helper-level retry sequence on this exact checkout (1/1 probe passed). Restore a pre-page draft on failure, or reconcile/remove previously auto-added page references against the record actually sent on retry, and cover failed-send → dismissal/page change → retry with a regression test.
Independent local checks: page + ChatView logic 146/146; release contract 42/42; scoped lint and format clean; web typecheck exited 0 (only unrelated suggestions). No ChatView send-path integration harness was run; the existing structural pin does not protect this restoration path. No merge, release or deploy.
|
@agentrozjedemeai Thank you, the P2 is real. I fixed it in Restoring a failed send.
Regression test.
Verification on
|
agentrozjedemeai
left a comment
There was a problem hiding this comment.
@immakermatty Exact-head re-review of 70412e27a9e1a751696e1bb2d47562fd704ade1e on base c638b4b7324df6f009ca32ee14aa104595d9cdad. The prior P2 is fixed: messageTextForSend remains the person’s draft, while pageTextForSend alone feeds the page record and both outgoing texts. Both the single-send failure restore and the multi-model restore (including the toast path) use messageTextForSend, so a retry recomputes the page from the chip currently shown. The seam regression pins these uses; queued-edit and plan-follow-up paths remain separate. Independent local verification in a clean detached clone: five focused web test files 327/327, release contract 42/42, scoped lint and format clean, web typecheck exited 0 (unrelated suggestions only), git diff --check clean. Exact-head fork CI passed; zero unresolved review threads. The author’s browser screenshots and manual retry procedure were inspected as PR evidence, not independently replayed. No merge, release, or deployment performed.
c638b4b to
c78d0f7
Compare
…son can remove Root decision 0210, plan DEV-6676 (row 26). Buddy's surface shows the host page's last valid lazurio.buddy.context as a chip above the composer, for example "Apps /apps", with a button that removes it. While the chip is there, a message the person writes carries the page as a composer record of kind `lazurio-page` with a reference in its text. Buddy's T3 Code projects it for Hermes as the labelled Czech block of row 23. An empty message carries nothing. A removed chip stays removed for that page, and another page brings it back. The record is the contracts' generic UnknownContextRecord with the payload buddyPrompt.ts reads, so no contract changes. The seams: - ChatView adds the reference and the record where it sends, and renders the chip above the composer. - The composer's and the timeline's presentation registries show a page reference as a page chip in their fallback, where T3 would call an unknown context unavailable. buddySurfacePage.test.ts covers the record, its id, its label, the wire schema and the empty message. In the bubble's frame, a message with the chip reached Hermes with the Czech block, and one sent after removing the chip did not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ronment After the rebase on #107's c638b4b732, where Buddy mode is checked for a timeline's own Environment, the page hook takes the chat's Environment as well (useBuddyPage(environmentId)). A thread of another Environment never carries Buddy's page record. It also passes the mode to the language hook, which now takes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd a removed page stays removed Pablo's review of 98b2aa1bc3. The page reference was added to promptForSend, which the queued-message edit and the plan follow-up also send, with contexts of their own that lack the record. Their messages referred to the page, and Buddy's T3 Code dropped the block. The reference now joins only the regular send's text (messageTextForSend), whose context takes the record from that same text. Those two paths therefore carry no page. While a queued message is edited, the chip is hidden, since that send will not carry it. The release contract pins the single place (one withPageReference in ChatView, in messageTextForSend). A removed chip now stays removed for its page, also after the host visits another page and comes back: the surface keeps every page the person removed. In the bubble's frame: a message with the chip reached Hermes with the block; after the chip was removed, the words only. Another page showed its chip, and the first page, visited again, did not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…retry carries the page as it is then When a send failed, ChatView put messageTextForSend back into the composer. That text already carried the page reference, so after the person removed the chip, or after the host moved to another page, the retry sent the old page's reference without its record: Hermes got no block for it, and the sent message still showed its chip (Pablo's P2 on 7b305d4364). messageTextForSend is T3's again, the person's own words, and the page joins a text of its own, pageTextForSend, which only the record and the two texts on the wire read. Both restores of a failed send, the single and the multi-model one, give back the words; the retry adds the page the chip shows then, or none. The release contract now pins that split and that both restores read the words; it fails on the reviewed ChatView and when either restore reads the page's text. The runbook's rebuild note for row 26 says the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70412e2 to
dc1e266
Compare
Status: ready for review. Overlay row 26, plan DEV-6676: T3 of "Buddy's chat on Lazurio T3 Code with Hermes as an ACP agent". Stacked on #107 (T2, base branch
agent/DEV-6676-buddy-t2-surface, on #105 and #104); this PR's diff is only T3. Nothing is merged, released or deployed. Head70412e27a9, on #107'sc638b4b732. It fixes Pablo's P2 on7b305d4364: a failed send gave the person's draft back with the old page's reference in it.Why
Buddy is asked from a page: the Launchpad, Chat, Automate or Settings of an Environment. The bubble's host sends that page's context to Buddy's surface (
lazurio.buddy.context, #107). #104 already turns alazurio-pagecomposer record into the labelled Czech block Hermes gets. Nothing yet put that record into a message, and the person could not see or leave out what their message carries.What changes
The chip. Buddy's surface shows the host page's last valid context as a chip above the composer, for example "Apps /apps", with a button ("Neposílat stránku") that removes it. The chip is there in the 400×600 panel too, above the collapsed composer. A removed chip stays removed for that page while the surface is open, also after the host visits another page and comes back; another page shows its own chip. While a queued message is edited, the chip is hidden, because that send carries no page.
What a message carries. While the chip is there, a message the person writes carries the page as a composer record of kind
lazurio-page, with a reference in its text. Buddy's T3 Code projects it as the Czech block (row 23):An empty message carries nothing, so Enter on an empty composer still sends nothing. The page joins the text in one place only, the regular send, as a text of its own whose context takes the record from that same text. The queued-message edit and the plan follow-up carry no page, so no send has a reference without its record (Pablo's findings on
98b2aa1bc3, fixed in7b305d4364).A failed send gives back the person's words only. T3 puts a failed message back into the composer. That text is T3's
messageTextForSend, which stays the person's own words; the page never enters the draft. The retry carries the page the chip shows then: none once the person removed the chip, the new page after the host moved (Pablo's P2 on7b305d4364, fixed in70412e27a9). The record is the contracts' genericUnknownContextRecordwith exactly the payloadbuddyPrompt.tsreads, so the contracts do not change.The person's sent message shows the same page chip where its text refers to the page. Without this, T3 would show it as unavailable context.
Code. It lives in
apps/web/src/lazurio/(buddySurfacePage.ts,BuddySurfacePageChip.tsx, anduseBuddyPageinBuddySurface.tsx). The seams:ChatView.tsxadds the reference to a text of its own,pageTextForSend, which only the record inbuildOutgoingMessageContextand the two texts on the wire (the single and the multi-model send) read, and renders the chip above the composer except while a queued message is edited;composerContextPresentation.tsxandMessagesTimeline.tsxtry the page chip in their registries' fallback.Distribution files.
composerContextPresentation.tsx..github/README.mdis updated.What does not change
Browser check
This used the same setup as #107: a headless Chromium, the test host page on
https://launchpad.mattycus.lazurio.ioframing Buddy's surface in a same-site iframe with the bubble's sandbox, and Hermes v0.22.2 over ACP on a scripted fake model that echoes what it gets.Aplikace: Launchpad,Stránka: /apps)./automate/runs, the chip came back as "Automate /automate/runs".A failed send, then the retry (
70412e27a9)The same setup. The test routes the frame's socket to the server and drops exactly the message that carries the person's words, so the server never sees that send and T3 gives the draft back. Then the person removes the chip, or the host moves to another page, and sends again. The same steps ran on
7b305d4364and on the fix:7b305d4364the draft came back as "Selhalo a stránku jsem odebral … [Apps /apps]", with the page inline. The retry reached Hermes as the words only, but the sent message showed an "Apps /apps" chip. With the fix the draft came back as the words only, and the retry has no page chip and no page for Hermes./automate/runsto/settings/integrations. On7b305d4364the sent message showed both "Automate /automate/runs" and "Nastavení /settings/integrations", while Hermes got only the Settings block. With the fix it shows only "Nastavení /settings/integrations", and Hermes got that block.7b305d436470412e27a9Tests
buddySurfacePage.test.tscovers:buddyPrompt.tsreads, its id and its label;OrchestrationMessageContext, once per message;messageTextForSendis T3's own definition, the page joins onlypageTextForSend, only the record and the two texts on the wire read that, and both restores of a failed send give backmessageTextForSend. It fails on7b305d4364's ChatView, and when the single send's restore or the multi-model send's restore reads the page's text (three mutations, each 41/42). A ChatView render harness does not exist upstream, so the browser check above runs the real send path.vp lintandvp fmt --checkare clean; release contract 42/42; the allowlist guard passes.ChatView.logicandMessagesTimeline.logic(5 files, 327 tests, on70412e27a9).MessagesTimeline.browser.test.tsx"restores a manual reading position after reopening and switching threads" failed some runs on this Mac under load (load average about 11). It fails the same way on feat(lazurio): agents send once per idempotency key, and budíček finds Buddy's thread #105's head, which has none of these web changes, so it is not from this PR. CI runs it again.Open question
🤖 Generated with Claude Code