Commit e10ef3b
committed
fix(decompose): address bot follow-up #2 (abort leak, dedup checks, maxTokens)
Bot review on commit fe42888 flagged 3 items, all real, all fixed:
1. [Minor] AbortSignal listener leak in render-ui-kit.ts.
`signal.removeEventListener('abort', onAbort)` ran only on the
did-finish-load success path. did-fail-load, the loadURL catch, and
the hard timeout all left the listener registered until the abort
actually fired (or never).
Fix: centralized cleanup inside `finish()` itself — clears the timeout
AND removes the abort listener on every exit path (success, fail,
catch, timeout, abort). One source of truth, no path can forget.
2. [Minor] Duplicate STANDARD_CHECKS in judge-visual-parity.ts vs
verify-ui-kit-visual-parity.ts. Both held identical 12-check sets;
if one was edited the other would silently drift.
Fix: imported STANDARD_VISUAL_PARITY_CHECKS from @open-codesign/core
(already exported at packages/core/src/index.ts:59). The host prompt
only needs {id, question}, so we project the core's
{id, dimension, question} down via map. Single source of truth.
3. [Nit] Hardcoded `maxTokens: 8000` in the vision judge call.
Worst-case-safety buffer that wastes budget on cheaper models
(Gemini Flash, GPT-4o-mini) and doesn't help correctness — actual
judge output (12 short {passed, reason} entries + 1-2 sentence
summary) lands around 1.5k tokens.
Fix: dropped to 4096 with an inline comment explaining the envelope.
Fits under every routed model's output cap (Gemini Flash ~8k, Sonnet
~8k, GPT-4o ~16k) with comfortable headroom.
Verification:
- apps/desktop: pnpm typecheck (node + web tsconfig) clean
- packages/core: pnpm typecheck clean
- pnpm lint (biome) clean
Bot also confirmed all previous review items resolved on this commit:
✅ fork image URLs → main branch
✅ changesets consolidated to one
✅ case-insensitive base64 check
✅ scope creep (.github/* changes) no longer in diff1 parent fe42888 commit e10ef3b
2 files changed
Lines changed: 29 additions & 73 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
73 | 25 | | |
74 | 26 | | |
75 | 27 | | |
| |||
191 | 143 | | |
192 | 144 | | |
193 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
194 | 152 | | |
195 | 153 | | |
196 | 154 | | |
197 | 155 | | |
198 | | - | |
| 156 | + | |
199 | 157 | | |
200 | 158 | | |
201 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
62 | 70 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | | - | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
| |||
0 commit comments