Skip to content

test(core): add e2e coverage for TurnSummary tool_calls/llm_requests counters - #6334

Merged
bug-ops merged 1 commit into
mainfrom
feat/issue-6330/turnsummary-counters-e2e-test
Jul 16, 2026
Merged

test(core): add e2e coverage for TurnSummary tool_calls/llm_requests counters#6334
bug-ops merged 1 commit into
mainfrom
feat/issue-6330/turnsummary-counters-e2e-test

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds integration-style tests that drive a real Agent::process_user_message turn and assert TurnSummary.tool_calls / TurnSummary.llm_requests reflect 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).
  • Reuses existing MockProvider/MockToolExecutor/MockChannel test doubles — no new mocking infrastructure.
  • Test-only change; no production code modified.

Closes #6330

Tests

  • text_only_turn_reports_zero_tool_calls_and_one_llm_request — zero-tool-call baseline
  • single_turn_with_multiple_tool_calls_counts_full_batch — 3 tool calls in one batch, distinguishes += len() from += 1 batch counting
  • tool_call_counter_resets_between_turns_not_accumulated — two sequential turns, exercises the begin_turn reset site

Notes

  • Reviewed by the team-develop chain (developer → tester + impl-critic → reviewer). impl-critic flagged that TurnSummary.tool_calls currently has no live downstream consumer (not read by should_fire, not in the notification body, no ZEPH_TURN_TOOL_CALLS hook 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 --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 13872 passed, 35 skipped
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"

…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.
@github-actions github-actions Bot added tests Test-related changes documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate size/M Medium PR (51-200 lines) and removed tests Test-related changes labels Jul 16, 2026
@bug-ops

bug-ops commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

Follow-up filed: #6335 (TurnSummary.tool_calls write-only field, out of scope for this test-only PR).

@bug-ops
bug-ops enabled auto-merge (squash) July 16, 2026 19:46
@bug-ops
bug-ops merged commit 200e549 into main Jul 16, 2026
43 checks passed
@bug-ops
bug-ops deleted the feat/issue-6330/turnsummary-counters-e2e-test branch July 16, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no end-to-end test asserts TurnSummary.tool_calls / turn_llm_requests reflect real per-turn counts

1 participant