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 ed6f247
Browse filesBrowse the repository at this point in the historyBrowse files
fix: [#827] address consensus review — apply resolver to all 5 finops handlers + formatter fix + case-insensitivity
Multi-model consensus review of the original commit identified four
in-scope issues this commit addresses:
1. finops_expensive_queries tool schema not updated (5/6 reviewer consensus)
The handler in credit-analyzer.ts was already wired to the resolver, but
the tool schema still required `warehouse` and the description claimed
"Snowflake only" — leaving the auto-pick fallback unreachable for that
tool. Schema and description updated to match the other two tools.
2. Formatter field-name mismatch in finops-query-history.ts and
finops-expensive-queries.ts (2/6 independent catches, both MAJOR)
The formatters read `summary.avg_execution_time` / `q.execution_time`,
but the native handler returns `_sec`-suffixed keys (`avg_execution_time_sec`
and per-row `execution_time_sec`). Pre-existing silent data loss: average
time line never rendered, per-query exec time always "-". Auto-pick from
the prior commit routes more users through these formatters, expanding
the impact. Both formatters updated to read the correct keys.
3. Other finops handlers had the same dead-end pattern (Gemini CRITICAL,
Kimi MAJOR). warehouse-advisor.ts (adviseWarehouse), unused-resources.ts
(findUnusedResources), role-access.ts (queryGrants, queryRoleHierarchy,
queryUserRoles) all rewired to use resolveFinopsWarehouse. Their tool
schemas (finops-warehouse-advice, finops-unused-resources, three tools
in finops-role-access) made warehouse optional. Type signatures in
native/types.ts updated to match. role-access uses a SNOWFLAKE_ONLY_TYPES
const for queryRoleHierarchy and queryUserRoles.
4. Case-sensitivity bug (DeepSeek unique catch). The driver lookup in
registry.ts uses toLowerCase() via DRIVER_MAP, so configs with
`type: "Snowflake"` (capitalized) get a working driver — but the
resolver's case-sensitive supportedTypes.includes(match.type) failed
them with a spurious "not available for Snowflake" error. Resolver now
normalizes type via toLowerCase() at every comparison, and the returned
`type` field is the lowercased form so downstream SQL-template selectors
continue to compare against "snowflake" / "bigquery" / "databricks".
Plus two cleanup items from the review:
- Removed unused `sanitizeBqRegion` import from query-history.ts (Claude NIT)
- Added a code comment in the resolver documenting the intentional
warehouse-name disclosure in error messages (resolves the disputed
security concern with the synthesis's rationale)
Test changes
- Added 3 new test cases pinning case-insensitive type matching, including
mixed-case (`type: "Snowflake"`), uppercase (`type: "SNOWFLAKE"`), and
auto-pick filtering with mixed-case types.
- Updated two assertions in schema-finops-dbt.test.ts to match the new
"not configured" error message (replacing the less-accurate old
"not available for X" — the warehouse never existed, regardless of type).
Validation
- `tsgo --noEmit`: pass, zero errors.
- `bun test test/altimate/finops-*`: 124 pass / 0 fail / 67 skip (credential-gated).
- `bun test test/altimate/tool-error-propagation.test.ts test/altimate/simulation-suite.test.ts`: 854 pass / 0 fail.
- Marker check: pass — no upstream-shared files touched.
Expected telemetry impact unchanged from prior commit: error rate on
finops_* tools should drop to operational baseline. With this commit, all
five finops handlers benefit, not just the two from the original PR. The
formatter fix recovers two display values that have been silently broken
for all users since these tools shipped.
Closes review feedback from PR #828 multi-model consensus.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
0 commit comments