Skip to content

fix(roadmap): show the 400 body and resend a failed stream once - #2797

Merged
dan-petty merged 8 commits into
mainfrom
fix/2794-model-400-body-and-retry
Oct 30, 2026
Merged

dan-petty merged 8 commits into
mainfrom
fix/2794-model-400-body-and-retry

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A step now shows why the provider refused a model call, and it sends a request again once when the provider fails it inside an open stream.

  • The stop reason of a failed model call holds the error text of the body of the answer. It keeps the first line, hides quoted text, and stops at the first = or ;, so an echo of the model output stays out.
  • A ModelHTTPError with the status 400 inside an open stream (not a context window error) is sent again with the same history, at most CONST_ROADMAP_IMPLEMENT_MODEL_RESENDS times in a row. A send that gets a reply gives the next failed request its own resends.
  • The failed request counts in the request limit of the step.
  • One call gets at most (1 + ai.max_retries) * (1 + CONST_ROADMAP_IMPLEMENT_MODEL_RESENDS) sends.

Closes #2794

The budget of a resend counted for the whole turn. A second failure later in the same turn found it used and stopped the step. A send that gets a reply now gives the next failed request its own resend. The failed request counts in the usage that the resend carries, so the model gets no more requests than the limit.
…ody (#2794)

A provider can echo the output of the model in its error text. The reason of a stop is public text, and the masker finds a secret only by its form. The error text of a body now keeps its first line, hides quoted text, and stops at the first equals sign or semicolon, as the reason of other errors does. The comment of the resend limit states the real bound on the sends of one call.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Oct 30, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results

  • Full uv run devops ci passed. The test check took 229 s (3m 49s).
  • uv run devops ci fail-to-pass --base origin/main: 18 tests of tests/test_roadmap_implement_step.py fail on base and pass on head (102 pass on both).

Review findings fixed

Residual risk

  • A secret in the first line, before any quote, = or ;, and with no known form, still passes the masker. The diff in the same stop comment has the same masker. I did not add a new scanner (gitleaks runs as a sandboxed tool, not on a string).

…dy-and-retry

# Conflicts:
#	openspec/specs/roadmap-implement-step/spec.md
@dan-petty
dan-petty marked this pull request as ready for review October 30, 2026 19:58
@dan-petty
dan-petty merged commit 034aa0e into main Oct 30, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2794-model-400-body-and-retry branch October 30, 2026 20:00
dan-petty pushed a commit that referenced this pull request Oct 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.22.7](v0.22.6...v0.22.7)
(2026-10-30)


### Bug Fixes

* **roadmap:** a failed ruff or mypy check gets one repair turn
([#2796](#2796))
([77e7f7c](77e7f7c)),
closes [#2795](#2795)
* **roadmap:** show the 400 body and resend a failed stream once
([#2797](#2797))
([034aa0e](034aa0e)),
closes [#2794](#2794)

---
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/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them 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(roadmap): a model call that Ollama refuses for a broken tool call ends the step with no cause

1 participant