Repository navigation
Description
Refreshed plan (2026-10-17, unblocking review)
This section supersedes any text below that conflicts with it.
Decisions
- Decision D17 (owner, 2026-10-17): "feat(ai): gpt-oss reasoning effort for group analysis is measured and set on its gateway deployments #479 stays, re-scoped to gpt-oss reasoning effort for group analysis with a close-if-unused condition, after fix(ai): reasoning request parameters follow the model's declared capability, not its name #888 and refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001; any reply cap after fix(review): a group-analysis reply cut at its token cap is rejected, not shown as a checked explanation #876." This withdraws the 2026-10-03 plan to move this item's values into fix(ai): reasoning request parameters follow the model's declared capability, not its name #888 and fix(ai): sampling settings reach the model or are refused, review sessions record them, and the reply cache key includes them #1070 and then close it.
- Close if unused: when the item is picked up, the owner states on the issue whether reviews route group analysis (
ai.tasks.analysis.model) to a group with a gpt-oss deployment (devops-revieworgpt-oss:20b). If not, the item closes as not planned with that note, with no measurement and no config change. Reason: tuning a deployment that group analysis never reaches buys nothing, and on 2026-10-17 the owner's runtime config pins analysis toqwen3-coder:30b. - Close if no gain: if low and medium effort give report-stage wall time within the range of each other's three runs, the item closes with the figures and no config change. Reason: speed is the only gain this item claims.
- The value goes on the gpt-oss gateway deployments, the same on the
devops-reviewone and thegpt-oss:20bpin, not in a client default. Reason: fix(ai): reasoning request parameters follow the model's declared capability, not its name #888's proposed mixed-group rule givesdevops-reviewstandard parameters, so only the deployment reaches gpt-oss in the pool, and the pin must behave as the pool does. If fix(ai): reasoning request parameters follow the model's declared capability, not its name #888 lands a different rule, the value goes where that rule sends gpt-oss's effort, under the same test. - The chosen effort is the lowest whose verified-group count stays within the range of medium's three runs. Reason: a faster setting must not cost checked explanations.
- No reply cap unless the measurement shows report-stage
lengthreplies or runaway completions. Reason: group analysis sends no cap today, so gpt-oss reasoning costs time, not cuts; a cap would create cuts, so it lands only after fix(review): a group-analysis reply cut at its token cap is rejected, not shown as a checked explanation #876 rejects them. - Retitled to match the re-scope.
Scope
- Delivers: a measured
reasoning_effortfor gpt-oss:20b on group analysis, the report stage's one model call per finding group, set on the gpt-oss gateway deployments; or closure under one of the two conditions above with the figures recorded. - Dropped: every verifier figure and criterion (the verifier went with refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150;
ai/review/verification.pyno longer exists) and every persona figure (refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 deletes the persona stage and its 8,192 reply cap). The S2 to S8 and S10 tables below are history only. - Elsewhere: cut group-analysis replies are fix(review): a group-analysis reply cut at its token cap is rejected, not shown as a checked explanation #876's; capability-based reasoning parameters are fix(ai): reasoning request parameters follow the model's declared capability, not its name #888's and refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001's; recording effort and the reply cap per task in profile.json is fix(ai): sampling settings reach the model or are refused, review sessions record them, and the reply cache key includes them #1070's; reasoning-token counts are feat(cli): reasoning-token share in the spend ledger and provider-reported stream usage #591's.
Delivery
- Person-run, no PR: the close-if-unused check, then three
--no-cachebranch reviews of one branch for each setting:gpt-oss:20bat low,gpt-oss:20bat medium, andqwen3-coder:30bas the control. Effort is set per run withai.tasks.analysis.reasoning_effort, which reaches a gpt-oss pin once fix(ai): reasoning request parameters follow the model's declared capability, not its name #888 and refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001 have landed. - Closes feat(ai): gpt-oss reasoning effort for group analysis is measured and set on its gateway deployments #479. Feasibility first, recorded in the task file: LiteLLM v1.103.0 passes a deployment-level
reasoning_efforttoollama_chat(Ollama's think level) and does not drop it underdrop_params: true, and whether a request's ownreasoning_effortoverrides it. Also recorded: whether the client, after fix(ai): reasoning request parameters follow the model's declared capability, not its name #888 and refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001, sends thegpt-oss:20bpin an effort when neitherai.tasks.analysis.reasoning_effortnorai.reasoning_effortis set. A task inherits the global value (src/devops_cli/config/settings.py:543-568), and today's reasoning branch falls back tomedium(src/devops_cli/ai/client/openai.py:65). If the value does not pass through, or the client always sends the pin an effort that overrides the deployment's so the pin cannot behave as the pool does, stop and comment the evidence on the issue instead of adding code.
Acceptance criteria
- (person-run) The close-if-unused answer is on the issue before any measurement.
- (person-run) The issue gets one row per run: report-stage
llm_calls,completion_tokens,wall_seconds,finish_reasonsandtruncatedby backend from profile.json; verified and rejected groups andrejectionsfrom analysis.json; reasoning share from feat(cli): reasoning-token share in the spend ledger and provider-reported stream usage #591's count, or "unmeasured" if feat(cli): reasoning-token share in the spend ledger and provider-reported stream usage #591 has not landed. - Both gpt-oss deployments carry the same chosen
reasoning_effort, the qwen3-coder deployments carry none, and an offline test pins the value. The pinned-group test still shows thegpt-oss:20bgroup copying the pool's gpt-oss deployment, now includingreasoning_effort. - Any reply cap this item sets lands after fix(review): a group-analysis reply cut at its token cap is rejected, not shown as a checked explanation #876 and is pinned by the same test. In the post-deploy review, fewer than 5% of gpt-oss report-stage replies end with
length(the issue's 2026-10-02 threshold), and the verified-group count stays within the range of medium's three runs. - Tests run offline: no network, gateway or model.
-
uv run devops cipasses. - (person-run) After the config is deployed, one
--no-cachereview pinned togpt-oss:20b, with neitherai.tasks.analysis.reasoning_effortnorai.reasoning_effortset, gives report-stage completion tokens and wall time within the chosen setting's measured range, showing the gateway applies the value.
Current references (at 3dd7fa6)
- Group-analysis call, with no reply cap and no reasoning parameter:
src/devops_cli/review/analysis.py:700-706; run fromsrc/devops_cli/ai/review/pipeline.py:4191-4218(only with personas until refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 PR 1,:4198), in the report stage atsrc/devops_cli/ai/review/runner.py:1070-1071; client fromai.for_task("analysis")atrunner.py:469. - analysis.json:
src/devops_cli/review/analysis.py:185-210. profile.json stage fields:src/devops_cli/ai/review/profile.py:88-103, filled at:240-267. - gpt-oss gets standard parameters by name today:
src/devops_cli/ai/client/models.py:259-268, lists atsrc/devops_cli/config/constants.py:2132-2148, branch atsrc/devops_cli/ai/client/openai.py:106-109(reasoning branch:61-69, which falls back tomediumat:65when no effort is configured). - Reply limit:
src/devops_cli/ai/client/base.py:137-142;max_tokensunset by default atsrc/devops_cli/config/settings.py:432and:466;reasoning_effortper task at:427, global at:461, which a task inherits when its own is unset (for_task,:543-568). - gpt-oss deployments:
k8s/llm/gateway/configmap.yaml:86-90(devops-review) and:106-110(gpt-oss:20bpin);drop_params: trueat:156; LiteLLM image pin atk8s/llm/gateway/deployment.yaml:32. - Pinned-group test:
tests/test_k8s_llm_gateway.py:250-292, whose allowedlitellm_paramskeys are at:288. devops-reviewis also the gateway tune's default group (src/devops_cli/config/defaults.py:105), so a deployment-level value changes the tune's gpt-oss calls too.
Dependencies and order
- fix(ai): reasoning request parameters follow the model's declared capability, not its name #888 (open, v0.2.37): hard. Until it lands, the client never sends gpt-oss an effort, and it settles the mixed-group rule that decides where the value goes.
- refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001 (open, v0.2.37): hard. It rebuilds the client on pydantic-ai models with effort from model settings, replacing the
openai.pybranch above. - fix(review): a group-analysis reply cut at its token cap is rejected, not shown as a checked explanation #876 (open, v0.2.37): only before a reply cap.
- feat(cli): reasoning-token share in the spend ledger and provider-reported stream usage #591 (open, v0.2.38): soft; without it the reasoning share is "unmeasured".
- refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 (open, v0.2.38): soft; measure after its PR 1 if it has landed, otherwise note that persona calls shared the tier (report-stage figures stay separate in profile.json).
- feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's freeze no longer covers this item: the verifier is gone (refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150, closed in v0.2.33), and group analysis (feat(review): each finding group gets a model-written explanation and plan grounded in the rule's documentation at the installed tool version, kept apart from findings, with every quote, citation, version and code block checked #1147, closed in v0.2.36) is the explanation stage. feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's frozen list drops feat(ai): gpt-oss reasoning effort for group analysis is measured and set on its gateway deployments #479.
- fix(ai): sampling settings reach the model or are refused, review sessions record them, and the reply cache key includes them #1070 (open, no milestone): related, not a blocker.
- Priority stays P3, with no milestone. A person plans the milestone on the board.
Context & Rationale
In the tuner's cost pass, gpt-oss 20B spends its whole 200-token budget, much of it on reasoning, where the Qwen models answer in about 120 tokens. Reasoning effort is not set per deployment. The Ollama nodes may be spending serial time on reasoning a review does not need, or cutting findings short when the budget is too small.
Scope & Deliverables
- Context & Rationale*: In the tuner's cost pass, gpt-oss 20B spends its whole 200-token budget, much of it on reasoning, where the Qwen models answer in about 120 tokens. Reasoning effort is not set per deployment. The Ollama nodes may be spending serial time on reasoning a review does not need, or cutting findings short when the budget is too small.
- Deliverable*: Measure findings and verification outcomes against reasoning effort (low, medium) and completion budget for each reasoning deployment. Set
reasoning_effortandmax_tokensper deployment in the gateway.
Strategic Alignment
Scope added 2026-10-02: branch reviews of release/v0.2.25 show gpt-oss:20b running out of its reply budget, mostly in verification. In sessions 20261002-163203 and 20261002-180320, 39 of 76 verification calls served by gpt-oss ended with finish reason length (17 of 35, 22 of 41). In 20261002-200610 it was 31 of 58. None of 133 qwen3-coder verification calls did. The source is profile.json stages[].truncated and backends; ollama-16gib and ollama-24gib serve gpt-oss (k8s/llm/gateway/configmap.yaml:99-108). The verifier's cap is min(8,192, 2,048 + 384 per finding) (ai/review/verification.py:1959-1965), and reasoning counts against it. devops-review gets no reasoning_effort, because is_reasoning_model decides by name (ai/client/models.py:236-245, used at ai/client/openai.py:101-104). #888 owns that part. A cut verifier reply binds a verdict only if json_repair salvages part of its JSON (core/serialization.py:76-82). Otherwise its findings stay UNVERIFIED with no note (verification.py:2133-2140). It is not cached either (ai/client/unified.py:626), so the next run pays for it again. The release review evaluation counts 40 of 76 and 42 of 92 reported UNVERIFIED findings in files with no complete verifier reply. It also found that verdicts changed 68% of the time when the other model verified. Persona replies were cut 5 times in the same sessions, all on gpt-oss (#876).
- (person-run) One branch review of at least 50 changed files after the change has fewer than 5% of gpt-oss verification replies ending with
length. The figures go on the issue next to the ones above. - An offline test pins the chosen
reasoning_effortand reply budget for gpt-oss where this item sets them: the gpt-oss deployments ink8s/llm/gateway/configmap.yaml, or the client defaults if the client keeps sending the cap.
Scope added 2026-10-03 from review sessions 20261003-005122 (S7, at b6847e9) and 20261003-012555 (S8, at 0ce4736) (.data/review-evaluation-20261003-s7-s8.md, sections 3, 6 and 7). Lines are at da50329. gpt-oss:20b still runs out of its verifier budget, and qwen3-coder:30b never does. In S7 and S8, 9 of the 20 verifier calls gpt-oss served ended with finish reason length (5 of 8, then 4 of 12). qwen3-coder: 0 of 33. Across S2 to S8 it is 86 of 169 against 0 of 183. The grooming note of 2026-10-02 lowered this item to p3 because no defect had been measured. S2 to S8 now measure one.
All 9 cuts were on ollama-16gib-fast, and each stopped at exactly its cap: 2,048 + 384 per finding, at most 8,192, reasoning included (_verification_reply_cap, src/devops_cli/ai/review/verification.py:2109-2115; src/devops_cli/config/defaults.py:399-401). The ledger rows are the cases:
| Session | Ledger row | File | Findings | Cap, all used | Prompt tokens |
|---|---|---|---|---|---|
| S7 | 9991 | k8s/monitoring/service-aliases.yaml | 4 | 3,584 | 6,651 |
| S7 | 9992 | src/devops_cli/ai/mcp/server.py | 2 | 2,816 | 42,240 |
| S7 | 10006 | src/devops_cli/commands/ci.py | 1 | 2,432 | 21,336 |
| S7 | 10007 | src/devops_cli/config/settings.py | 2 | 2,816 | 21,922 |
| S7 | 10008 | tests/test_all_commands_help_dryrun.py | 1 | 2,432 | 10,351 |
| S8 | 10048 | src/devops_cli/commands/ci.py | 1 | 2,432 | 21,337 |
| S8 | 10051, 10055 | src/devops_cli/ai/rag/indexer.py and tests/test_rag_multi_project_indexer.py (the ledger does not say which is which) | 1 each | 2,432 | 16,866 and 11,622 |
| S8 | 10064 | src/devops_cli/ai/spend/pricing.py | 4 | 3,584 | 16,751 |
The ledger has no file column. Rows are matched to the cut findings by finding count (the cap), and otherwise by prompt size. server.py's call is the largest verifier call in each session. ci.py is the only single-finding cut in both runs, and only 10006 and 10048 match across them (21,336 and 21,337 tokens).
- The 9 calls used 169,076 prompt and 24,960 completion tokens, and 1,189 s of call time (summed over parallel calls), for no verdict.
- They left 17 findings UNVERIFIED (10 and 7). Row 10064 was the call for S8's only 2 valid findings (pricing.py:55 and :65, lenient label).
- 9 of the 16 S7-to-S8 status changes involve a gpt-oss cut on one side.
- 5 of the 9 cuts were single-finding calls at the 2,432 floor. The 11 complete gpt-oss verifier replies in S7 and S8 are cached with their reasoning. Reasoning is 63% to 87% of each reply's characters (median 82%, characters, not tokens). Complete gpt-oss replies take a median of 1,415 completion tokens on 16gib-fast, against 338 for qwen3-coder. So the budget goes to reasoning, not to the answer [inference].
Changed since the 2026-10-02 scope: a cut reply no longer binds any verdict. Since #846 the cut branch returns before parsing and notes each finding verifier-reply-cut (verification.py:2293-2297), 17 of 17 in S7 and S8. The sentence above about a salvaged verdict and "UNVERIFIED with no note" no longer holds.
- (person-run) The before-and-after table starts from the 9 cut calls above. After the change, a branch review with
--no-cachethat verifies the same 8 files gives, for each verifier call gpt-oss serves, the finish reason, the completion tokens and the reasoning share. A cut reply is not cached (src/devops_cli/ai/client/unified.py:626), so its reasoning share comes from feat(cli): reasoning-token share in the spend ledger and provider-reported stream usage #591's reasoning-token count once that lands, or is listed as unmeasured. A file the gateway routes to qwen3-coder is listed as not exercised. - (person-run) In that review, no gpt-oss verifier call over one finding ends with
length. - (person-run) The table also gives VERIFIED and INVALIDATED counts per model, so a budget change is not judged by the cut rate alone.
Key question added: Should verification be pinned to qwen3-coder instead, since it never cut? (proposed) No, not as a precision fix [judgment, from the evaluation]. qwen3-coder gave 15 of the 19 VERIFIED verdicts in S7 and S8, and none is strictly valid: 13 are false and 2 are the overrated pricing excepts. 2 of S8's top 8 report rows are qwen3-coder confirmations whose own reason refutes the claim: workspace.py:43 (cache llm_6818ef36…, row 10050) and main.py:84 (llm_f3d7fc26…, row 10067). Since #948 ranks VERIFIED first, a false confirmation costs more than a cut, which leaves the finding UNVERIFIED with a note. With the gateway config of S7 and S8, a pin would also send verification to 48gib-slow, which took 160.8 s for 12,994 prompt tokens (row 10065). False confirmations need the evaluation's sketch A, added to #845 on 2026-10-03 (a confirmation whose reason refutes the claim is not applied), and #770 (a syntax claim judged by parsing). This item stays the fix for the cuts. #962's per-model baseline is closed, and a pin is a routing decision, not an issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
docs(roadmap): plan LLM tuning and optimization work for v0.2.23 (#483)
feat(release): v0.2.23 (#681)
dan-petty commentedon Oct 1, 2026
Moved from the shipped v0.2.23 to the backlog. It is still valid (checked 2026-10-01), and P2 items don't displace P1 work in the planned releases.
dan-petty commentedon Oct 2, 2026
Grooming (2026-10-02): Priority p2-medium → p3-low. Speculative tuning ('may be spending… or cutting short'). No defect has been measured in real reviews.
Checked against the code at the release/v0.2.25 tip.
dan-petty commentedon Oct 3, 2026
What S10 adds (review session
20261003-034353, release/v0.2.25 at d6ebe97;.data/review-evaluation-20261003-s10.md, section 3). These are cuts measured in a real review, which the 2026-10-02 grooming note said were missing.gpt-oss:20b (16gib-fast) was cut on 2 of its 3 fresh verifier calls, each at exactly the per-finding cap. The cap is
min(8192, 2048 + 384 × n)(_verification_reply_cap,verification.py:2109; constants atdefaults.py:399-401).test_security_bandit.py:107, which was also cut in S9.qwen3-coder was cut on 0 of its 6 calls. Over the evaluated sessions the tally is about 91 of 177 gpt-oss verifier calls cut, against 0 of 197 for qwen [estimate].
dan-petty commentedon Oct 3, 2026
Frozen by the evidence-first review redesign (#1137, owner direction of 2026-10-03): patches to the model generator and verifier stop, and tool-layer fixes continue. The review pool's reasoning budget goes with #1151. Before this item closes, its per-deployment
reasoning_effortandmax_tokensin the gateway move to #888 (reasoning parameters follow declared capability) and #1070 (sampling settings), because chat and analysis keep them. It stays open, labelledstatus/blocked, until then.dan-petty commentedon Oct 8, 2026
Linked: #590 and #591 (frozen item, link only). Reasoning text is split by hand-written tag state machines and never counted; #591 keeps estimated rows out of this item's comparison. Found by the 2026-10-08 backlog review.
[-]feat(ai): reasoning budget tuning for the review pool[/-][+]feat(ai): gpt-oss reasoning effort for group analysis is measured and set on its gateway deployments[/+]dan-petty commentedon Oct 24, 2026
The feasibility check fails against the codebase.
The client always sends reasoning effort to the pinned model. In
src/devops_cli/ai/client/openai.py:86, the code falls back tomediumwhen reasoning effort is unset. The gateway deploymentgpt-oss:20bdeclaressupports_reasoning: true. Therefore, the client addspayload["reasoning_effort"] = "medium"to each request.This request parameter overrides the deployment configuration in the gateway. The mixed group
devops-reviewsends no reasoning parameter because qwen3-coder does not reason. Thus, the pin cannot behave as the pool behaves.In addition, the issue lacks the required person-run input. The owner has not recorded whether reviews route group analysis to a gpt-oss deployment. The runtime configuration still sets
ai.tasks.analysis.modeltoqwen3-coder:30b. The issue also has no measurement figures to select an effort.Per the delivery instructions and Rule 2, this item returns to New.
dan-petty commentedon Oct 24, 2026
Closed as not planned under the close-if-unused condition of decision D17 in this issue's refreshed plan.
qwen3-coder:30b(ai.tasks.analysis.model, providergateway), checked on 2026-10-24.qwen3-coder:30bhas deployments onollama-48gib-fastandollama-64gib-standardonly, and both runqwen3-coder:30b. No gpt-oss deployment serves it.reasoning_efforton the gpt-oss deployments gives no gain. No measurement and no config change were made.devops-revieworgpt-oss:20blater, open a new item with the measurement plan of this issue.The owner asked on 2026-10-24: "fix #479 or close as invalid".