Commit 01c1e0d
committed
fix(decompose): address 4 Major review findings on PR OpenCoworkAI#241
1. Decompose loop success now triggers on first clean pass.
The prompt previously required BOTH verifiers to return
{verified, needs_review}, but the deterministic verifier only emits
{ok, needs_iteration}. Forced an unnecessary extra iteration even
when deterministic parity already passed.
Fix: prompt now uses each verifier's actual vocabulary —
success := deterministic.status === 'ok'
&& visual.status ∈ {verified, needs_review, unavailable}
Updated both EN and ZH prompts in decomposePrompt.ts.
2. Visual verifier now actually has a source image at runtime.
`verify_ui_kit_visual_parity({slug})` defaults to `source.png`, but
`createRuntimeTextEditorFs` only seeded `index.html` + frames + skills
from FRAME_TEMPLATES + DESIGN_SKILLS. Image attachments lived in
`promptContext.attachments` but were never persisted to the agent's
virtual FS. The visual judge silently degraded to `unavailable` on
every normal run.
Fix: `createRuntimeTextEditorFs` now accepts `sourceAttachments` and
seeds `source.png` from the first image attachment's `imageDataUrl`.
The runtime call site at runGenerate threads `input.attachments`
through.
3. Judge/render failures now fall back to structured `unavailable`.
`renderUiKit()` (Playwright) and `judgeVisualParity()` (vision LLM)
were awaited without try/catch. Empty/non-JSON judge replies threw,
text-only models threw, headless render crashes threw — all bubbled
up and broke the agent loop instead of returning the documented
`status: 'unavailable'` path.
Fix: wrap both awaits in try/catch returning `unavailableReport()`
with the underlying error message. Logged at info level for trace
visibility.
4. Changeset no longer claims `Closes OpenCoworkAI#225`.
PR template says use `Closes` only for fully resolved issues. This
diff stops at emitting a `ui_kits/<slug>/` handoff bundle and
explicitly tells the agent NOT to continue into the prototype flow.
Phase 2 (cross-page flows, state machines, prototype orchestration)
is separate work.
Fix: changeset now says `Refs OpenCoworkAI#225 (Phase 1 of …)` and notes Phase 2
is tracked separately.
Verification:
- npx tsc --noEmit -p packages/core
- npx tsc --noEmit -p apps/desktop
- both clean (0 errors)1 parent c1861fd commit 01c1e0d
4 files changed
Lines changed: 48 additions & 12 deletions
File tree
- .changeset
- apps/desktop/src
- main
- renderer/src/hooks
- packages/core/src/tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
283 | 292 | | |
284 | 293 | | |
285 | 294 | | |
| |||
289 | 298 | | |
290 | 299 | | |
291 | 300 | | |
| 301 | + | |
292 | 302 | | |
293 | 303 | | |
294 | 304 | | |
| |||
301 | 311 | | |
302 | 312 | | |
303 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
304 | 321 | | |
305 | 322 | | |
306 | 323 | | |
| |||
510 | 527 | | |
511 | 528 | | |
512 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
513 | 533 | | |
514 | 534 | | |
515 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
316 | 332 | | |
317 | 333 | | |
318 | 334 | | |
| |||
0 commit comments