agnes-the-ai-analyst/cli
ZdenekSrotyr a43533ca44 fix(cli): #168 review iter 4 — render reason when both kind+reason set
Devin Review iter #4 caught: `_format_dict` in cli/error_render.py
seeded `seen = {"kind", "reason"}` to keep both out of the kv block.
But the label line uses only ONE of them (`kind or reason or "error"`),
so the other was silently dropped.

Quota rejections at app/api/query.py:423 (daily-budget) and 488
(concurrent-slot) emit BOTH keys: `{reason: "daily_byte_cap_exceeded",
kind: "daily_bytes", ...}` and `{reason: "concurrent_slot_exceeded",
kind: "concurrent_scans", ...}`. Operator only saw `kind` in the label
and never the more specific `reason` value.

Fix: track which key actually went into the label and skip only that
one. The other appears in the kv section.

Verified output:
  Error: daily_bytes (HTTP 429)
    reason: daily_byte_cap_exceeded
    current: 99999
    ...

8 affected render tests pass.
2026-05-04 14:04:16 +02:00
..
commands feat(cli): #160 shared structured error renderer for BQ-typed responses 2026-05-04 10:31:35 +02:00
skills docs(query): #160 align CLAUDE.md/skills/CHANGELOG with new --remote behavior + cost guardrail 2026-05-04 10:33:06 +02:00
__init__.py feat: add Docker, CLI tool, scheduler, and agent skills 2026-03-27 15:30:03 +01:00
client.py release(2.1.0): durable sync, CLI auto-update, versioned wheel URL, version unification (#43) 2026-04-22 21:18:18 +02:00
config.py feat(rbac): drop dataset_permissions + users.role + is_public; v19 migration (#150) 2026-04-30 22:02:16 +02:00
error_render.py fix(cli): #168 review iter 4 — render reason when both kind+reason set 2026-05-04 14:04:16 +02:00
main.py feat(v2): claude-driven fetch primitives + 0.14.0 (#102) 2026-04-29 01:07:19 +02:00
snapshot_meta.py feat(v2): claude-driven fetch primitives + 0.14.0 (#102) 2026-04-29 01:07:19 +02:00
update_check.py release(2.1.0): durable sync, CLI auto-update, versioned wheel URL, version unification (#43) 2026-04-22 21:18:18 +02:00
v2_client.py feat(cli): #160 shared structured error renderer for BQ-typed responses 2026-05-04 10:31:35 +02:00