refactor(agent-tools,db): replace send_stop_hint with StopHint enum; fix sql! import guards#4863
Merged
Merged
Conversation
e3351f0 to
fdf7d9e
Compare
…enum; fix sql! import guards Move StopHint from zeph-core::channel to zeph-common::types to break the circular dependency that would arise from zeph-agent-tools depending on zeph-core. Re-export the type in both zeph-common and zeph-core::channel so all existing call-sites remain source-compatible. Replace the string- literal dispatch in AgentChannelView with typed StopHint variants and remove the TODO(critic) debt comment. Closes #4792. Replace #[allow(unused_imports)] on feature-gated sql! use declarations with #[cfg(any(feature = "sqlite", feature = "postgres"))] guards in zeph-scheduler and zeph-orchestration. Remove the import entirely where it was unused at module level; move it inside #[cfg(test)] in scheduler.rs where sql! is only used in tests. Closes #4841. Note: #4779 (#[non_exhaustive] sweep for 18 pub enums) was already resolved in PR #4759 (commit 88c8179) and is not part of this branch.
fdf7d9e to
b0f7f04
Compare
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
Replace
AgentChannelView::send_stop_hint(&str)withsend_stop_hint(StopHint)to eliminate implicit string-based dispatch coupling and provide compile-time exhaustiveness enforcement across all call-sites.StopHintis moved tozeph-common::types(a leaf crate) to avoid a circular dependency, with re-exports in bothzeph-commonandzeph-core::channelfor source compatibility. Closes refactor(agent-tools): replace send_stop_hint(&str) with enum to eliminate implicit match-arm coupling #4792.Replace
#[allow(unused_imports)]workarounds on feature-gatedsql!use declarations inzeph-schedulerandzeph-orchestrationwith proper#[cfg(any(feature = "sqlite", feature = "postgres"))]guards. Removes the import entirely where it is unused at module level; moves it inside#[cfg(test)]inscheduler.rswheresql!is only used in tests. Closes refactor(db): eliminate repeated #[allow(unused_imports)] for feature-gated sql! macro #4841.Note: Issue #4779 (
#[non_exhaustive]sweep for 18 pub enums) was already resolved in PR #4759 (commit88c8179f) and is not part of this branch.Files changed (10)
crates/zeph-agent-tools/src/channel.rs—send_stop_hintsignature updatedcrates/zeph-common/src/lib.rs— re-exportStopHintcrates/zeph-common/src/types.rs—StopHintenum definition addedcrates/zeph-core/src/agent/channel_impl.rs— call-sites updated to enum variantscrates/zeph-core/src/channel.rs— re-exportStopHintfrom zeph-commoncrates/zeph-orchestration/src/lib.rs—sql!import removed (unused at module level)crates/zeph-orchestration/src/plan_cache.rs—sql!import guarded with#[cfg]crates/zeph-scheduler/src/lib.rs—sql!import removed (unused at module level)crates/zeph-scheduler/src/scheduler.rs—sql!import moved inside#[cfg(test)]crates/zeph-scheduler/src/store.rs—sql!import guarded with#[cfg]Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features "desktop,ide,server,chat,pdf,scheduler" -- -D warnings— cleanRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,sqlite" --locked— cleancargo nextest run --config-file .github/nextest.toml --workspace --lib --bins— 10500 passed, 21 skippedcargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler"— passed