Uh oh!
There was an error while loading. Please reload this page.
fix(console-ai): preserve ?package= across the /ai URL mirror (ADR-0057 P1 hardening) - #2422
Merged
Merged
Conversation
…57 P1 hardening)
Live browser testing of ADR-0057 P1 surfaced a wrinkle the unit tests missed:
AiChatPage's URL-mirror effect rewrote `/ai/build?package=X` to
`/ai/build/:conversationId` WITHOUT the query, so `editPackageId` went
undefined and the conversation scope fell back from `app:${package}:${product}`
to the product alone. The full-page thread stayed shared with the Studio copilot
(both still resolve `app:X:build` at creation), but the fallback also cached the
package-scoped conversation under the bare `build` key — so a later plain
`/ai/build` visit could resume a package-specific thread.
Re-append `?package=` when mirroring so the app scope (and the ADR-0070 "Edit
with AI" package binding forwarded to the agent) persists. The consumed
`agent`/`new` params stay stripped as before.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJKsT9dvjxgVSPYid8EtTQThe latest updates on your projects. Learn more about Vercel for GitHub. |
os-zhuang
marked this pull request as ready for review
July 13, 2026 07:21
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
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.
What & why
Follow-up hardening to ADR-0057 P1 (merged in #2414), surfaced by live browser testing against the real cloud AI stack.
The live run showed the full-page build surface caching its conversation under both
app:acme.demo:build(the intended ADR-0057 key) and a barebuildkey. Root cause:AiChatPage's URL-mirror effect rewrites/ai/build?package=X→/ai/build/:conversationIdwithout the query string, soeditPackageIdgoesundefinedon the next render and the conversation scope falls back fromapp:${package}:${product}to the product alone.app:X:buildat creation), which is why unit tests passed.buildkey — so a later plain/ai/buildvisit could resume a package-specific thread (a small leak), and the ADR-0070 "Edit with AI" package binding dropped from the URL.Fix
Re-append
?package=when mirroring, so the app scope (and the package context) persists across the rewrite. The consumedagent/newparams stay stripped exactly as before.Verification
pnpm --filter @object-ui/app-shellconsole-ai + hooks tests: 49 passed (incl.chatScope.test.ts, which already covers theapp:${package}:${product}key formation).turbo type-checkclean; ESLint on the changed file: 0 errors.Pure bug fix — no changeset (per repo convention).
Refs: ADR
docs/adr/0057-console-ai-chat-one-conversation-docked.md· P1+P2 #2414 · work order #2412.Generated by Claude Code