Skip to content

refactor(core): remove legacy #[cfg(test)]-only dispatch harness duplicating production tool/LLM dispatch#6617

Merged
bug-ops merged 1 commit into
mainfrom
fix/6560-legacy-dispatch-harness
Jul 20, 2026
Merged

refactor(core): remove legacy #[cfg(test)]-only dispatch harness duplicating production tool/LLM dispatch#6617
bug-ops merged 1 commit into
mainfrom
fix/6560-legacy-dispatch-harness

Conversation

@bug-ops

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

Copy link
Copy Markdown
Owner

Summary

  • Removes the ~300-line #[cfg(test)]-only legacy sequential-dispatch harness in crates/zeph-core/src/agent/tool_execution/tool_result.rs (handle_tool_result, record_tool_output_outcome, process_successful_tool_output, handle_confirmation_required), superseded in production by process_one_tool_result/handle_confirmation_phase (tier_loop.rs)
  • Removes the equivalent legacy LLM-dispatch harness in crates/zeph-core/src/agent/tool_execution/llm_dispatch.rs (call_llm_with_timeout, call_llm_non_streaming, call_llm_with_retry), superseded by call_chat_with_tools_retry/call_chat_with_tools/dispatch_chat_with_tools/call_non_streaming
  • Repoints all ~20 dependent tests to exercise the real production entry points instead of the dead harnesses, so passing tests actually signal something about production behavior
  • This class of duplication previously caused issue dump_tool_output (raw pre-summarization tool-output debug dump, #6315) is dead code — never called in production #6364 (a debug-dump call silently dead in production for months, masked by green legacy-harness tests) — removing the harness closes the gap at its root instead of leaving it to recur
  • Corrects 4 stale doc references (2 crate READMEs, 2 mdbook pages) that described the removed functions as live production paths

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 — 15006 passed, 0 failed, 36 skipped
  • Rustdoc gate (RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links")
  • gitleaks protect --staged
  • Independent review re-ran the full check suite and verified zero production-line changes in either touched file (100% of removed lines were pre-existing #[cfg(test)]-gated code)

Closes #6560

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate refactor Code refactoring without functional changes size/XL Extra large PR (500+ lines) labels Jul 20, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 20, 2026 21:31
@bug-ops
bug-ops force-pushed the fix/6560-legacy-dispatch-harness branch 2 times, most recently from 6b7e00c to ff9c948 Compare July 20, 2026 21:50
…icating production tool/LLM dispatch

The tool_result.rs and llm_dispatch.rs legacy sequential-dispatch
harnesses were kept alive only by their own tests, reimplementing the
classify -> summarize -> sanitize -> persist pipeline already owned by
process_one_tool_result/call_chat_with_tools_retry. This divergence
previously masked a real production gap (issue #6364). All dependent
tests are repointed to exercise the real production entry points, and
both dead harnesses (~500 lines total) are removed.

Closes #6560
@bug-ops
bug-ops force-pushed the fix/6560-legacy-dispatch-harness branch from ff9c948 to a9c4dde Compare July 20, 2026 22:01
@bug-ops
bug-ops merged commit 5b4880a into main Jul 20, 2026
47 checks passed
@bug-ops
bug-ops deleted the fix/6560-legacy-dispatch-harness branch July 20, 2026 22:12
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 refactor Code refactoring without functional changes rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tool_result.rs: 300-line #[cfg(test)]-only legacy dispatch harness duplicates process_one_tool_result, gives false test confidence

1 participant