Skip to content

fix(core): wire TurnSummary.tool_calls to hook env export and notification body#6339

Merged
bug-ops merged 1 commit into
mainfrom
feat/issue-6335/turn-tool-calls-unused
Jul 16, 2026
Merged

fix(core): wire TurnSummary.tool_calls to hook env export and notification body#6339
bug-ops merged 1 commit into
mainfrom
feat/issue-6335/turn-tool-calls-unused

Conversation

@bug-ops

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

Copy link
Copy Markdown
Owner

Summary

  • TurnSummary.tool_calls was computed every turn but had no downstream consumer, unlike its sibling llm_requests.
  • Export it as ZEPH_TURN_TOOL_CALLS to turn_complete hooks, mirroring the existing ZEPH_TURN_LLM_REQUESTS export.
  • Include the tool-call count in the notification body (macOS native + ntfy webhook) when non-zero, with correct singular/plural grammar.
  • should_fire gating is intentionally left untouched — llm_requests remains the sole zero-activity gate, since a turn can legitimately have tool_calls == 0 with llm_requests > 0.
  • Added ZEPH_TURN_TOOL_CALLS to the three places that already document ZEPH_TURN_LLM_REQUESTS as a turn_complete hook env var: crates/zeph-config/src/hooks.rs, config/default.toml, crates/zeph-config/src/migrate/session.rs.

Closes #6335

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci -p zeph-core --all-targets --features scheduler -- -D warnings
  • cargo clippy --profile ci -p zeph-config --all-targets -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml -p zeph-core --features scheduler --lib --bins (1999/1999 passed)
  • cargo nextest run --config-file .github/nextest.toml -p zeph-config --lib --bins (849/849 passed)
  • cargo test --doc -p zeph-core (45/45 passed)
  • New unit tests cover notification-body inclusion/omission (incl. singular "1 tool call" boundary) and the ZEPH_TURN_TOOL_CALLS hook env export

@github-actions github-actions Bot added bug Something isn't working size/M Medium PR (51-200 lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate config Configuration file changes labels Jul 16, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 16, 2026 20:29
…ation body

tool_calls was computed every turn but had no downstream consumer,
unlike its sibling llm_requests. Export it as ZEPH_TURN_TOOL_CALLS
to turn_complete hooks and include it in the notification body when
non-zero. should_fire gating is left untouched (llm_requests remains
the sole zero-activity gate).

Closes #6335
@bug-ops
bug-ops force-pushed the feat/issue-6335/turn-tool-calls-unused branch from b43edad to ee5fc9b Compare July 16, 2026 20:37
@bug-ops
bug-ops merged commit 4ab28f2 into main Jul 16, 2026
43 checks passed
@bug-ops
bug-ops deleted the feat/issue-6335/turn-tool-calls-unused branch July 16, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working config Configuration file changes 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.

TurnSummary.tool_calls is write-only — no downstream consumer reads it

1 participant