Repository navigation
Description
Problem Description
tests/roadmap/implement/test_roadmap_implement_step_trace.py:183 (test_the_same_call_twice_has_one_digest_and_no_event_holds_the_command) passes tool_calls(same, same, other) in one model reply (tests/roadmap/implement/test_roadmap_implement_step_trace.py:193), then asserts exact positional order assert digests[0] == digests[1] != digests[2] (tests/roadmap/implement/test_roadmap_implement_step_trace.py:198).
Because pydantic_ai executes tool calls of a single reply concurrently and _note appends TraceEventKind.TOOL (src/devops_cli/roadmap/implement/implement_step.py:494) after each call awaits LocalWorkspaceBackend.run, other (8493027a96ad) can complete before the second same (2e20f17b55e7), ordering digests as ['2e20f17b55e7', '8493027a96ad', '2e20f17b55e7'].
Reproduction Steps
- Run
Tests & Coverage (shard 2 of 5)on PR feat(roadmap): add 67 cases to the implement golden set #7041 (job/138903829621). - Observe
tests/roadmap/implement/test_roadmap_implement_step_trace.py:198fail intermittently whenotherfinishes ahead of the secondsame.
Expected vs Actual Behavior
Expected: Either the test executes same, same, other in separate turns (tool_calls(same), tool_calls(same), tool_calls(other)), or checks multiset counts (Counter(digests) == {same_digest: 2, other_digest: 1}).
Actual: Positional assertion assert digests[0] == digests[1] != digests[2] fails intermittently with AssertionError: assert '2e20f17b55e7' == '8493027a96ad'.
Environment Diagnostics
- DevOps CLI Version:
0.211.6(48998538d) - Execution Environment: GitHub Actions runner (
Tests & Coverage (shard 2 of 5), job138903829621)
Logs, Traces, or Terminal Output
Tool call: run_command, started: pytest tests/test_sample.py --flag=<masked>
Tool call: run_command, started: pytest tests/test_sample.py --flag=<masked>
Tool call: run_command, started: pytest tests/other_sentinel.py
FAILED tests/roadmap/implement/test_roadmap_implement_step_trace.py::test_the_same_call_twice_has_one_digest_and_no_event_holds_the_command - AssertionError: assert '2e20f17b55e7' == '8493027a96ad'
Source
Source: #7041
Proposed design
Problem statement
Replace the positional digest assertion in the step trace test with a multiset count. The test sends two identical tool calls and one different tool call in one model reply. pydantic_ai runs the calls at the same time. The completion order changes. The current positional assertion fails intermittently. The multiset assertion keeps the duplicate-call check and removes the order dependency.
Acceptance criteria
Requirement: Multiset digest assertion
The step trace test SHALL compare the tool-call digests as a multiset, not by positional order.
Scenario: Concurrent completion order
- WHEN I run
uv run pytest tests/roadmap/implement/test_roadmap_implement_step_trace.py -k same_call_twice. - THEN The command exits 0, and the test counts the
samedigest twice and theotherdigest once.
Requirement: No command in trace events
The step trace test MUST keep the assertion that no trace event holds the command.
Scenario: Trace event content
- WHEN I run
uv run pytest tests/roadmap/implement/test_roadmap_implement_step_trace.py -k same_call_twice. - THEN The command exits 0, and no trace event holds a command.
Existing Tool Considered
No alternatives check has run. pytest is the open, maintained test runner and covers test execution; it lacks a built-in multiset assertion. The standard-library collections.Counter covers the multiset comparison. The change adds no dependency and no production code.
Key questions
- How should the test assert the digest of the repeated
samecall when tool calls run concurrently?: Compare the digests withcollections.Counter. Assert two occurrences of thesamedigest and one occurrence of theotherdigest. Keep the assertion that no trace event holds the command. (best practice) [sources: tests/roadmap/implement/test_roadmap_implement_step_trace.py:198, src/devops_cli/roadmap/implement/implement_tool_log.py:391]- Rejected: Keep the positional digest assertion. The completion order is nondeterministic, so the assertion fails intermittently.
- Rejected: Run the calls in separate model turns. It removes the concurrent duplicate-call case that the test covers.
- Chosen: Compare digest counts with
Counter. It keeps the concurrent case and makes the assertion independent of completion order.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 25, 2026
The test causes intermittent CI failures on the shard 2 job, which meets the P0 criterion of CI failure.Both concern tool events in the implement step trace, but #4393 fixes event retention in the trace encoding while this candidate fixes a flaky test assertion on digest order.devops-cli-service commentedon Nov 25, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 25, 2026
Released in v0.215.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.215.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 04:21 UTC