refactor!: reorganize crate into domain modules and simplify LLM client API#16
Merged
Conversation
2254119 to
8283f64
Compare
Move `Workflow`, `WorkflowBuilder`, `Runtime`, `WorkflowContext`, `ContextManager` strategies, and all built-in `Step` implementations (`AgentStep`, `TransformStep`, `ConditionalStep`, `SubWorkflowStep`) behind a new `workflow` Cargo feature that is off by default.
The default build now contains only `Agent`, LLM clients, tools, events, config, and the retry/timeout utilities. Consumers that need the workflow executor must opt in: `agent-runtime = { version = \"0.4\", features = [\"workflow\"] }`.
* extract `Runtime` impl into `src/runtime/executor.rs`, gated on `workflow`; `src/runtime/mod.rs` now only re-exports it conditionally
* gate `pub mod context;`, `pub mod workflow;`, and all related re-exports + prelude entries in `src/lib.rs`
* disable `autotests` and declare each integration test target explicitly so workflow-only tests carry `required-features = [\"workflow\"]`
* gate Step-using unit tests in `src/types_test.rs` behind the feature
* mark `test_sliding_window_manager` `#[ignore]` documenting that `WorkflowBuilder::with_chat_history` is not yet wired through `build()`
BREAKING CHANGE: `Runtime`, `Workflow`, `WorkflowBuilder`, `WorkflowState`, `WorkflowContext`, `ContextManager`, all `*Manager` context strategies, the `Step` trait, and all `*Step` types are no longer available in the default build. Enable the `workflow` feature to restore them.
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.
refactor!: reorganize crate into domain modules and simplify LLM client API
BREAKING CHANGE: removes the
ChatClientwrapper struct, deletes allsrc/bin/*demos, and moves several top-level modules into directory-basedsubmodules. Public re-exports are preserved where possible, but downstream
code constructing
ChatClientor importing from the old paths must update.ChatClientwrapper withpub type LlmClient = Arc<dyn GenericChatClient>; agents now take the client viaAgent::new(cfg).with_client(client)instead ofwith_llm_clienttool.rs,tools/, andtool_loop_detection.rsinto a single
tools/module (registry,native,mcp,loop_detection,builtin)workflow.rs+step.rs+step_impls.rsintoworkflow/{mod,step,steps/{agent,transform,conditional,subworkflow}}context.rs+context_strategies.rsintocontext/{mod,strategies/{token_budget,sliding_window,summarization, message_type}}runtime.rs,retry.rs, andtimeout.rsunderruntime/agent.rsandevent.rsto directorymodules with co-located
tests.rsEventStream::from_offset->get_from_offsettosatisfy
wrong_self_conventionclippy.toml,Makefile.toml,rust-toolchain.tomlsrc/bin/*demos (moved/retained viacrates/agent-discourse)matching the new API