Repository navigation
Description
Problem
A refused alternatives check does not show its cause. The alternatives job refused 12 of 76 checks on 2026-11-18, against 6 a day on 2026-11-16 and 2026-11-17. Reason url (the reply cites a URL that the run did not find or fetch) gave 9 of the 12. A person cannot see which URL the reply cited:
- The result line of a refused check reports
searches=0 returns=0, but_refusal_reasoninsrc/devops_cli/roadmap/alternatives.pyreturnsurlorno_factsonly after the run made a search. The counts on the line are wrong. - No log line holds the refusal text with the URL. The job record keeps only
alternatives.failed_reason.
Evidence
Loki, 2026-11-18 21:27 to 21:51 UTC: six refused checks (#5013, #6324, #4147, #4368, #4407, #4414), each with searches=0 returns=0. Checks between them made 2 to 10 searches, so search worked.
Four of the five url refusals in that window are re-checks: the body already holds an earlier alternatives result with sources (#4147, #4368 and #4414 from 2026-11-10 to 2026-11-11). A possible cause is that the model cites a source of the earlier result without a new search or fetch. #6324 had no earlier result, so this cause does not explain every refusal.
Expected
- The result line of a refused check gives the true count of searches.
- A log line of a refused check names the refused URL, so that the cause can be measured.
- When the data shows the cause, fix it at its source in the same item or a follow-up.
Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches found only general LLM observability platforms, Logfire and OpenInference; neither computes the alternatives job's refusal reason, reports its true search count or logs the refused URL, so the fix belongs in the project's own code.
Covers:
- Tracing of model and tool calls
- Spans that carry tool arguments and outputs
- Counts of traced tool invocations
Lacks:
- No alternatives refusal reason or refusal text
- No true search count on the result line
- No log line naming the refused URL
Proposed design
Problem statement
A refused alternatives check hides its cause. The result line reports zero searches after the run made a search. No log line names the refused URL. This item reports the true count of answered searches and logs each refused URL at WARNING. A follow-up fixes the cause when the new log line shows it.
Acceptance criteria
Requirement: Refused check reports its search count
The alternatives job SHALL report the answered search count of a refused check on its result line.
Scenario: Refused check after two answered searches
- WHEN A reply is refused with reason url after the run made two answered searches.
- THEN The result line holds searches=2; the test in tests/roadmap/test_roadmap_alternatives_job_result.py asserts the value.
Requirement: Only answered searches count
The alternatives job MUST count only searches that a provider answered in the refused check's count.
Scenario: One answered and one unanswered search
- WHEN A run makes one search that no provider answers and one search that a provider answers, then refuses the reply.
- THEN The result line holds searches=1; the test asserts the value.
Requirement: Refused URL is in the warning log
The alternatives job SHALL log each refused URL of a url refusal at WARNING with the item number and the reason code.
Scenario: A reply cites a URL that no tool returned
- WHEN A reply cites
https://example.com/tooland no tool returned that URL. - THEN The log holds a WARNING line with the item number, url and
https://example.com/tool; the test asserts the line with caplog.
Requirement: Failure record carries the search count
A refused check SHALL keep its answered search count in its failure record.
Scenario: The job records a refused check
- WHEN The job records a refused check after two answered searches.
- THEN The CheckFailure holds the count 2; the test asserts the field.
Existing Tool Considered
The alternatives check of 2026-11-19 in the issue body records verdict none and no tool. No open, maintained tool covers the need, so the change stays in the project's own code. Estimated cost: about 20k to 40k tokens to build, keep and fix, and about 2 to 4 hours of elapsed work.
Key questions
- Which search count is true on the result line of a refused check?: The number of answered searches in AlternativesTools.searches. The module records a search only when a provider answers it. The search_calls counter counts attempts, so it is not the true count. (best practice) [sources: src/devops_cli/roadmap/alternatives.py]
- Chosen: Answered searches. The module records a search only when a provider answers it.
- Rejected: Search attempts. It counts refused or unanswered queries, so it is not the true count.
- Rejected: Search results. It counts result URLs, not searches.
- Where should the job keep the search count for a refused check?: Add a searches field to CheckFailure and set it from len(tools.searches) when the job makes the failure. The result line reads that field. CheckFailure already carries the reason code and band to the result line. (best practice) [sources: src/devops_cli/roadmap/alternatives.py, src/devops_cli/roadmap/job_result.py]
- Chosen: Field on CheckFailure. The failure record is the object that reaches the result line, so the count stays with the reason.
- Rejected: Recompute at log time. The tools object is local to the check and the result line runs after the check returns.
- Rejected: Separate map. It duplicates state that the failure record can hold.
- What log line names the refused URL?: When _refusal_reason returns url, log at WARNING with the item number, the reason code url, and each refused URL. A no_facts refusal logs no URL. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:846]
- Chosen: WARNING with item, code and URL. The refusal point knows the URL, and the line gives the cause that the issue cannot measure now.
- Rejected: Log the full reply. It can hold the whole model text and adds noise.
- Rejected: Log only the reason code. It does not name the URL, so the cause stays unmeasured.
- Should this item fix the source of the refusal?: No. The evidence only suspects the cause, and fix(roadmap): The stage eval report names why each case ended #6324 does not fit it. This item adds the count and the URL log. A follow-up fixes the cause when the new log line shows it. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:846, tests/roadmap/test_roadmap_alternatives_recheck.py]
- Chosen: Defer the cause fix to a follow-up. The issue allows a follow-up, and the data does not show the cause yet.
- Rejected: Fix the suspected earlier-source cause now. It does not explain fix(roadmap): The stage eval report names why each case ended #6324, so the fix can be wrong.
- Rejected: Wait for the data before any change. The count and the log are workable now and give the data.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
Both deal with refused alternatives replies, but #4864 adds a one-time retry mechanism while the candidate adds diagnostic logging and fixes wrong search counts on the refusal line.devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (7)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 19, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
devops-cli-service commentedon Nov 20, 2026
Released in v0.185.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.185.2
devops-cli-service commentedon Nov 21, 2026
Live since 2026-11-21 00:01 UTC
fix(roadmap): fix the cause of a refused alternatives check (#6617)