Repository navigation
Description
Problem or Motivation
pyproject.toml pins pydantic-ai 2.59.0 and pydantic-ai-harness 0.59.0. The newest are 2.68.0 and 0.68.0. The baseline (#5065) keeps them. Renovate (#4893) will offer them, and the move breaks run-time checks with no error:
- 2.60.0 compatibility note: "Deprecate RetryPromptPart in favor of ToolReturnPart(outcome=retried) and RetryFeedbackPart". The framework no longer builds
RetryPromptPart, soisinstancechecks stop matching at run time. ARetryPromptPartthat a test builds still matches, which hides the change. - Code:
src/devops_cli/roadmap/agent_run.py:28,310,336,355-363,373,383(_add_violationsno longer counts output-schema violations),src/devops_cli/roadmap/refine/refine_investigation.py:38,466. - Tests that build
RetryPromptPart:tests/roadmap/stage/test_roadmap_stage_toolbox.py:923,tests/roadmap/test_roadmap_alternatives.py:19,2116,tests/roadmap/refine/test_roadmap_refine_investigation.py:35,1163,tests/roadmap/implement/test_roadmap_implement_shell_refusal.py:14,218. - mypy:
src/devops_cli/ai/tools/__init__.py:248, theDeferredToolRequests.build_resultsoverride lacks the newanswered_byparameter. - 15 tests fail on 2.68.0: test_roadmap_stage_toolbox (4), test_roadmap_implement_step (5), test_roadmap_alternatives (4), test_roadmap_refine_investigation (2).
- pydantic-ai 2.67 and later cap
google-genai<3. The baseline adds a Renovate rule that holds google-genai below 3 until this item; the same move lifts that rule. Also checkgenai-prices>=0.2.3andopenai>=3.31.0(already met). - tenacity 9.2.x cannot resolve while google-genai caps
tenacity<9.2.0.
Research of 2026-11-12 (research-python, migration pydantic-ai + pydantic-ai-harness).
Proposed Solution & Architectural Design
- Match
ToolReturnPart(outcome=retried)andRetryFeedbackPartwhere the code matchesRetryPromptPart; make the tests build the parts that 2.68 builds (from a recorded run, not by hand). - Add
answered_byto thebuild_resultsoverride. - Pin pydantic-ai 2.68.0 and pydantic-ai-harness 0.68.0; remove the google-genai hold of the Renovate preset.
Done when the 15 tests pass on 2.68 with parts that the framework builds, and mypy is clean.
Target Subsystem
AI & Agentic Review Pipeline
Existing Tool Considered
pydantic-ai itself. No new code beyond the part matching.
Source: #4893
Alternatives check of 2026-11-15: in-use.
The repository already uses this tool.
Tool: pydantic-ai (https://pypi.org/project/pydantic-ai), MIT, last activity 2026-11-12, maintained.
Proposed design
Problem statement
pyproject.toml pins pydantic-ai 2.59.0 and pydantic-ai-harness 0.59.0. Versions 2.68.0 and 0.68.0 replace RetryPromptPart with ToolReturnPart(outcome=retried) and RetryFeedbackPart. They also add the answered_by parameter to DeferredToolRequests.build_results. The repository still matches the old class in two modules and in five test modules, and the type override lacks the new parameter. So 15 tests fail on 2.68.0, and the trace stops counting output-schema violations with no error. The baseline item #5065 also added a Renovate rule that holds google-genai below 3, and .github/renovate.json states that this item removes it, so the move lifts that hold as well.
Acceptance criteria
Requirement: The trace counts a retried output
RunTrace.absorb SHALL count the output-schema violations of a retry from the parts that pydantic-ai 2.68 builds.
Scenario: A recorded retry of the output tool
- WHEN a test feeds the messages of a recorded 2.68 run in which the output tool retried once
- THEN the trace has
violations == 1and one masked text inviolation_texts
Requirement: A retried tool call keeps its error outcome
The trace SHALL record a retried function-tool call with the error outcome and the characters of its retry text.
Scenario: A recorded retry of a function tool
- WHEN a test absorbs the messages of a recorded 2.68 run in which a function tool retried
- THEN the
ToolCallRecordof that call has outcomeerrorand the length of the retry text
Requirement: The investigation detects a retried output
refine_investigation SHALL detect a retried output from the parts that pydantic-ai 2.68 builds.
Scenario: The investigation reads a retry
- WHEN a test feeds the investigation the messages of a recorded 2.68 run that retried its output tool
- THEN the investigation reports the retry as it reported a
RetryPromptPartbefore
Requirement: No code or test names the deprecated part
src/ and tests/ MUST hold no reference to RetryPromptPart.
Scenario: The scan of the source tree
- WHEN a test searches
src/andtests/for the nameRetryPromptPart - THEN the search returns no path
Requirement: The build_results override takes answered_by
The DeferredToolRequests.build_results override SHALL accept the answered_by parameter.
Scenario: A call with answered_by
- WHEN a test calls
build_resultswithanswered_byset - THEN the call returns the built results with no error
Requirement: The type check is clean
src/devops_cli/ai/tools/__init__.py MUST pass the strict type check with no error.
Scenario: The strict check of the module
- WHEN
uv run mypy src/devops_cli/ai/tools/__init__.pyruns - THEN it exits 0 and reports no error
Requirement: The lock agrees with the new pins
pyproject.toml and uv.lock SHALL pin pydantic-ai 2.68.0 and pydantic-ai-harness 0.68.0.
Scenario: The lock check after the pin change
- WHEN
uv lock --checkruns after the pins change - THEN it exits 0 and reports no lock that differs from the pins
Requirement: The affected test modules pass on 2.68.0
The roadmap and AI test modules that failed on 2.68.0 SHALL pass on 2.68.0.
Scenario: The five affected modules
- WHEN
uv run pytest tests/roadmap tests/airuns on pydantic-ai 2.68.0 - THEN it exits 0 with no failed test
Requirement: The google-genai hold is gone
.github/renovate.json MUST hold no allowedVersions rule that keeps google-genai below 3.
Scenario: The Renovate config validator
- WHEN
npx --yes --package [email protected] renovate-config-validator --strict --no-global .github/renovate.json .github/renovate/base.jsonruns after the rule is removed - THEN it exits 0 and prints
Config validated successfully against 2 file(s)
Existing Tool Considered
pydantic-ai (https://pypi.org/project/pydantic-ai), MIT, maintained, last activity 2026-11-12, with pydantic-ai-harness (https://pypi.org/project/pydantic-ai-harness). The repository already pins both, and the check found 2.68.0 and 0.68.0 released and maintained. The library covers the need: it ships ToolReturnPart(outcome=retried), RetryFeedbackPart and the answered_by parameter of DeferredToolRequests.build_results (https://pydantic.dev/docs/ai/tools-toolsets/deferred-tools/). It lacks the repository's own work: the isinstance matching in agent_run.py and refine_investigation.py, the fixtures of five test modules, the mypy override in ai/tools/__init__.py, and the removal of the google-genai hold in .github/renovate.json. The change adds no code beyond the part matching.
Key questions
- Which parts must the code match for a retry after pydantic-ai 2.68?: Match
RetryFeedbackPartandToolReturnPartwith a retried outcome in place ofRetryPromptPart. Keep no match on the deprecated class. (best practice) [sources: src/devops_cli/roadmap/agent_run.py:347, src/devops_cli/roadmap/refine/refine_investigation.py:482]- Chosen: Match the new parts. 2.68 builds these parts, so the match holds at run time.
- Rejected: Keep the
RetryPromptPartmatch. 2.68 builds no such part, so the isinstance check stops matching with no error. - Rejected: Match by
tool_call_idonly. The trace also needs the outcome and the violation text of the retry.
- How do the tests get the retry parts that 2.68 builds?: Record the messages of a 2.68 run and feed them through the test support module. Do not build the parts by hand. (best practice) [sources: tests/support/model_script.py:151, tests/roadmap/stage/test_roadmap_stage_toolbox.py:963]
- Chosen: Record the parts from a run. The recorded parts are the parts that the framework builds, so the test cannot pass on a shape that 2.68 never emits.
- Rejected: Keep the hand-built parts. A hand-built
RetryPromptPartstill matches, which hides the change.
- Do the two dependencies keep an exact pin?: Yes. Set
pydantic-ai[spec]==2.68.0andpydantic-ai-harness[coder]==0.68.0, because the file pins every dependency exactly. (best practice) [sources: pyproject.toml:40, pyproject.toml:41]- Chosen: Exact pin. Every dependency of
pyproject.tomlhas an exact pin, so a range would break the file's convention. - Rejected: Range pin. A range lets an untested release into the lock and departs from the file's convention.
- Chosen: Exact pin. Every dependency of
- How does the mypy override change?: Add the
answered_byparameter, with the type that 2.68 declares, to theDeferredToolRequests.build_resultsoverride insrc/devops_cli/ai/tools/__init__.py, and pass it through tosuper().build_results(...). (best practice) [sources: src/devops_cli/ai/tools/init.py:248, https://pydantic.dev/docs/ai/tools-toolsets/deferred-tools/]- Chosen: Add the parameter to the override. The strict check reads the override signature, and the new parameter keeps it the same as the library's.
- Rejected: Suppress the error. A suppression hides a real signature difference and needs a reason and an expiry.
- Do the other constraints of pydantic-ai 2.68 hold in the current pins?: Yes.
genai-prices==0.2.3meets>=0.2.3, andopenai==3.49.0meets>=3.31.0. [sources: pyproject.toml:51, pyproject.toml:44] - Does the
tenacity<9.2.0cap of google-genai block the move?: No.pyproject.tomlpinstenacity==9.1.4, below the cap, so the resolver is satisfied. [sources: pyproject.toml:54] - Does the move need the baseline item build(deps): take every safe version update before Renovate #5065 first?: No. build(deps): take every safe version update before Renovate #5065 is already merged: its change is archived, its tasks are done, and the baseline pins and the google-genai hold it added are in the tree. This item only moves the pins on top of them. [sources: .github/renovate.json:341, openspec/changes/archive/2026-11-12-5065-take-every-safe-version-update-before/tasks.md:15, pyproject.toml:40]
- Does this item remove the google-genai hold of the Renovate config?: Yes. The hold is the
allowedVersions: "<3"rule forgoogle-genaiin the repository's own.github/renovate.json, not in the shared preset.github/renovate/base.json. Both that file's description and the design of build(deps): take every safe version update before Renovate #5065 name this item as the one that removes it, so delete the rule here and validate the file withnpx --yes --package [email protected] renovate-config-validator --strict --no-global .github/renovate.json .github/renovate/base.json. (best practice) [sources: .github/renovate.json:341, openspec/changes/archive/2026-11-12-5065-take-every-safe-version-update-before/design.md:10, openspec/changes/archive/2026-11-16-6051-searxng-renovate-branch/tasks.md:8]- Chosen: Remove the rule here. The rule lives in
.github/renovate.json, and that file and the design of build(deps): take every safe version update before Renovate #5065 both record that this item removes it. - Rejected: Defer the rule removal to a new issue. The file is in this repository and a validator command exists, so the removal is part of this item and needs no person.
- Rejected: Change the shared preset. The hold was put in
.github/renovate.jsonbecause it is a fact of this repository's lock, not of every Service repository.
- Chosen: Remove the rule here. The rule lives in
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both work on the pydantic-ai agent runtime, but #2489 replaced the hand-rolled agent while this candidate upgrades the pydantic-ai version and adapts retry-part matching.build(deps): hold google-genai below 3 for Renovate until #5098
build(deps): take every safe version update before Renovate (#5102)
devops-cli-service commentedon Nov 15, 2026
Alternatives check: in-use
Reason: The web searches returned only unrelated Docker Hub hits, but the fact reads show that pydantic-ai 2.68.0 and pydantic-ai-harness 0.68.0 — exactly the versions the issue asks to move to — are released and maintained, and the issue itself names pydantic-ai as the tool that ships the new retry-part types (ToolReturnPart(outcome=retried), RetryFeedbackPart) and the
answered_byparameter. The library covers the whole need; only the repository's own isinstance matching, test fixtures and mypy override must be adapted on top of it.The repository already uses this tool.
Tool: pydantic-ai (https://pypi.org/project/pydantic-ai)
Covers:
answered_byparameter on DeferredToolRequests.build_resultsLacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at c58b592 (see proposed design in issue body).
docs(openspec): count a spent retry that Coder answers as no retry
fix(deps): log the call that Coder fails and keep 2.71 status classes…
fix(deps): keep the class of the context window and quota stops
chore(main): release 0.184.0 (#6552)
devops-cli-service commentedon Nov 20, 2026
Released in v0.184.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.184.0
devops-cli-service commentedon Nov 20, 2026
Live since 2026-11-20 19:43 UTC