Description
AgentChannel::send_stop_hint takes a primitive &str reason code (\"max_tokens\", \"cancelled\", etc.) instead of a typed enum. This creates implicit coupling: any new StopHint variant added to zeph_core::channel::StopHint MUST be mirrored at every dispatcher emit-site AND at AgentChannelView::send_stop_hint match arms without compiler enforcement.
The issue is acknowledged in the module-level doc comment of crates/zeph-agent-tools/src/channel.rs:21:
```
// TODO(critic): send_stop_hint takes a primitive &str reason instead of an enum.
// Any new variant added to zeph_core::channel::StopHint MUST be mirrored at dispatcher
// emit-sites AND at AgentChannelView::send_stop_hint match arms.
```
Reproduction Steps
- Add a new
StopHint::SomeNewReason variant to zeph_core::channel::StopHint.
- The compiler does not flag
AgentChannelView::send_stop_hint or dispatcher call-sites.
- The new reason is silently mapped to
StopHint::Other or similar fallback.
Expected Behavior
Introducing a new StopHint variant causes compile errors at all dispatch call-sites, enforcing exhaustive handling.
Actual Behavior
No compile-time feedback — silent fallback. Only caught by manual audit or runtime tests.
Environment
Logs / Evidence
Module doc comment explicitly tags this as a known debt item (TODO(critic)).
Description
AgentChannel::send_stop_hinttakes a primitive&strreason code (\"max_tokens\",\"cancelled\", etc.) instead of a typed enum. This creates implicit coupling: any newStopHintvariant added tozeph_core::channel::StopHintMUST be mirrored at every dispatcher emit-site AND atAgentChannelView::send_stop_hintmatch arms without compiler enforcement.The issue is acknowledged in the module-level doc comment of
crates/zeph-agent-tools/src/channel.rs:21:```
// TODO(critic): send_stop_hint takes a primitive &str reason instead of an enum.
// Any new variant added to zeph_core::channel::StopHint MUST be mirrored at dispatcher
// emit-sites AND at AgentChannelView::send_stop_hint match arms.
```
Reproduction Steps
StopHint::SomeNewReasonvariant tozeph_core::channel::StopHint.AgentChannelView::send_stop_hintor dispatcher call-sites.StopHint::Otheror similar fallback.Expected Behavior
Introducing a new
StopHintvariant causes compile errors at all dispatch call-sites, enforcing exhaustive handling.Actual Behavior
No compile-time feedback — silent fallback. Only caught by manual audit or runtime tests.
Environment
zeph-agent-toolscrates/zeph-agent-tools/src/channel.rsLogs / Evidence
Module doc comment explicitly tags this as a known debt item (TODO(critic)).