Skip to content

Comments

refactor: migrate library crates from anyhow to thiserror#277

Merged
bug-ops merged 2 commits intomainfrom
feat/m20/error-handling
Feb 14, 2026
Merged

refactor: migrate library crates from anyhow to thiserror#277
bug-ops merged 2 commits intomainfrom
feat/m20/error-handling

Conversation

@bug-ops
Copy link
Owner

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

Summary

  • Replace anyhow with typed thiserror error enums in all 7 library crates
  • LlmError (11 variants), MemoryError (7), SkillError (9), IndexError (8), ChannelError (2), McpError (+4), TuiError (3)
  • LlmProvider trait now returns Result<T, LlmError> instead of anyhow::Result
  • Box<QdrantError> used where clippy flags large error size
  • zeph-core stays on anyhow — typed errors auto-convert via ?
  • 54 files changed, 6 new error.rs files

Test plan

  • cargo nextest run --workspace --lib --bins — 1347 passed
  • cargo clippy --workspace -- -D warnings — zero warnings
  • Code review: approved (0 blockers)
  • Verified zero anyhow in library crate sources

Phase 2 of #268. Closes #270.

Replace anyhow with typed error enums in all library crates:
- zeph-llm: LlmError (11 variants)
- zeph-memory: MemoryError (7 variants, Box<QdrantError> for size)
- zeph-skills: SkillError (9 variants)
- zeph-index: IndexError (8 variants)
- zeph-channels: ChannelError (2 variants)
- zeph-mcp: McpError extended (4 new variants)
- zeph-tui: TuiError (3 variants)

LlmProvider trait returns Result<T, LlmError> instead of anyhow::Result.
zeph-core remains on anyhow, typed errors auto-convert via ?.
1347 tests pass, clippy clean.

Closes #270
@github-actions github-actions bot added llm LLM provider related skills SKILL.md system memory Persistence and memory channels User interface channels rust core dependencies refactor size/XL labels Feb 14, 2026
@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2026

Codecov Report

❌ Patch coverage is 53.72340% with 261 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/zeph-llm/src/candle_provider/embed.rs 0.00% 35 Missing ⚠️
crates/zeph-memory/src/qdrant.rs 6.25% 30 Missing ⚠️
crates/zeph-index/src/store.rs 7.40% 25 Missing ⚠️
crates/zeph-skills/src/qdrant_matcher.rs 8.33% 22 Missing ⚠️
crates/zeph-llm/src/openai.rs 47.22% 19 Missing ⚠️
crates/zeph-llm/src/candle_provider/loader.rs 41.37% 17 Missing ⚠️
crates/zeph-mcp/src/registry.rs 37.50% 15 Missing ⚠️
crates/zeph-llm/src/candle_provider/mod.rs 7.69% 12 Missing ⚠️
crates/zeph-memory/src/semantic.rs 60.00% 12 Missing ⚠️
crates/zeph-index/src/watcher.rs 9.09% 10 Missing ⚠️
... and 16 more

❌ Your patch status has failed because the patch coverage (53.72%) 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     #277      +/-   ##
==========================================
- Coverage   81.13%   81.03%   -0.11%     
==========================================
  Files          87       87              
  Lines       24556    24588      +32     
==========================================
  Hits        19924    19924              
- Misses       4632     4664      +32     
Files with missing lines Coverage Δ
crates/zeph-index/src/chunker.rs 95.23% <100.00%> (ø)
crates/zeph-index/src/repo_map.rs 89.94% <100.00%> (ø)
crates/zeph-llm/src/any.rs 89.26% <100.00%> (ø)
crates/zeph-llm/src/orchestrator.rs 93.70% <100.00%> (+0.04%) ⬆️
crates/zeph-mcp/src/error.rs 100.00% <100.00%> (ø)
crates/zeph-skills/src/loader.rs 99.61% <100.00%> (+0.02%) ⬆️
crates/zeph-skills/src/matcher.rs 97.93% <100.00%> (ø)
crates/zeph-skills/src/registry.rs 91.25% <100.00%> (ø)
crates/zeph-skills/src/watcher.rs 92.40% <100.00%> (ø)
crates/zeph-tui/src/channel.rs 100.00% <100.00%> (ø)
... and 26 more
🚀 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 the tests label Feb 14, 2026
@bug-ops bug-ops merged commit c1b0039 into main Feb 14, 2026
18 checks passed
@bug-ops bug-ops deleted the feat/m20/error-handling branch February 14, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channels User interface channels core dependencies llm LLM provider related memory Persistence and memory refactor rust size/XL skills SKILL.md system tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

R1: migrate library crates from anyhow to thiserror

2 participants