Repository navigation
Commit b915703
fix: [#827] address re-review — finops_warehouse_advice formatter + last 2 String(e)
Fourth pass on PR #828. Re-review found one MAJOR formatter bug missed
by the previous formatter audit, plus the last two String(e) instances
that the third pass left behind.
1. MAJOR — formatter field-name mismatch in finops-warehouse-advice
Same class of bug as the one commit ed6f247 fixed for
finops-query-history.ts and finops-expensive-queries.ts — the
formatter read keys the handler never emits:
- Performance summary: read `avg_execution_time`, `avg_queue_time`,
`status`, `health`; handler emits `query_count`, `avg_time_sec`,
`p95_time_sec`, `avg_bytes_scanned`, `total_credits`.
- Load metrics: read `warehouse_size`, `avg_load`, `peak_load`,
`utilization`; handler emits `avg_concurrency`, `avg_queue_load`,
`peak_queue_load`, `sample_count`.
Every value rendered as "-" regardless of input. Auto-pick from the
prior commits expanded the user population hitting this formatter.
Fix: rewrote both table headers and row loops to read the actual
handler keys. Added inline comments pointing back at the previous
instance of this bug pattern so the next reviewer doesn't have to
discover it independently.
2. MINOR — null-guard on result.recommendations
`result.recommendations.length` was read directly. If a future
handler variance or partial success ever dropped the field, the
tool throws a TypeError instead of returning a structured error.
Coalesced to `[]`. Also defensive-defaulted warehouse_load and
warehouse_performance for the same reason.
3. MINOR — last two String(e) call sites
The third pass normalized role-access.ts but missed:
- unused-resources.ts:234
- warehouse-advisor.ts:301
Both fixed in this commit. All five finops handlers now use the
same `e instanceof Error ? e.message : String(e)` pattern, so
driver errors no longer carry "Error:" prefixes inconsistently.
Validation
- `tsgo --noEmit`: pass.
- `bun test test/altimate/finops-*.test.ts test/altimate/schema-finops-dbt.test.ts`:
95 pass / 0 fail / 67 skip (credential-gated).
- Marker check: pass.
Reviewer note
- GPT-5.4 and Kimi K2.5 second-opinions did not produce output this
round either — kilo CLI was preempted by other concurrent jobs on
the same OpenRouter quota. Single-reviewer Claude analysis.
Deferred to follow-up
- Tool-level integration test for each formatter (would have caught
all three formatter bugs at once — tracked as a separate quality
bar enhancement).
- warehouse_filter param silently ignored for BigQuery/Databricks
(description already documents Snowflake-only; tracking as NIT).
Closes review feedback for PR #828 (fourth pass).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 76ce370 commit b915703
3 files changed
Lines changed: 41 additions & 23 deletions
File tree
- packages/opencode/src/altimate
- native/finops
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
32 | 40 | | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
| |||
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
99 | 117 | | |
100 | | - | |
101 | | - | |
| 118 | + | |
| 119 | + | |
102 | 120 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
106 | 124 | | |
107 | 125 | | |
108 | 126 | | |
| |||
0 commit comments