lazurio: unsent prompt draft by link from the shell - #36
Merged
Merged
Conversation
The Lazurio Launchpad opens Chat with lazurio-prompt=<id> and lazurio-org=<login> in the link's fragment (after the pairing token when there is one). The overlay takes both off the address at boot, before the router or the pairing read it, and accepts only an id and a GitHub login, never text. Once the primary environment is loaded, it fetches the text from its own origin's /.lazurio/prompts/<id>?org=<login> (the Environment's gateway proxies that path to the Launchpad behind the same sign-in), with same-origin credentials and redirects refused, and accepts only lazurio.prompt.v1 with the same id, a non-empty text up to 16 KiB and an absolute cwd. It then opens a new thread in the primary environment's project rooted at cwd, adding that folder as a project when there is none (as Add project does, without creating the folder), and puts the text in the composer. Nothing is sent: the overlay can only write the composer draft. An unknown id, a failed or redirected fetch or an answer of another shape inserts nothing and shows one error toast. The seam in upstream files is two lines: the capture in main.tsx and <LazurioPromptDraft /> in the chat layout. All five files join the allowlist under one reason; CI runs the overlay's tests, and the release contract test fails when a rebase drops either line, lets the text come from anywhere but this origin, or gives the overlay a way to send. Refs #35. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The overlay table gains the commit "lazurio: unsent prompt draft by link from the shell" and a section "Zadání z Launchpadu" says what the link carries, where the text comes from, which project the thread opens in, what inserts nothing, who may get a prompt (the Launchpad decides), and which release numbers the Launchpad treats as the first with the hand-off, to be confirmed when that release is cut. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The overlay waited for every environment's shell to be bootstrapped, which also turns true when the primary environment is disconnected without a snapshot. Then its project list is empty, so the overlay would try to add the Organization's folder as a new project (a duplicate when it already exists) against an environment its commands cannot reach, and fail with the link already taken. It now waits until the primary environment's shell is live: its project list is complete and commands reach it. Until then the link stays in memory, and a reconnect in the same page load opens it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agentrozjedemeai
approved these changes
Oct 4, 2026
agentrozjedemeai
left a comment
Collaborator
There was a problem hiding this comment.
@immakermatty APPROVED on exact head c175c2b. The link carries only prompt id and Organization login; capture strips them before router/pairing. Fetch is same-origin, redirect:error, no-store, and checks schema/id/text/cwd. The isolated overlay opens a project draft and calls setPrompt, never send. Local review ran 10 overlay tests, 12 release-contract tests and web typecheck; git diff --check clean. Required server/web compatibility and CLI archive checks are green; both review threads resolved. This approves the fork PR, not a release. The first release carrying it must match Platform chatPromptsSince (0.0.45-lazurio.2 or preview from 20261004) before enabling the Launchpad hand-off.
immakermatty
added a commit
to Lazurio/LazurioPlatform
that referenced
this pull request
Oct 4, 2026
… the prompt hand-off The threshold assumed the first fork release with Lazurio/t3code#35 would be 0.0.45-lazurio.2. It now is: released on 2026-10-04 from source 1e4cf23d, which contains the overlay of Lazurio/t3code#36. The comment and the docs say so; the threshold itself does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
immakermatty
added a commit
to Lazurio/LazurioPlatform
that referenced
this pull request
Oct 4, 2026
… the prompt hand-off The threshold assumed the first fork release with Lazurio/t3code#35 would be 0.0.45-lazurio.2. It now is: released on 2026-10-04 from source 1e4cf23d, which contains the overlay of Lazurio/t3code#36. The comment and the docs say so; the threshold itself does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agentrozjedemeai
pushed a commit
to Lazurio/LazurioPlatform
that referenced
this pull request
Oct 4, 2026
… the prompt hand-off The threshold assumed the first fork release with Lazurio/t3code#35 would be 0.0.45-lazurio.2. It now is: released on 2026-10-04 from source 1e4cf23d, which contains the overlay of Lazurio/t3code#36. The comment and the docs say so; the threshold itself does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
The Lazurio shell's "+ Nový modul" (new module) tile should open Chat (this fork) on the same Environment with a prepared prompt in a new thread's composer, not sent: the person reads it, may edit it, and sends it (#35, plan DEV-6639, root decision 0185 S16). Upstream T3 Code has no way to receive a prompt draft from outside, so the fork needs a small overlay entry point. It must never let an arbitrary link inject and run instructions.
Platform side: Lazurio/LazurioPlatform#160 (the Launchpad's
GET /.lazurio/prompts/<id>?org=<login>and the tile's link).What changes
lazurio-prompt=<id>&lazurio-org=<login>in the fragment. When it has a pairing link, the parameters come after the token (/pair#token=…&lazurio-prompt=new-module&lazurio-org=<login>); without one, they go on the plain origin.main.tsxtakes both parameters off the address at boot (captureLazurioPromptLink), before the router or the pairing read it. The pairing token stays where upstream reads it.<LazurioPromptDraft />in the_chatlayout fetches/.lazurio/prompts/<id>?org=<login>onwindow.location.origin. The Environment's gateway proxies that path to the Launchpad behind the same sign-in (Machines Markdown file links are ambiguous and hide their destination pingdotgg/t3code#353). The fetch usescredentials: "same-origin"andredirect: "error". The overlay accepts only JSONlazurio.prompt.v1with:id;textof at most 16 KiB;cwd.cwd, the Organization's root on the Environment. When there is no such project, it adds that folder as a project. This is what "Add project" does with that path, except that the folder is never created (createWorkspaceRootIfMissing: false). It is the least surprising safe behaviour: the person asked to found a module in that Organization, and the agent needs that folder as its cwd. Nothing runs and nothing is sent, and the project can be removed like any other. Opening a thread in some other project would give the agent the wrong cwd, and inserting nothing would leave the person stuck. Upstream's new-thread rule is kept: a draft the person already typed into is never reused, so a second click opens a fresh draft.setPrompton the draft. It has no path to a turn or a queued message.cwd. The toast reads "Could not open the prepared prompt — Nothing was added to the composer."apps/web/src/main.tsxand<LazurioPromptDraft />inapps/web/src/routes/_chat.tsx. The rest lives inapps/web/src/lazurio/. All five files joinallowed_upstream_changesunder one reason comment. CI runs the overlay's tests (vp test run src/lazurio). The release contract test fails when:What does not change
tokenfrom the fragment.new-moduleonly where the Environment's GitHub identity is an Owner of the Organization). The fork stays generic: a new prompt id needs no fork release.Verified
vp test run src/lazurio(apps/web): 10 passed. Covered: id and login only, refusal of text/query/repeats/grammar, stripping, one-time capture, own origin withsame-originandredirect: "error", nothing on 404/network/HTML/bad JSON/schema/id/empty or over-long text/relative cwd/other origin/array, the existing project, the added project, a retry when another navigation overtook the thread, and nothing inserted when the text, project or thread is missing.node --test scripts/lazurio-release-contract.test.mjs: 12 passed. The new seam test fails when the mount or the capture line is removed (checked by mutation).tsc --noEmitforapps/web: clean.vp linton the changed files: clean.vp fmt --check(whole repo): clean.6c8fed35is an ancestor, there are no merge commits, and no unexpected client or package path changed..t3. Its origin's/.lazurio/*was answered by a real hosted Launchpad preview from the Platform PR, emulating the gateway:/pair#token=<one-time>&lazurio-prompt=new-module&lazurio-org=example: paired. OneGET /.lazurio/prompts/new-module?org=examplewas sent. The Organization's folder was added as the projectexample_GEN3. A new thread draft opened (/draft/…) with the Czech prompt in the composer. The address carries no parameters. The server DB shows 0 messages, 0 turns and 0 server threads in that project.lazurio-prompt=unknown-prompt: the Launchpad answered 404, nothing was inserted, and the error toast appeared./.lazurio/(the dev server answers HTML): nothing was inserted and the error toast appeared.ws-d-chat-draft.png,ws-d-chat-existing-project.png,ws-d-chat-unknown.png,ws-d-chat-no-launchpad.png(synthetic Organizationexample).Risks and follow-ups
/.lazurio/prompts/…?org=…from the T3 Code origin (Machines Markdown file links are ambiguous and hide their destination pingdotgg/t3code#353's grammar and query rule allow it) and a real Launchpad pairing link with the parameters. This needs a fork release with this commit, and a Platform release, on a canary Environment.0.0.45-lazurio.2(stable) and0.0.45-preview.20261004.1(preview), fromchatPromptsSincein Lazurio/LazurioPlatformsrc/launchpad/chat.ts. If the first release with this commit gets other numbers, change that constant.Refs #35. Plan DEV-6639, root decision 0185 (S16 and its addendum).
🤖 Generated with Claude Code