test(core): add e2e coverage for TurnSummary tool_calls/llm_requests counters - #6334
Merged
Merged
Conversation
…counters PR #6328 wired LifecycleState::turn_tool_calls into TurnSummary::tool_calls, replacing a hardcoded 0, but no test exercised a real turn to prove the counters reflect actual per-turn dispatch counts. Drives real turns through check_and_update_quota via the existing MockProvider/MockToolExecutor test doubles, covering the zero-tool-call baseline, multi-tool-call batch counting, and reset-timing between turns.
Owner
Author
|
Follow-up filed: #6335 (TurnSummary.tool_calls write-only field, out of scope for this test-only PR). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agent::process_user_messageturn and assertTurnSummary.tool_calls/TurnSummary.llm_requestsreflect actual per-turn counts, closing the coverage gap left by fix(core): wire real turn_tool_calls counter and collapse delegate boilerplate #6328 (previously verified only via static code trace).MockProvider/MockToolExecutor/MockChanneltest doubles — no new mocking infrastructure.Closes #6330
Tests
text_only_turn_reports_zero_tool_calls_and_one_llm_request— zero-tool-call baselinesingle_turn_with_multiple_tool_calls_counts_full_batch— 3 tool calls in one batch, distinguishes+= len()from+= 1batch countingtool_call_counter_resets_between_turns_not_accumulated— two sequential turns, exercises thebegin_turnreset siteNotes
TurnSummary.tool_callscurrently has no live downstream consumer (not read byshould_fire, not in the notification body, noZEPH_TURN_TOOL_CALLShook export) — the test module doc was reworded to avoid overstating this as end-to-end delivery proof. The write-only-field gap itself is out of scope for this PR; will be filed as a separate follow-up issue.Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 13872 passed, 35 skippedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"