feat(studio): share durable image commands with Wizard and MCP - #275
Conversation
…neration-commands
…neration-commands
PR Review — Loreframe StudioRisk: medium Automated review from Findings
Changed files
CONTRIBUTING checklist
Posted by the repo PR review workflow. Re-runs on each push to the PR. |
Code healthQuality score: 57.1/100Higher is better. The score is a trend dashboard; the independent ratchet below remains the CI gate.
Change vs PR base: +0.7 points.
Markdown, JSON catalogs and tests are out of this table. Only Most complex functions
Trend vs baseline
Warnings
Ratchet passed. |
Load Settings and reroll copy H3/video/primary-settings keys into the shared Studio params bag. The closed v2 builder treated those leftovers as fatal, so Generate and reroll of an image failed after pencil. Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
A single generation.image queue row without a matching admission used to raise 503 from list/resume/discard and block every other leftover. Skip the unmatched row instead so video and valid image recovery still work. Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
_list_workspaces includes every outputs/ subdirectory. A backup folder such as "old copy" made restore_recovery raise 422 and blocked list, resume and discard for every leftover. Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_ab0242cc-eac8-41ea-8dc2-6792a5e78e06) |
Studio and Wizard image submissions now share the durable command boundary used by MCP. Before submitting, the browser persists and visibly presents the exact image request; a lost response can be recovered with the same intention and returns the original native task instead of creating another job.
The V2 contract includes assembled Studio image parameters, canonical references with explicit source locations, LoRAs, processors and collection/workflow attribution. V1 clients remain compatible. Task creation and the receipt commit in the existing TaskRegistry; inference and recovery use the native queue. The image panel and command client load on demand. The Wizard preserves literal prompts, treats an unspecified CFG as unspecified, and keeps pending presentation requests through React Suspense; a removed panel cancels before admission.
Validation: required CI passed on
cc0d7602, with Python, UI and browser E2E; independent Luna reviewed that delta. Full image UI: 1,318 passing. Follow-up validation covers 26 Load Settings/builder tests, 36 recovery/admission tests, 55 final recovery/admission checks after #278, five architecture checks, and lint/type-check/build/bundle limits. Required CI also passed onb0fc2dd3; current65ed2852required CI and both Cursor checks also passed. independent Luna review approves the recovery refinement, including discard write failures. No quality baseline was raised. A disk I/O stall interrupted one local test run; the directed recovery tests then used temporary SQLite databases in tmpfs (not a power-loss durability test).Real V2 validation passed on frontend
cc0d7602/ byte-identical backendd08853a5: a real MiniMax Wizard turn presented the literal request and correlated intention before exactly one image command POST. Flux 2 Klein 9B produced one 512×512 JPEG (job2d75dfa9) in 96.98 seconds, including 81.63 seconds loading the model. An external MCP SDK client replayed the exact completed intention, received the original receipt/task, found one canonical task and zero active tasks, and downloaded the same 14,751-byte file. Full decode and canonical SHA-256 match (ec119db6d4474e361457a0936e00235a44dc190e3a68c363d45467a53f2d4fe5). This one-step sample validates execution, not universal model or artistic quality.Earlier unsuccessful Wizard attempts and two corrected MCP harness assertions remain in local evidence; they did not create replacement generations. Evidence:
outputs/wizard-mcp-execution-20260909/image-live/v2-wizard-fixed-real/andv2-wizard-mcp-replay-final/. Earlier V1 MCP generation/replay also passed.Follow-up fixes: the changes proposed by #276, #277 and #278 are incorporated locally into this branch with refinements; no remote PR merge was performed. Load Settings/reroll projects only declared residual fields, rejects envelope injection/unknown keys and refuses active unsupported advanced image controls. A private browser Load Settings preflight preserved the real image's prompt/seed/size and emitted exactly one V2 command; an intercepted 422 prevented inference and was shown in the UI. The harness also counted 18 navigation-cancelled GETs as failures. Independent review classifies the bounded functional result as PASS_WITH_AMBIENT_ABORTS; the original FAIL evidence is retained.
Queue recovery skips invalid backup-folder names and isolates malformed or orphaned rows while returning 503 for storage failures, preserving recovery records and canonical tasks. Actual list/discard HTTP handlers were exercised with SQLite and filesystem failures. The original #277 broad catch was refined after independent review found that it could hide storage errors.
Scope is the image vertical of P5. Speech has a checked local stack and passed real Wizard generation plus external MCP replay (separate from this image PR); other media, Tools, editorial domains and backend workflows remain in the plan. Resource hashes document inspected files without freezing their bytes throughout queue lifetime; model bytes and universal LoRA compatibility are not certified. The native deployment remains a single generation runtime, without a second scheduler or cross-process lease.
Note
Medium Risk
Changes core generation admission, TaskRegistry schema, and queue recovery semantics; mistakes could affect job deduplication or recovery, though the boundary is heavily tested and fails closed on corrupt admissions.
Overview
Introduces a shared, durable image admission path for Studio, Wizard, and MCP so the same
intent_idyields one canonical task/receipt and safe retries instead of duplicate GPU jobs.New command surface:
GET/POST /api/v1/generation/commands, receipt lookup, and read-only reference canonicalization; MCP exposesgeneration.image/generation.receiptwith the same catalog. V1 freezes a small text-to-image envelope; V2 accepts the full typed Studio image map (refs, LoRAs, processors) viastudio_image_specand preflight/resource layers before admission.Runtime wiring: Submissions run through native
generatevalidation, then an in-processadmit_generation_commandcallback records admission in TaskRegistry, persists the durable queue projection, and dispatches once via an atomic dispatch claim._new_generation_jobgainspublish_task=Falsefor command-owned tasks;prepare_generation_inputshonorsprepared_studio_imagesso Studio-resolved paths are not re-resolved in the output workspace.TaskRegistry v3 adds
task_command_admissions(original/effective snapshots, fingerprints, receipts) and safer SQLite bootstrap under a file lock. Queue recovery list/resume/discard now restores and filters image-command leftovers linked to admissions, skipping orphans and invalid workspace names without masking storage errors.Reviewed by Cursor Bugbot for commit 65ed285. Configure here.