Skip to content

refactor(ai): remove the agent test switches and test models - #4017

Merged
dan-petty merged 3 commits into
mainfrom
refactor/3757-remove-agent-test-switches-and-test-models
Nov 7, 2026
Merged

dan-petty merged 3 commits into
mainfrom
refactor/3757-remove-agent-test-switches-and-test-models

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The model name test no longer builds a pydantic-ai TestModel inside resolve_pydantic_ai_model. Tests now pass a TestModel instance. The embedding cost test uses the real pricing registry and patches nothing. A new floor test proves that a model call with no model_fake fails at teardown. A new pricing test shows that the provider and the request time decide the cost of a request.

This removes the test branches from product code, as the parent tracker #1307 requires.

Closes #3757
Change: openspec/changes/archive/2026-11-07-3757-remove-agent-test-switches-and-test-models/

The branch built a pydantic-ai TestModel in src for the model name test. Tests pass a TestModel instance instead. The embedding cost test uses the real pricing registry and patches nothing. A floor test proves that a model call with no model_fake fails at teardown.
@dan-petty dan-petty added type/refactor Type refactor: a new structure, same behavior scope/ai AI review pipeline, personas, prompts, LLM client, or RAG labels Nov 7, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test and check results.

  • Focused run after the rebase onto origin/main: tests/ai/agents, the pricing tests and tests/invariants pass (733 passed).
  • Full local devops ci ran before the last review fix, which only wrapped one docstring line. Result: 20794 passed, 2 failed.
    • test_the_replay_as_json_holds_the_totals_of_each_gate hit the 600 s timeout. The host ran other CI jobs at the same time. The test is in tests/roadmap/stage/, outside this change.
    • test_the_decisions_are_cut_by_whole_entries... failed because OpenTelemetry shutdown lines ("Processor is already shutdown") reached the log capture. It passes alone (166 passed in tests/roadmap/test_roadmap_alternatives.py). This change does not touch it.
  • The test row took 28m 50s on a loaded host, over the 5-minute budget. The slowest tests are the roadmap stage eval gates, not tests of this change.

Review findings.

  • Fixed: the long docstring line in resolve_pydantic_ai_model is wrapped.
  • Skipped: exact DeepSeek rates in the new pricing test. The test must show that the request time changes the rate, and the genai-prices data is pinned by the lock file.
  • Skipped: a test for the dropped request_timestamp in EmbeddingResult.cost(). The fallback path runs only when the native super().cost() fails. For such a model the registry has no time-dependent rate, so a test through that path cannot fail on the mutation. I tried it and it passed with the line removed.

@dan-petty
dan-petty marked this pull request as ready for review November 7, 2026 16:58
@dan-petty
dan-petty merged commit 226394c into main Nov 7, 2026
25 checks passed
@dan-petty
dan-petty deleted the refactor/3757-remove-agent-test-switches-and-test-models branch November 7, 2026 17:04
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.83.1](v0.83.0...v0.83.1)
(2026-11-07)


### Code Refactoring

* **ai:** remove the agent test switches and test models
([#4017](#4017))
([226394c](226394c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/ai AI review pipeline, personas, prompts, LLM client, or RAG type/refactor Type refactor: a new structure, same behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(ai): remove the agent test switches and test models

1 participant