AltimateAI / AltimateAI/altimate-code

[bug] FinOps tools return zeroed/masked data despite valid ACCOUNT_USAGE access

Đang mở
#203 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug from-cli user-feedback
Ngôn ngữ chính
TypeScript
Star
811
Fork
134
Merge trung bình
3 ngày 2 giờ
Pull request đã merge (30 ngày)
50

Mô tả

### Problem
The FinOps tools (`finops_analyze_credits`, `finops_warehouse_advice`, `finops_expensive_queries`, `finops_unused_resources`) return masked/zeroed data (`unknown` warehouse names, `0.00` credits) even when the connected Snowflake role (ACCOUNTADMIN) has full access to `SNOWFLAKE.ACCOUNT_USAGE` views. The `finops_warehouse_advice` tool also fails with a SQL compilation error: `invalid identifier 'WAREHOUSE_SIZE'`.

### Steps to Reproduce
1. Configure a Snowflake warehouse connection (e.g., `snowflake_sample`) with a role that has ACCOUNT_USAGE access (tested with `ACCOUNTADMIN`).
2. Verify direct SQL access works:
```sql
SELECT COUNT(*) FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE START_TIME >= DATEADD('day', -30, CURRENT_TIMESTAMP());
```
→ Returns `908` rows successfully.
3. Verify the connection identity:
```sql
SELECT CURRENT_ROLE(), CURRENT_USER(), CURRENT_ACCOUNT();
```
→ Returns `ACCOUNTADMIN`, `SAURABH`, `BZB11272`.
4. Call `finops_analyze_credits` with `warehouse: snowflake_sample`, `days: 30`, `limit: 50`.
→ Returns all `unknown` warehouse names and `0.00` credits (13 rows of zeroed data).
5. Call `finops_warehouse_advice` with `warehouse: snowflake_sample`, `days: 30`.
→ Fails with: `000904 (42000): SQL compilation error: error line 3 at position 4 invalid identifier 'WAREHOUSE_SIZE'`.
6. Call `finops_expensive_queries` and `finops_unused_resources` — both return zeroed/empty results.

### Expected Behavior
FinOps tools should return actual credit consumption data matching the direct SQL query results (908 rows of valid metering history data across 13 active warehouses totaling ~230 credits over 30 days).

### Actual Behavior
- `finops_analyze_credits`: Returns masked data (all `unknown` / `0.00`)
- `finops_warehouse_advice`: SQL compilation error on `WAREHOUSE_SIZE` column
- `finops_expensive_queries`: Returns zeroed results
- `finops_unused_resources`: Returns zeroed results

### Workaround
Query `SNOWFLAKE.ACCOUNT_USAGE` views directly via `sql_execute` to get the actual data.

---

### Metadata

| Field | Value |
|-------|-------|
| CLI Version | v0.4.0 |
| Platform | darwin |
| Architecture | arm64 |
| OS Release | 24.6.0 |
| Category | bug |
| Working Directory | ac-examples |
| Session ID | ses_3070d9fdaffeV9OvBpIrq46996 |

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.