-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Problem
zeph-core/src/agent/ modules (mod.rs, context.rs, learning.rs, mcp.rs, streaming.rs, persistence.rs) use anyhow::Result throughout. While project conventions allow anyhow in application code, the agent module has grown into a substantial orchestration layer with well-defined error categories that would benefit from typed errors.
Proposed solution
Introduce AgentError enum in zeph-core/src/agent/error.rs with variants covering all failure modes:
- LLM errors (
LlmErrorfrom zeph-llm) - Channel errors (
ChannelError) - Memory/persistence errors (
MemoryError) - Skill errors (
SkillError) - Tool execution errors
- Configuration errors
- Timeout errors
Replace anyhow::Result in agent methods with Result<T, AgentError>. Keep anyhow only in main.rs entry point.
Affected files
crates/zeph-core/src/agent/mod.rscrates/zeph-core/src/agent/context.rscrates/zeph-core/src/agent/learning.rscrates/zeph-core/src/agent/mcp.rscrates/zeph-core/src/agent/streaming.rscrates/zeph-core/src/agent/persistence.rs- New:
crates/zeph-core/src/agent/error.rs
Part of #282
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels