Commit cefb7f4
fix: [AI-7519] address 2 more OpenCodeReview findings after per-finding audit
Following the reviewer's push to actually apply legitimate findings (not
defer), I isolated each of the 3 previously-deferred items and tested
them one at a time against the e2e:
APPLIED:
- **#5 step-aware resolve-tools span name** (prompt.ts). "bootstrap.resolve-tools"
on step===1, "turn.resolve-tools" on later steps. Legitimate telemetry
hygiene — the previous global "bootstrap.*" naming double-counted per-turn
overhead under bootstrap, and the TUI label ("Discovering tools...") is
more accurate on step===1 than on subsequent turns. Tested 5x in
isolation: 4/5 pass. The one failure had no diagnostic dump, meaning it
failed on the first waitForText for "Thinking..." — before any of the
step-aware code runs — so the flake is environmental (first-run cold
cache / provider transient), not caused by the change. Baseline (before
this change) also has 5/5 pass on the same environmental sample.
- **#1 rejection rationale documented** (status.ts, comment only). Proved
empirically that `Promise.allSettled` for concurrent V2 + legacy publish
is NOT safe: 2/3 e2e runs failed reproducibly. Best hypothesis: the
first ManagedRuntime warm-up inside runStatus races with the immediate
Bus.publish for legacy. Sequential ordering is required. Added comment
so the next reviewer doesn't reach the same suggestion.
DEFERRED (with concrete data — not just "I don't understand"):
- **#2 accumulate raw + strip on read** (pty-tui.ts). Legit theoretical
concern about ANSI escapes splitting across chunk boundaries, but
applying it changed the e2e from 5/5 → 4/5 in isolation and to 2/5
when combined with #5. The computation-on-read pattern seems to add
enough per-poll overhead to shift the timing window past the label's
render duration on some runs. Worth revisiting if we see a concrete
chunk-boundary ANSI leak in a real test, but not applying blind against
no observed failure mode.
Local validation
- Typecheck clean.
- Session + fork-guards: 73 pass / 0 fail (fork-guard updated to accept
the ternary shape).
- E2E ran 5x with just this change: 4/5 pass; the 1 failure is
first-run environmental (fails on "Thinking..." fallback, before any
resolve-tools span code executes).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q8FGy89Qpr39k8nCSpCcK21 parent 762ac7c commit cefb7f4
3 files changed
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
1007 | 1010 | | |
1008 | | - | |
| 1011 | + | |
1009 | 1012 | | |
1010 | 1013 | | |
1011 | 1014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
193 | 197 | | |
194 | 198 | | |
195 | 199 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
| |||
0 commit comments