Repository navigation
Closed
Labels
effort/lowEffort Low: little workpriority/p3-lowPriority P3: a small improvementscope/aiAI review pipeline, personas, prompts, LLM client, or RAGsource/agentFiled by an agenttype/testType test: a new or changed testvalue/lowValue Low: the delivery of the item matters little
Description
Problem or Motivation
Part of #1330. Two small test files outside the hand-rolled agent loop still patch devops_cli internals or import private names. The hand-rolled loop itself goes in #2489, so its tests are not part of this child.
Measured at origin/main 29309f0:
| File | Internal patches | Private imports |
|---|---|---|
tests/ai/harness/test_harness_slots.py |
1: harness.slots.load_settings (line 458) |
2: _evaluate_tiered_status, _summarize_search (line 433) |
tests/ai/agents/test_agent.py |
1: client._ollama_stream_request on an LLMClient instance (line 88) |
0 |
Facts that decide the design:
AgentHarness.execute_tiered(ai/harness/slots.py:761) is the public caller of_evaluate_tiered_statusand_summarize_search. It calls no model. It runs a symbol search, a file scout, or both, and gives the status from their outcomes.- The one
load_settingspatch tests thatdevops ai harness statusshows the configured provider and model. Theconfigfixture (tests/support/config.py) writesai.providerandai.modelinto the test's own config file. test_ollama_stream_400_raises_client_errorintest_agent.pyis a test of the Ollama client. It sits in an agent file.LLMClienttakes anhttpx2transport as a parameter, and the tests intests/ai/client/use it.
The other files of the old list stay out of this child:
test_pipeline_context_budget.py,test_agent_invariants.py,test_ai_agent_deferred_tools.py,test_pydantic_agent.pyandtest_pydantic_ai_exceptions.pytestMultiAgentPipeline,PydanticAgentandrunner.py. refactor(ai): Replace PydanticAgent with pydantic-ai Agent #2489 deletes or rewrites them.- The patches of
investigate_rag_contextin those files go with them. The investigator's own client and embedder wiring is test(ai): Wire rag once in ai/rag, test with edge fakes #1329 criterion 4.
Proposed Solution & Architectural Design
- Harness settings. Replace the
load_settingspatch with theconfigfixture (ai.providerandai.model). Keep the same checks. - Private helpers. Test the partial and failed statuses through
AgentHarness.execute_tiered. Use one repository on which exactly one of the two searches fails. Use another on which both fail. Checkstatusandsummaryof the result. If no public input gives one failing search, delete the case, because no public path reaches the branch (Q22). I did not check which input fails one search. - Misplaced test. Move
test_ollama_stream_400_raises_client_errortotests/ai/client/. It builds theLLMClientwith anhttpx2.MockTransportthat answers HTTP 400, and calls the public streaming method with thinking on. It patches no method of the client and uses noMagicMockresponse.
Acceptance criteria
-
git grep -nE 'patch\("devops_cli\.|monkeypatch\.setattr\("devops_cli\.|patch\.object\(' -- tests/ai/harness/test_harness_slots.pyreturns no line. -
tests/ai/harness/test_harness_slots.pyimports no_-name fromdevops_cli. -
tests/ai/agents/test_agent.pyhas no test of the Ollama client, andtests/ai/client/holds the moved test under the same name. - The moved test fails if the client stops raising
AIClientErrorwith "HTTP 400" for that answer. - Every test that existed before still exists under the same name. Otherwise the pull request body lists it as deleted, with the reason, or as moved, with the new path.
-
uv run devops cipasses. The pull request body gives the patch and private-import counts before and after.
Out of scope: file names and splits (child F), and all tests of PydanticAgent, runner.py and the pipeline (#2489).
Target Subsystem
tests/ai/harness/test_harness_slots.py, tests/ai/agents/test_agent.py, tests/ai/client/.
Existing Tool Considered
No new tool and no new code. The work uses the config fixture of #1310 and httpx2.MockTransport, which the client tests already use.
Metadata
Metadata
Assignees
Labels
effort/lowEffort Low: little workpriority/p3-lowPriority P3: a small improvementscope/aiAI review pipeline, personas, prompts, LLM client, or RAGsource/agentFiled by an agenttype/testType test: a new or changed testvalue/lowValue Low: the delivery of the item matters little
Activity
dan-petty commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(ai)scope of the title gives the scope.Test cleanup with no user-facing impact; part of a broader tracker but not blocking.Improves test maintainability but has no direct effect on end users.Two small test files with three specific, well-scoped changes: one patch replacement, one public-API rewrite, one test move.Both test AI modules through public interfaces, but #1331 covers other ai/ subpackages while this candidate fixes harness slot and agent test files.test(ai): harness slot tests use the public interface (#3853)