Skip to content

Comments

refactor: replace anyhow with typed AgentError in agent module#295

Merged
bug-ops merged 2 commits intomainfrom
feat/m20/refactor-v2-phase4
Feb 15, 2026
Merged

refactor: replace anyhow with typed AgentError in agent module#295
bug-ops merged 2 commits intomainfrom
feat/m20/refactor-v2-phase4

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 15, 2026

Summary

  • Introduce AgentError enum with 7 variants: Llm, Channel, Memory, Skill, Tool, Io, Other
  • Replace anyhow::Result with Result<T, AgentError> across all agent submodules
  • run() retains anyhow::Result as boundary to main.rs
  • All error conversions via #[from] derives for zero-cost moves
  • Re-export AgentError from zeph_core crate root

Closes #293
Part of #282

Test plan

  • cargo build
  • cargo clippy --workspace -- -D warnings
  • cargo nextest run --workspace --lib --bins (1351 tests pass)
  • Performance review: net positive (typed enum vs anyhow Box alloc)
  • Security audit: no issues, cargo-deny clean

Introduce AgentError enum with 7 variants (Llm, Channel, Memory, Skill,
Tool, Io, Other) replacing anyhow::Result across all agent submodules.
Only run() retains anyhow::Result as the boundary to main.rs. All error
conversions use #[from] derives for zero-cost moves.
@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2026

Codecov Report

❌ Patch coverage is 41.09589% with 43 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/zeph-core/src/agent/learning.rs 26.66% 22 Missing ⚠️
crates/zeph-core/src/agent/mcp.rs 0.00% 14 Missing ⚠️
crates/zeph-core/src/agent/index.rs 0.00% 5 Missing ⚠️
crates/zeph-core/src/agent/mod.rs 66.66% 1 Missing ⚠️
crates/zeph-core/src/agent/persistence.rs 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (41.09%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
- Coverage   80.03%   79.96%   -0.07%     
==========================================
  Files          98       98              
  Lines       23926    23964      +38     
==========================================
+ Hits        19149    19163      +14     
- Misses       4777     4801      +24     
Files with missing lines Coverage Δ
crates/zeph-core/src/agent/context.rs 85.87% <100.00%> (+0.08%) ⬆️
crates/zeph-core/src/agent/streaming.rs 83.46% <100.00%> (+0.27%) ⬆️
crates/zeph-core/src/agent/mod.rs 82.28% <66.66%> (ø)
crates/zeph-core/src/agent/persistence.rs 4.65% <0.00%> (ø)
crates/zeph-core/src/agent/index.rs 45.00% <0.00%> (-3.65%) ⬇️
crates/zeph-core/src/agent/mcp.rs 10.83% <0.00%> (-0.43%) ⬇️
crates/zeph-core/src/agent/learning.rs 22.22% <26.66%> (+0.08%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies size/L and removed size/M labels Feb 15, 2026
Bump workspace version 0.9.5 -> 0.9.6 with internal crate deps
0.9.4 -> 0.9.6. Update CHANGELOG, README, and mdBook docs to reflect
epic #282 refactoring: typed errors, agent decomposition, field
grouping, qdrant feature gating.
@bug-ops bug-ops force-pushed the feat/m20/refactor-v2-phase4 branch from 83fa180 to 4619174 Compare February 15, 2026 01:20
@bug-ops bug-ops enabled auto-merge (squash) February 15, 2026 01:21
@bug-ops bug-ops merged commit c9b1bca into main Feb 15, 2026
20 checks passed
@bug-ops bug-ops deleted the feat/m20/refactor-v2-phase4 branch February 15, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace anyhow with typed AgentError in zeph-core agent module

2 participants