You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c4ab025
Browse filesBrowse the repository at this point in the historyBrowse files
fix: [#827] resolve finops_* 100% failure with warehouse-resolver fallback
Telemetry (memory/telemetry-analysis-2026-05-21.md, 2,503 machines, 14 days)
flagged `finops_analyze_credits` (8/8) and `finops_query_history` (1/1) as
100% broken. Every user who tried them hit a dead-end "Credit analysis is
not available for unknown warehouses." error with no path forward.
Unlike `sql.explain` (which auto-falls-back to `warehouses[0]`), the finops
handlers had no resolution logic and returned an unhelpful error whenever
the caller omitted the warehouse name, supplied an unknown one, or supplied
one whose type wasn't supported.
Changes
- New shared helper `finops/warehouse-resolver.ts` with a 4-branch resolution
contract (ok / not configured / unknown name / unsupported type) and
actionable errors that name the available warehouses and suggest
`warehouse_add` when nothing is configured.
- `credit-analyzer.ts` (analyzeCredits, getExpensiveQueries) and
`query-history.ts` (getQueryHistory) wired to the resolver. The dead
`getWhType` helpers removed.
- `warehouse` parameter made optional on the `finops_analyze_credits` and
`finops_query_history` tool schemas; descriptions updated to document
the auto-pick behaviour and the full supported-warehouse list.
- `CreditAnalysisParams`, `ExpensiveQueriesParams`, `QueryHistoryParams`
marked `warehouse?` to match the new optionality contract.
- 12 new unit tests in `test/altimate/finops-warehouse-resolver.test.ts`
pinning every resolution branch including empty-string and
whitespace-only requested values.
Expected impact
- Error rate on `finops_analyze_credits` and `finops_query_history` drops
from 100% to whatever the real operational failure rate is (warehouse
unreachable, ACCOUNT_USAGE permission missing, etc.). The resolver no
longer masks those as "unknown warehouse" — driver errors pass through
with their original message.
- Cost-audit wedge demo now works on any tenant with a Snowflake / BigQuery
/ Databricks warehouse configured, without the LLM needing to guess the
exact warehouse name.
Validation
- `tsgo --noEmit`: pass, zero errors.
- `bun test test/altimate/finops-*`: 37 pass / 0 fail (12 new + 25 existing).
- `bun test test/altimate/finops-*-e2e.test.ts test/altimate/schema-finops-dbt.test.ts test/altimate/finops-role-access.test.ts`: 85 pass / 67 skip (credentials-gated) / 0 fail.
- Marker check: pass — no upstream-shared files touched.
Closes#827
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
"Fetch recent query execution history from a warehouse. Shows query text, execution time, bytes scanned, and status. Snowflake: reads from QUERY_HISTORY. PostgreSQL: reads from pg_stat_statements.",
48
+
"Fetch recent query execution history from a warehouse. Shows query text, execution time, bytes scanned, and status. Snowflake: reads from QUERY_HISTORY. PostgreSQL: reads from pg_stat_statements. Also supports BigQuery, Databricks, ClickHouse.",
0 commit comments