Skip to content

fix(agent-pipeline): add #[non_exhaustive] to error enums (#4717, #4718, #4719)#4742

Merged
bug-ops merged 1 commit into
mainfrom
4717-non-exhaustive-agent-errors
May 30, 2026
Merged

fix(agent-pipeline): add #[non_exhaustive] to error enums (#4717, #4718, #4719)#4742
bug-ops merged 1 commit into
mainfrom
4717-non-exhaustive-agent-errors

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 30, 2026

Summary

Add #[non_exhaustive] to five public error enums across the agent pipeline crates, enforcing the workspace convention from #4658/#4660. Without this attribute, adding a new variant to any of these enums is a silent breaking change for downstream crates.

Affected enums:

  • ToolDispatchErrorcrates/zeph-agent-tools/src/error.rs
  • ContextError, CompactionOutcome, SubgoalStatecrates/zeph-agent-context/src/
  • PersistenceErrorcrates/zeph-agent-persistence/src/error.rs

Downstream match sites updated:

  • zeph-core/src/agent/context/summarization/compaction.rscompact_context_command() wildcard for CompactionOutcome
  • zeph-core/src/debug_dump/mod.rsSubgoalState display arm

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean
  • cargo nextest run --workspace --lib --bins — 10414 passed, 0 failed
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked — clean
  • cargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler" — clean
  • RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler" — clean

Closes #4717
Closes #4718
Closes #4719

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/S Small PR (11-50 lines) labels May 30, 2026
Add the #[non_exhaustive] attribute to five public error enums across the
agent pipeline crates to comply with the workspace convention established
in #4658/#4660:

- ToolDispatchError (zeph-agent-tools)
- ContextError, CompactionOutcome, SubgoalState (zeph-agent-context)
- PersistenceError (zeph-agent-persistence)

Update three downstream exhaustive match sites in zeph-core that break
under the new attribute:

- zeph-core: compact_context_command() wildcard for CompactionOutcome
- zeph-core: debug_dump SubgoalState display arm
- zeph-agent-context: compaction weight match (within-crate, stays exhaustive)

Closes #4717
Closes #4718
Closes #4719
@bug-ops bug-ops force-pushed the 4717-non-exhaustive-agent-errors branch from 2c19748 to 57c3c14 Compare May 30, 2026 02:26
@bug-ops bug-ops enabled auto-merge (squash) May 30, 2026 02:26
@bug-ops bug-ops merged commit 8ed9fdb into main May 30, 2026
32 checks passed
@bug-ops bug-ops deleted the 4717-non-exhaustive-agent-errors branch May 30, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

1 participant