Skip to content

Retry Groq tool_use_failed and harden error body parsing - #2

Merged
CodewithJha merged 2 commits into
mainfrom
fix/groq-tool-use-retry
Jul 31, 2026
Merged

Retry Groq tool_use_failed and harden error body parsing#2
CodewithJha merged 2 commits into
mainfrom
fix/groq-tool-use-retry

Conversation

@CodewithJha

Copy link
Copy Markdown
Owner

Summary

  • Retry HTTP 400 responses that contain Groq tool_use_failed during chat completions (transient malformed tool XML).
  • Harden _peek_http_body so retry classification works with typical urllib HTTPError payloads.

Test plan

  • uv run pytest tests/ (261 passed locally)
  • CI green on this PR

Made with Cursor

Priyanshu Jha added 2 commits July 31, 2026 13:16
Malformed tool XML from the model is transient; retry instead of failing the Action.
Normalize urllib error payloads so Groq 400 retries work reliably in tests and CI.
@github-actions

Copy link
Copy Markdown

LeanCI Review

Findings

No findings above the severity floor.

Cost Receipt

Paritok
Input tokens (Paritok domain) 2140
Est. USD $0.001263
Measured reduction 79.2%

Baseline not run (enable dual_run for comparison).

Expanded 1 files (0 beyond diff), 10501 bytes.

Assumptions: pricing_version=2026-07-30; model=llama-3.3-70b-versatile rates: input $0.59/1M, output $0.79/1M (as_of 2026-07-31); Primary token counts use Paritok /stats domain (content Paritok intervenes in; may exclude unaffected system prompt tokens); Uncompressed dual-run column uses provider usage when available; otherwise estimates from pre-compression token counts; baseline not run (enable dual_run for comparison); cost_per_finding_usd uses max(findings, 1); note: zero findings this run

Metrics artifact: leanci-metrics.json
Powered by Paritok — deep review at lean cost.

@CodewithJha
CodewithJha merged commit d605d24 into main Jul 31, 2026
1 check passed
@CodewithJha
CodewithJha deleted the fix/groq-tool-use-retry branch July 31, 2026 07:49
CodewithJha added a commit that referenced this pull request Jul 31, 2026
Retry Groq tool_use_failed and harden error body parsing
CodewithJha added a commit that referenced this pull request Aug 1, 2026
Retry Groq tool_use_failed and harden error body parsing
CodewithJha added a commit that referenced this pull request Aug 1, 2026
Retry Groq tool_use_failed and harden error body parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant