mirror of
https://github.com/pydantic/pydantic-ai-harness.git
synced 2026-07-21 02:45:34 +00:00
test(step_persistence): drop dead validator branch to restore 100% coverage
The `gate` output-validator in `test_does_not_regress_to_stale_stash_after_model_request_save` had a `return value` branch that never executed: the run fails on request 3 before any output passes validation a second time. Simplify it to always raise `ModelRetry` (one retry is all the stash scenario needs), matching the sibling `test_rescues_newest_text_history_over_earlier_saved_snapshot`.
This commit is contained in:
@@ -1149,14 +1149,10 @@ class TestOnRunErrorSnapshot:
|
||||
capabilities=[StepPersistence(store=store, agent_name='delegate')],
|
||||
output_type=str,
|
||||
)
|
||||
retried = {'done': False}
|
||||
|
||||
@agent.output_validator
|
||||
def gate(value: str) -> str: # pyright: ignore[reportUnusedFunction]
|
||||
if not retried['done']:
|
||||
retried['done'] = True
|
||||
raise ModelRetry('call a tool first')
|
||||
return value
|
||||
raise ModelRetry('call a tool first')
|
||||
|
||||
@agent.tool_plain
|
||||
def lookup() -> str: # pyright: ignore[reportUnusedFunction]
|
||||
|
||||
Reference in New Issue
Block a user