Uh oh!
There was an error while loading. Please reload this page.
fix(console-ai): reliable handoff auto-send + second-handoff context re-carry (ADR-0057 P4) - #2449
Merged
Merged
Conversation
…f re-carry (ADR-0057 P4) - Swallow fix: the handoff seed gated on the async-resolved activeAgent, which can settle after the conversation id mints, so the deferred-send replay ran with an empty pending and never re-fired (empty build conversation on handoff). Seed now gates on the route (agentSegment, synchronous) + bumps a pendingSignal that useDeferredFirstSend lists in its replay deps. - Second-handoff re-carry: useObjectChat re-arms parentConversationId on each falsy→truthy transition of the prop (singleton ask id repeats; the URL-mirror strip→re-supply is the fresh-arrival signal), and the seed re-arms on each new handoffPrompt. Unit-tested (useDeferredFirstSend post-id-seed replay; transport re-carry). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
os-zhuang
commented
Jul 13, 2026
ContributorAuthor
Residual (second-handoff auto-send into a hydrating conversation) tracked in #2450. |
4 tasks
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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 freeto 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.
Two reliability follow-ups to the P4 "Open in Builder →" handoff (#2439 / #2444). Backend counterpart: objectstack-ai/cloud#820 — merge that first (without it the re-carried context on a second handoff is sent but dropped server-side; not a regression, just inert).
1. Handoff auto-send swallow — fixed
The handoff's auto-sent first message could be dropped on a brand-new build conversation: the seed effect gated on the async-resolved
activeAgent, which can settle afterPOST /conversationsmints the id. The deferred-send replay only re-ran on id/doSendchanges, so a seed landing post-id was never replayed — conversation created, no…/chat, empty Builder (observed live in the previous verification run; tenant DB showed the build conv with 0 messages).Fix, two halves:
agentSegment, known synchronously), notactiveAgent.stashPendingFirstMessagewhich bumps apendingFirstMessageSeq;useDeferredFirstSendlists thatpendingSignalin its replay deps, so an out-of-band seed replays even when the id already resolved.Live-verified on the local rig (fresh registration → ask decline → click card): the build first turn auto-fired with
context.parentConversationIdcaptured on the wire, and the agent produced a blueprint. This was the exact scenario that swallowed before.2. Second handoff re-carries the latest ask context
Build conversations are singletons per (user, app, product), and the ask thread is too — so a second handoff re-supplies the same parent id. The transport now re-arms on each falsy→truthy transition of the prop (the URL-mirror strips the param between handoffs, producing the edge), and the seed re-arms on each new
handoffPrompt. Live-verified: after a second "Open in Builder →", the next build turn carriedparentConversationIdagain.Known residual (issue to follow, linked after filing)
The auto-send of the second prompt into an already-existing, mid-flight build conversation (first blueprint still Awaiting Approval) does not fire — the user sends once manually and the context still carries. Suspected hydration race: with an existing conversation the id is present at mount, so the replay fires before
useChatfinishes hydrating. Not a regression — before this PR a second handoff did nothing at all.Tests
18/18 green: new
pendingSignalpost-id-seed replay (incl. a second bump), transport re-carry across strip→re-supply, plus all existing deferred-send / handoff-context / send-failure suites.🤖 Generated with Claude Code