Uh oh!
There was an error while loading. Please reload this page.
feat(console-ai): ask→build handoff carries conversation context + live verification (ADR-0057 P4) - #2444
Merged
Merged
Conversation
…-0057 P4 / cloud#817) The P4 "Open in Builder →" handoff carried only the build prompt + optional package, so the Builder started cold. It now also carries the source ask conversation so the build agent's first turn starts with the user's thread. - app-shell: both handoff sites (full-page AiChatPage + console FAB) append ?parentConversationId=<ask thread id> to /ai/build. The build surface reads it and forwards to useObjectChat; the existing URL-mirror drops it once the build conversation id mints, so a reload never re-carries it. - plugin-chatbot: useObjectChat accepts parentConversationId and sends it as context.parentConversationId on the FIRST turn only (held in a ref, consumed once). New pure helper withHandoffContext does the non-mutating context merge. Consumes the cloud handoff-context contract (cloud#817). Without it the console degrades cleanly — the id is sent but ignored, a working cold start. Unit-tested (withHandoffContext.test.ts); no regressions in plugin-chatbot suites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ntext (ADR-0057 P4) Renders the real useObjectChat, captures the outgoing chat POST bodies, and asserts context.parentConversationId rides the FIRST turn only (preserving the existing agentName/packageId context) and is absent on turn 2 and when no handoff was made. Complements the pure withHandoffContext unit test with the actual ref-consume-once wiring through prepareSendMessagesRequest. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 13, 2026
Merged
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.
The two ADR-0057 P4 follow-ups deferred by #2439: the context-carrying upgrade (cloud#817) and verification of the ask→build handoff.
Context-carrying (the upgrade)
#2439's "Open in Builder →" carried only the build prompt + optional package, so the Builder started cold. It now also carries the source
askconversation so the build agent's first turn starts with the thread the user already had.AiChatPageand the console FAB) append?parentConversationId=<ask thread id>to/ai/build. The build surface reads it and forwards it touseObjectChat; the existing URL-mirror drops it once the build conversation id is minted, so a reload never re-carries it (same treatment as?handoffPrompt).useObjectChatacceptsparentConversationIdand sends it ascontext.parentConversationIdon the first turn only (held in a ref, consumed once inprepareSendMessagesRequest). New purewithHandoffContextdoes the non-mutatingcontextmerge.Verification (the ADR-0054 proof #2439 skipped — done deterministically)
A full LLM-driven browser e2e needs the cloud AI stack (
run-stack+ a provider key + a seat) which isn't reachable in CI/sandbox — the console's build surface only renders against a live agent catalog. Instead this proves the whole contract with tests that exercise the real wiring, not mocks of it:withHandoffContext.test.ts— the context merge (nest undercontext, preserve siblings, never mutate the cached body). 3 ✓useObjectChat.handoffContext.test.tsx— integration: renders the realuseObjectChat, captures the outgoing chat POST bodies, assertscontext.parentConversationIdrides the first turn only and is gone on turn 2. 2 ✓ChatbotEnhanced/useObjectChat/mapMessagessuites. 137 ✓Manual staging proof (for when the cloud AI stack is up): ask the
askagent a build-shaped question → it declines with the "Open in Builder →" card → click it → on/ai/build, the first chat POST body carriescontext.parentConversationId(the ask thread) and a reload does not re-send it.Dependency
Consumes the cloud handoff-context contract: objectstack-ai/cloud#819 (cloud#817) — merge that first. Without it the console degrades cleanly: the id is sent but ignored, a working cold start.
🤖 Generated with Claude Code