Skip to content

fix(ai): guard urlsplit in cost report for unparseable backend - #4226

Merged
dan-petty merged 1 commit into
mainfrom
fix/2462-devops-ai-cost-report-shows-a
Nov 9, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/2462-devops-ai-cost-report-shows-a

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Issue #2462 reports that devops ai cost report stops with ValueError: Invalid IPv6 URL when the spend ledger holds a served_by value such as http://[::1. _is_single_server_local in src/devops_cli/ai/spend/pricing.py calls urlsplit(clean) on the stored value with no guard. extract_served_by refuses such a value in a new row, but a ledger row from before that change can hold one. The report must show the row and show its serving backend as unknown.

Closes #2462

Change: openspec/changes/archive/2026-11-09-2462-devops-ai-cost-report-shows-a/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/ai AI review pipeline, personas, prompts, LLM client, or RAG labels Nov 9, 2026
Issue #2462 reports that `devops ai cost report` stops with `ValueError: Invalid IPv6 URL` when the spend ledger holds a served_by value such as `http://[::1`. `_is_single_server_local` in `src/devops_cli/ai/spend/pricing.py` calls `urlsplit(clean)` on the stored value with no guard. `extract_served_by` refuses such a value in a new row, but a ledger row from before that change can hold one. The report must show the row and show its serving backend as `unknown`.

Closes #2462

Change: `openspec/changes/archive/2026-11-09-2462-devops-ai-cost-report-shows-a/`
@dan-petty
dan-petty force-pushed the fix/2462-devops-ai-cost-report-shows-a branch from 9e2025a to 40c2e8c Compare November 9, 2026 13:27
@dan-petty
dan-petty marked this pull request as ready for review November 9, 2026 13:38
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 40c2e8c150538a0fd62c122aa5d078c555ef15e1

Check Conclusion Link
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
CodeQL success run
Plan Check skipped run
Dependency Freshness skipped run
Test Job Duration skipped run
Docs Site Build success run
Tests & Coverage (shard 3 of 4) success run
Changed-Test Independence success run
MCP Server Image success run
Runner Image success run
DevContainer Image success run
Third-Party Image Scan success run
Rule Pack Tests success run
Tests & Coverage (shard 1 of 4) success run
Image Pins success run
Tests & Coverage (shard 4 of 4) success run
Static Analysis success run
Tests & Coverage (shard 2 of 4) success run
Service Image success run
Fail-to-Pass Check success run
Analyze (python) success run
Analyze (actions) success run
Semantic PR title success run

Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/42625717147/job/129188837254

Skipped check: Plan Check
Skipped check: Dependency Freshness
Skipped check: Test Job Duration

@dan-petty
dan-petty merged commit 961f406 into main Nov 9, 2026
26 checks passed
@dan-petty
dan-petty deleted the fix/2462-devops-ai-cost-report-shows-a branch November 9, 2026 13:48
dan-petty pushed a commit that referenced this pull request Nov 9, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.100.2](v0.100.1...v0.100.2)
(2026-11-09)


### Bug Fixes

* **ai:** guard urlsplit in cost report for unparseable backend
([#4226](#4226))
([961f406](961f406))
* **k8s:** list helm repo and upgrade in deploy-stack dry-run
([#4227](#4227))
([09bde83](09bde83))
* **roadmap:** cap the output of a Claude group and name a length stop
([#4224](#4224))
([7e84a13](7e84a13))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ai AI review pipeline, personas, prompts, LLM client, or RAG type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ai): Guard urlsplit in cost report for unparseable backend

1 participant