refactor(zeph-core): decompose Agent struct and remove anyhow (#1731, #1732)#1743
Merged
refactor(zeph-core): decompose Agent struct and remove anyhow (#1731, #1732)#1743
Conversation
…re modules Closes #1731, partially closes #1732 (remaining: #1742). Agent struct decomposition (#1731): - Add LifecycleState (shutdown, cancel_token, warmup, config_path, watchers) - Add ProviderState (summary_provider, judge_provider, cached_prompt_tokens, stt) - Add MetricsState (metrics_tx, cost_tracker, token_counter) - Add OrchestrationState (pending_graph, plan_cancel_token, subagent_manager) - Update all field access sites across agent/* submodules anyhow removal from core modules (#1732): - Add VaultError to vault.rs; update VaultProvider trait signature - Add BootstrapError to bootstrap/provider.rs; update all bootstrap functions - Add DaemonError to daemon.rs; update ComponentHandle - Update ConfigError::Vault to use VaultError instead of anyhow::Error - Remaining anyhow usages in subagent/ and config_watcher.rs tracked in #1742
5318dc6 to
99aef6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1 of epic #1741 (arch: codebase architecture improvements).
Agentgod object into 4 focused sub-structs (Decompose Agent struct: extract ProviderState, SessionState, UiState, OrchestrationState #1731)anyhowfrom core library modules, replacing with typed errors (Remove anyhow from zeph-core library crate #1732)Changes
Agent struct decomposition (#1731)
Agent<C>retains core identity fields. Loose fields moved to named sub-structs:LifecycleStateProviderStateMetricsStateOrchestrationStateanyhow removal (#1732)
VaultErrorvault.rsanyhow::ErrorinVaultProvidertraitBootstrapErrorbootstrap/provider.rsanyhow::Resultin all bootstrap functionsDaemonErrordaemon.rsanyhow::ResultinComponentHandleRemaining
anyhowusage insubagent/andconfig_watcher.rstracked in #1742.Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— cleancargo nextest run --workspace --features full --lib --bins— 5423 passed, 12 skippedBootstrapError::Vault, R-I2: tightened visibility topub(super), R-I3: created follow-up refactor(zeph-core): complete anyhow removal from subagent/ and config_watcher.rs #1742)Related