Repository navigation
Description
What happened
The implement Job for #2747 (a manual runner Job devops-cli-runner-20261031-194509-b3ab) stopped at group 1 with:
ModelHTTPError: HTTP 400, model devops-coder, body: litellm.BadRequestError: Ollama_chatException - KeyError: <text>, Got unexpected response from Ollama: {<text>: <text>}
Refused commands: cd 2, python 1. Other retries: 0.
The pod log of ollama-48gib (condor) shows the cause twice in 11 seconds:
19:47:38 level=WARN source=qwen3coder.go:87 msg="qwen tool call parsing failed" error="XML syntax error on line 50: unexpected EOF"
19:47:49 level=WARN source=qwen3coder.go:87 msg="qwen tool call parsing failed" error="XML syntax error on line 70: unexpected EOF"
The model wrote a tool call as XML, and the XML stopped before it closed. Ollama's parser for qwen3-coder refused the call and answered with an error, which the gateway turned into HTTP 400. The resend of #2797 ran once (the second line) and failed the same way, so the step stopped and discarded its work. The same error stopped #2656 on 2026-10-30 (#2794 was filed for it; its fix shows the body and resends once, and the first part now hides the real cause, because the masked body text reads <text> for every quoted word, so the stop comment no longer says "XML syntax error").
In both cases the call was a large edit or a new file with code in it. The first success of #2735 and #2739 had small edits.
What should happen
- Find why the call ends early. Check, with evidence: the Ollama version and its release notes and issue list for
qwen3coder.goparse failures; whether the file content (angle brackets,&,]]>, a long line) breaks the parser; whether the model emits EOS inside the call (a sampling setting such asrepeat_penalty,temperatureorstoptokens in the model file); and whetherdevops-chat(qwen3.8) does not fail on the same step. - The stop comment keeps the cause words of a provider error: the masker keeps the exception class and the text up to the first colon-separated clause, and hides only values that look like secrets.
- Fix at the cause: an Ollama update or a model setting, or a fallback of the step to another model route after the second parse failure, or a smaller edit rule in the step prompt. State the choice with the measurement (replay the failing step against each option).
Evidence
- Job
devops-cli-runner-20261031-194509-b3ab, the stop comment on fix(security): the subprocess environment guard accepts the pytest and npm keys that make a child write a file #2747 at 19:47 UTC. - Pod
ollama-48gib-gb2m4log lines above. - fix(roadmap): a model call that Ollama refuses for a broken tool call ends the step with no cause #2794, fix(roadmap): show the 400 body and resend a failed stream once #2797, and the stop on fix(config): devops config unset stops with a TypeError for a key that a YAML merge key gives #2656 on 2026-10-30.
Acceptance criteria
- The proposal names the cause with a reproduction (a prompt that gives the parse failure on demand) or says it is not reproducible.
- The stop comment for this error names "tool call parsing failed" in plain words.
- A replay of fix(security): the subprocess environment guard accepts the pytest and npm keys that make a child write a file #2747's step ends done, or the proposal states why not.
-
uv run devops cipasses.
Proposed design
Problem statement
The implement step stops when Ollama's qwen3-coder parser rejects a tool call with an XML syntax error. The gateway turns the error into HTTP 400 and the masker replaces the cause words with a placeholder. The step discards its work and the stop comment no longer says what failed. This happened on #2747 and #2656, always with large edits or new files that contain code.
Acceptance criteria
Requirement: Cause identification
The proposal SHALL name the root cause of the XML parse failure with a reproduction or state that it is not reproducible.
Scenario: Cause documented in stop comment
- WHEN The implement step encounters a qwen3-coder tool call parse failure
- THEN The stop comment or the proposal names the specific cause with evidence, such as truncated XML, max output tokens, or a parser buffer limit
Requirement: Error cause visibility
The stop comment SHALL preserve the exception class name and the text up to the first colon-separated clause of a provider error.
Scenario: Masker preserves cause words
- WHEN The gateway returns an HTTP 400 with a provider error body that contains an exception class and a cause clause
- THEN The stop comment shows the exception class and the cause clause in plain words, and hides only values that match a secret pattern
Requirement: Step completion
A replay of the failing step SHALL end done, or the proposal SHALL state why it cannot.
Scenario: Replay of #2747 step
- WHEN The implement step for fix(security): the subprocess environment guard accepts the pytest and npm keys that make a child write a file #2747 is replayed with the fix applied
- THEN The step completes and the pull request is opened, or the proposal documents the remaining blocker
Requirement: CI gate
The command uv run devops ci SHALL pass on the branch that delivers this change.
Scenario: CI passes on the fix branch
- WHEN The pull request for this change is opened
- THEN All required checks report a passing status
Existing Tool Considered
No alternatives check has run. The existing tools are Ollama (model server) and LiteLLM (gateway). The fix modifies the project's own error-handling and routing code. The written cost is approximately 400 tokens of Python for the fallback retry loop and 100 tokens for the masker fix, plus the elapsed time to replay the failing step and verify the stop comment.
Key questions
- How should the stop comment preserve the cause of a provider error?: The masker keeps the exception class name and the text up to the first colon-separated clause. It hides only values that look like secrets, such as tokens, keys, or passwords. (proposed)
- Rejected: Keep full error text. May leak secrets in the stop comment.
- Chosen: Keep exception class and first clause, hide secret-looking values. Preserves the cause words while protecting secrets. Stated in the body of fix(roadmap): an implement step stops when Ollama cannot parse a qwen3-coder tool call, and the stop hides the cause #2922.
- Rejected: Replace all quoted text with a placeholder. Hides the cause, as seen in the current behavior that masks the XML syntax error.
- What is the fix strategy for the parse failure?: Add a fallback to another model route after the second parse failure, and fix the error masking. Investigate the Ollama version and model settings as a secondary measure. Replay the failing step against each option to measure the result. (proposed)
- Rejected: Update Ollama. Depends on an upstream release. Does not guarantee the parser handles all large tool calls.
- Rejected: Adjust model settings such as repeat_penalty, temperature, or stop tokens. May reduce the frequency of truncation but does not eliminate it. The model may still truncate a large tool call.
- Chosen: Fallback to another model route after the second parse failure. Resilient regardless of the Ollama version. The step completes with a working model. A standard resilience pattern.
- Rejected: Smaller edit rule in the step prompt. Reduces the chance of truncation but does not handle the case where the model still truncates. Less robust than a fallback.
Open questions
- What causes the qwen3-coder tool call to end before its XML closes? (missing verified source)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 31, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.A recurring production failure blocks implement steps on multiple roadmap items.It prevents implement steps from completing and hides the true cause from operators.Requires investigating Ollama parser, model settings, a possible fallback, and the masker logic.Both address Ollama tool-call parse failures hiding the cause, but #2794 delivered showing the body once, while the candidate asks to keep cause words in the masker and fix the root cause at Ollama or model level.chore(main): release 0.35.0 (#2936)
devops-cli-service commentedon Oct 31, 2026
Refine cannot set this item to Ready at 84c8db0 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
docs(openspec): plan #2949 skip failed alternatives item per round (#…