Repository navigation
Closed
Labels
scope/reviewMulti-persona code review engine, verification, and findingssource/agentFiled by an agenttype/bugType bug: the code does not do what it must
Description
Problem
Checked at release/v0.2.29 (05e9388). --dry-run must send nothing and return the requests a real run would send (#412). The review's preview, _llm_request_preview (ai/review/runner.py:165-226), is a separate hand-written copy of each provider's request, and it no longer matches what the client sends:
- claude:
getattr(config, "api_base_url", "https://api.anthropic.com")returnsNone, because the field exists and is unset, so the previewed endpoint isNone/v1/messages(:187-189). - gateway: the provider falls into the OpenAI branch with an empty base, so the previewed endpoint is
/chat/completions(:206-213). - openai: the preview shows
https://api.openai.com/v1/chat/completions, while the client posts without/v1(the OpenAI base-URL item filed from the same audit). - ollama: the preview falls back to a localhost Ollama URL when none is configured (
:150,:171), which fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165 forbids. - all providers: the previewed body omits
max_tokens, thinking, sampling and Ollamaoptions, which the client sends.
Proposed remedy
- Build the preview by running the client's own request path against a recording transport: an httpx2
MockTransportthat records the request and sends nothing. The preview is then the request. Authorization and API-key headers are masked withmask_secrets. - Delete the per-provider branches of
_llm_request_previewand the localhost fallback in_resolve_ollama_urls. - The recording transport is installed through refactor(cli): Unify HTTP and DNS seams with shared fakes #1314's hook or refactor(ai): one model seam: llmclient over three wire adapters behind one factory, no second provider stack #1001's client factory, whichever lands first.
Acceptance criteria
- For providers
ollama,claude,openai,copilotandgateway, with base URLs underhttps://example.com, the dry-run preview equals the request a real call records through the HTTP edge fake: method, URL and body, with credentials masked. Theclaudeandgatewayrows fail on the current code. - The dry run opens no socket; test(cli): the hermetic floor fails a test that reaches an edge without a fake and resets all process-wide state after every test #1310's floor fails the test otherwise.
- With no Ollama URL configured, the dry run reports the missing setting instead of previewing a localhost URL.
- Tests run offline, with fakes only at the HTTP edge (an httpx2
MockTransport, throughtests/llm_stream_fakes.route_clientor refactor(cli): Unify HTTP and DNS seams with shared fakes #1314's fixture) or the process edge. No test patches a devops_cli name. - Each new or changed test runs in under 1 s.
-
uv run devops cipasses.
Related: #412, #886, #1001, #1314, #1165
Found by the 2026-10-08 client-library audit.
Opened as a borrow (#1153, budget/borrowed): the agent filing quota is spent for this cycle, and this is a defect or security finding of the owner-requested 2026-10-08 client-library audit.
Metadata
Metadata
Assignees
Labels
scope/reviewMulti-persona code review engine, verification, and findingssource/agentFiled by an agenttype/bugType bug: the code does not do what it must
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
It misleads users about what a real run would send, but only affects a diagnostic preview and does not break production runs.Users relying on dry-run to verify provider configuration or request shape receive wrong endpoints and incomplete bodies, undermining the feature's purpose.Requires wiring a MockTransport recording path through the client, deleting per-provider preview branches, handling secret masking, and adding offline tests across five providers.dan-petty commentedon Oct 20, 2026
Friction
devops review path --dry-runstarts a realgh auth token, and in tests that gh reaches the developer's real D-Bus session bus. A dry run should make no requests, and no test may start a real gh.Evidence
tests/test_cli_startup_imports.py::test_cli_dry_run_imports_only_plan_dependencies[review], the test's childdevops review path --dry-runrunsgh auth token. That happens on the first git call, from_lookup_github_tokeninsrc/devops_cli/core/process.py.subprocess.Popendoesn't see it./run/user/1000/bus, the real session bus where gnome-keyring holds secrets, although the test floor'sisolate_session_busis in place. gh gets a minimal environment withoutXDG_RUNTIME_DIRand falls back to the default bus path.ctypes.util.find_librarylooks for macOS frameworks on Linux.Remedy
Acceptance criteria
devops review path --dry-runstarts no gh. A spawn probe of the child process tree shows it.uv run devops cipasses.fix(roadmap): intake calls a candidate a duplicate only when it asks …