Repository navigation
Commit 6b41623
fix: [AI-7519] address PR review feedback
Three review findings from CodeRabbit + Kilo + cubic addressed:
1. **Enter busy state before publishing bootstrap phases** (prompt.ts).
Previously the TUI renders phase labels only while `status.type === "busy"`,
but `SessionStatus.set(..., "busy")` fired at line 506 inside the
while-loop — *after* the bootstrap traceSpan calls at lines 411-431.
Early bootstrap labels ("Loading session...", "Loading config...",
"Preparing telemetry...", "Detecting project shape...") were never
visible; only `bootstrap.resolve-tools` at step===1 fired within the
busy window. Set busy immediately at the top of `loop()` so all
bootstrap phases render. The existing set inside the while-loop is
preserved as a busy → busy no-op for entry paths that don't come
through session start.
2. **Publish EventV2 Phase alongside legacy** (status.ts). `publishPhase`
previously only mirrored to `LegacyEvent.Phase` (the SSE bus the TUI
subscribes to). V2 subscribers never saw phase updates. Added
`publishPhase` to the Service interface + Layer implementation so
`Event.Phase` is published through the EventV2 bridge alongside the
legacy bus event. Matches the pattern used by `set()`.
3. **Use tmpdir fixture + assert a mapped phase label** (e2e test).
Replaced manual `mkdtempSync` + finally-block cleanup with
`await using tmp = await tmpdir()` — matches the codebase convention
(scheduler.test.ts and the coding guideline in CONTRIBUTING.md) and
handles the case where launchTui rejects before the try block.
Added a hard `expect(rendered).toContain("Discovering tools")`
assertion — the previous single fallback assertion would pass even
if the entire phase-event pipeline was broken (because the fallback
renders whenever status is busy). "Discovering tools" is the label
for `bootstrap.resolve-tools`; its span duration (MCP tool listing)
is reliably longer than the PTY poll interval, so this is safe from
flake. Diagnostic dump of the other timing-sensitive labels retained.
Local validation
- Typecheck clean across `@altimateai/altimate-code`.
- Session + fork-guards: 67 pass / 0 fail (18 fork-guards including
the AI-7519 pipeline guard).
- Rebuilt binary + re-ran the tightened e2e — both hard assertions
pass; specific-label hits: "Discovering tools" ✓, others sub-ms.
Skipped
- Cubic's duplicates of CodeRabbit findings — same items, addressed.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8FGy89Qpr39k8nCSpCcK21 parent 3fc64ff commit 6b41623
3 files changed
Lines changed: 74 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
410 | 420 | | |
411 | 421 | | |
412 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| |||
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
141 | 158 | | |
142 | 159 | | |
143 | 160 | | |
| |||
170 | 187 | | |
171 | 188 | | |
172 | 189 | | |
173 | | - | |
174 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
175 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
176 | 199 | | |
177 | 200 | | |
178 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 32 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | | - | |
35 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | | - | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
64 | 77 | | |
65 | 78 | | |
66 | 79 | | |
| |||
71 | 84 | | |
72 | 85 | | |
73 | 86 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 87 | | |
| 88 | + | |
78 | 89 | | |
79 | 90 | | |
80 | | - | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
0 commit comments