Skip to content

Changed: Migrate examples to agent builder pattern#13

Merged
Sewer56 merged 3 commits intomainfrom
refactor/agent-builder-pattern
Jan 18, 2026
Merged

Changed: Migrate examples to agent builder pattern#13
Sewer56 merged 3 commits intomainfrom
refactor/agent-builder-pattern

Conversation

@Sewer56
Copy link
Copy Markdown
Member

@Sewer56 Sewer56 commented Jan 18, 2026

Summary

  • Added AgentBuilderExt trait for serdesai to bridge Tool<Deps> to AgentBuilder
  • Updated rig examples to use client.agent().tool() instead of ToolSet::builder()
  • Updated serdesai examples to use AgentBuilderExt::tool()
  • Updated READMEs and doc comments to reflect the new patterns

Details

The agent builder pattern is the idiomatic way to construct agents with tools, replacing the deprecated ToolSet::builder().static_tool() approach.

Rig Examples

// Before
let _toolset = ToolSet::builder()
    .static_tool(pb.track(ReadTool::new()))
    .build();

// After
let agent = client
    .agent("gpt-4o")
    .tool(pb.track(ReadTool::<true>::new()))
    .preamble(&pb.build())
    .build();

SerdesAI Examples

Created AgentBuilderExt trait with .tool() method to bridge the gap between serdes_ai::tools::Tool and serdes_ai::agent::ToolExecutor.

let agent = AgentBuilder::<(), String>::from_model("openai:gpt-4o")?
    .tool(pb.track(ReadTool::<true>::new()))
    .system_prompt(pb.build())  // Called LAST after tracking tools
    .build();

- Added AgentBuilderExt trait for serdesai to bridge Tool<Deps> to AgentBuilder
- Updated rig examples to use client.agent().tool() instead of ToolSet::builder()
- Updated serdesai examples to use AgentBuilderExt::tool_impl()
- Updated READMEs and doc comments to reflect the new patterns
- Simplified convert.rs tests by removing unnecessary Result wrapping

The agent builder pattern is the idiomatic way to construct agents with tools,
replacing the deprecated ToolSet::builder().static_tool() approach.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 18, 2026

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.93%. Comparing base (514092b) to head (3b3f71d).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/llm-coding-tools-serdesai/src/agent_ext.rs 0.00% 7 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
- Coverage   59.26%   58.93%   -0.33%     
==========================================
  Files          46       47       +1     
  Lines        1274     1281       +7     
==========================================
  Hits          755      755              
- Misses        519      526       +7     
Flag Coverage Δ
unittests 58.93% <0.00%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/llm-coding-tools-core/src/preamble.rs 100.00% <ø> (ø)
src/llm-coding-tools-serdesai/src/convert.rs 84.37% <ø> (ø)
src/llm-coding-tools-serdesai/src/agent_ext.rs 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Renamed AgentBuilderExt::tool_impl() to tool() to match rig's API
- Changed ignore to no_run in doc examples
- Removed needless borrows in system_prompt() calls
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 18, 2026

Walkthrough

This PR replaces ToolSet/ToolRegistry examples with an agent-builder workflow: tools are registered via chained .tool(...)/pb.track(...) calls and a built preamble/system prompt is attached. Examples and READMEs now show creating a provider client (OpenAI), building an agent with tracked tools, and running prompts; many example mains were changed to return Result. It adds AgentBuilderExt (serdesai) and new public modules (rig: allowed, bash, todo, webfetch; serdesai: agent_ext, todo, webfetch), and centralizes crate README inclusion via include_str!. No existing public function signatures were removed.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective of the changeset: migrating examples from ToolSet-based to agent builder pattern.
Description check ✅ Passed The description provides a comprehensive summary with clear before/after examples and explains both the motivation and implementation details across rig and serdesai.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/agent-builder-pattern

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e071eb7 and 3b3f71d.

📒 Files selected for processing (1)
  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.rs

📄 CodeRabbit inference engine (src/AGENTS.md)

src/**/*.rs: Keep modules under 500 lines (excluding tests); split larger modules into multiple files
Document all public items with /// documentation comments
Add examples in documentation where helpful for public items
Use //! for module-level documentation comments
Focus comments on explaining 'why' rather than 'what' the code does
Use [TypeName] rustdoc links instead of backticks for type references in documentation
Preallocate collections when size is known or estimable using String::with_capacity(), Vec::with_capacity(), or BufReader::with_capacity()
Prefer &str and &[T] return types over owned types when lifetimes allow
Use Cow<'_, str> for conditional ownership scenarios such as with String::from_utf8_lossy
Use &'static str for compile-time constant strings
Reuse buffers by calling .clear() and reusing Vec/String instead of reallocating new instances
Use const generics for compile-time branching (e.g., <const LINE_NUMBERS: bool>) to enable zero-cost abstractions
Apply #[inline] attribute to small, hot-path functions
Prefer core crate over std where possible (e.g., core::mem over std::mem)
Stream data instead of loading entire files into memory when possible
Use memchr crate for fast byte searching instead of manual iteration
Place use statements inside functions only for #[cfg] conditional compilation

Files:

  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
src/llm-coding-tools-serdesai/**/*.rs

📄 CodeRabbit inference engine (src/AGENTS.md)

For llm-coding-tools-serdesai crate, implement async Tool traits; the blocking feature only applies to llm-coding-tools-core

Files:

  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/llm-coding-tools-serdesai/**/*.rs : For `llm-coding-tools-serdesai` crate, implement async `Tool` traits; the `blocking` feature only applies to `llm-coding-tools-core`
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/llm-coding-tools-rig/**/*.rs : For `llm-coding-tools-rig` and `llm-coding-tools-serdesai` crates, only implement async `Tool` traits; the `blocking` feature only applies to `llm-coding-tools-core`
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/llm-coding-tools-serdesai/**/*.rs : For `llm-coding-tools-serdesai` crate, implement async `Tool` traits; the `blocking` feature only applies to `llm-coding-tools-core`

Applied to files:

  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/llm-coding-tools-rig/**/*.rs : For `llm-coding-tools-rig` and `llm-coding-tools-serdesai` crates, only implement async `Tool` traits; the `blocking` feature only applies to `llm-coding-tools-core`

Applied to files:

  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: All changes must pass the full build, test, and lint suite: `cargo build`, `cargo test`, `cargo clippy` with `-D warnings`, and `cargo fmt` without errors for all three workspace crates

Applied to files:

  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
🧬 Code graph analysis (1)
src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs (2)
src/llm-coding-tools-serdesai/examples/serdesai-basic.rs (1)
  • main (17-55)
src/llm-coding-tools-rig/examples/rig-sandboxed.rs (1)
  • main (20-65)
🔇 Additional comments (4)
src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs (4)

10-16: LGTM.
Clear doc update and import adjustments.


18-33: LGTM.
No issues in this setup and tool initialization block.


35-44: LGTM.
The builder chain is straightforward and cohesive.


46-60: LGTM.
Output and execution flow reads cleanly.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.MD (1)

69-78: Update example command names to match actual files.

The documented example names don't match the actual example files. The commands as written will fail:

  • basic → should be rig-basic
  • sandboxed → should be rig-sandboxed
  • full_agent example file doesn't exist

Update lines 69-78 to use rig-basic and rig-sandboxed, or remove the full_agent reference.

🤖 Fix all issues with AI agents
In `@src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs`:
- Around line 29-33: The tool constructors (ReadTool::new, WriteTool::new,
EditTool::new, GlobTool::new, GrepTool::new) currently call unwrap() and will
panic on error; replace each unwrap() with the ? operator to propagate errors
from main (e.g., let read: ReadTool<true> =
ReadTool::new(allowed_paths.clone())?; and similarly for write, edit, glob,
grep), keeping the same variable names (read, write, edit, glob, grep) and
cloning of allowed_paths as before; ensure the surrounding function signature
remains Result<(), Box<dyn std::error::Error>> so the ? operator compiles.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 514092b and bbae737.

📒 Files selected for processing (13)
  • README.MD
  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-core/src/preamble.rs
  • src/llm-coding-tools-rig/README.md
  • src/llm-coding-tools-rig/examples/rig-basic.rs
  • src/llm-coding-tools-rig/examples/rig-sandboxed.rs
  • src/llm-coding-tools-rig/src/lib.rs
  • src/llm-coding-tools-serdesai/README.md
  • src/llm-coding-tools-serdesai/examples/serdesai-basic.rs
  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
  • src/llm-coding-tools-serdesai/src/agent_ext.rs
  • src/llm-coding-tools-serdesai/src/convert.rs
  • src/llm-coding-tools-serdesai/src/lib.rs
🧰 Additional context used
📓 Path-based instructions (3)
src/**/*.rs

📄 CodeRabbit inference engine (src/AGENTS.md)

src/**/*.rs: Keep modules under 500 lines (excluding tests); split larger modules into multiple files
Document all public items with /// documentation comments
Add examples in documentation where helpful for public items
Use //! for module-level documentation comments
Focus comments on explaining 'why' rather than 'what' the code does
Use [TypeName] rustdoc links instead of backticks for type references in documentation
Preallocate collections when size is known or estimable using String::with_capacity(), Vec::with_capacity(), or BufReader::with_capacity()
Prefer &str and &[T] return types over owned types when lifetimes allow
Use Cow<'_, str> for conditional ownership scenarios such as with String::from_utf8_lossy
Use &'static str for compile-time constant strings
Reuse buffers by calling .clear() and reusing Vec/String instead of reallocating new instances
Use const generics for compile-time branching (e.g., <const LINE_NUMBERS: bool>) to enable zero-cost abstractions
Apply #[inline] attribute to small, hot-path functions
Prefer core crate over std where possible (e.g., core::mem over std::mem)
Stream data instead of loading entire files into memory when possible
Use memchr crate for fast byte searching instead of manual iteration
Place use statements inside functions only for #[cfg] conditional compilation

Files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-core/src/preamble.rs
  • src/llm-coding-tools-rig/src/lib.rs
  • src/llm-coding-tools-serdesai/examples/serdesai-basic.rs
  • src/llm-coding-tools-serdesai/src/agent_ext.rs
  • src/llm-coding-tools-rig/examples/rig-basic.rs
  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
  • src/llm-coding-tools-serdesai/src/convert.rs
  • src/llm-coding-tools-rig/examples/rig-sandboxed.rs
  • src/llm-coding-tools-serdesai/src/lib.rs
src/llm-coding-tools-rig/**/*.rs

📄 CodeRabbit inference engine (src/AGENTS.md)

For llm-coding-tools-rig and llm-coding-tools-serdesai crates, only implement async Tool traits; the blocking feature only applies to llm-coding-tools-core

Files:

  • src/llm-coding-tools-rig/src/lib.rs
  • src/llm-coding-tools-rig/examples/rig-basic.rs
  • src/llm-coding-tools-rig/examples/rig-sandboxed.rs
src/llm-coding-tools-serdesai/**/*.rs

📄 CodeRabbit inference engine (src/AGENTS.md)

For llm-coding-tools-serdesai crate, implement async Tool traits; the blocking feature only applies to llm-coding-tools-core

Files:

  • src/llm-coding-tools-serdesai/examples/serdesai-basic.rs
  • src/llm-coding-tools-serdesai/src/agent_ext.rs
  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
  • src/llm-coding-tools-serdesai/src/convert.rs
  • src/llm-coding-tools-serdesai/src/lib.rs
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/llm-coding-tools-rig/**/*.rs : For `llm-coding-tools-rig` and `llm-coding-tools-serdesai` crates, only implement async `Tool` traits; the `blocking` feature only applies to `llm-coding-tools-core`
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/llm-coding-tools-serdesai/**/*.rs : For `llm-coding-tools-serdesai` crate, implement async `Tool` traits; the `blocking` feature only applies to `llm-coding-tools-core`
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/*.rs : Use `//!` for module-level documentation comments

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-rig/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/*.rs : Document all public items with `///` documentation comments

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-rig/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/llm-coding-tools-serdesai/**/*.rs : For `llm-coding-tools-serdesai` crate, implement async `Tool` traits; the `blocking` feature only applies to `llm-coding-tools-core`

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-core/src/preamble.rs
  • src/llm-coding-tools-rig/src/lib.rs
  • src/llm-coding-tools-serdesai/examples/serdesai-basic.rs
  • src/llm-coding-tools-serdesai/src/agent_ext.rs
  • src/llm-coding-tools-rig/examples/rig-basic.rs
  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
  • README.MD
  • src/llm-coding-tools-serdesai/src/convert.rs
  • src/llm-coding-tools-rig/README.md
  • src/llm-coding-tools-rig/examples/rig-sandboxed.rs
  • src/llm-coding-tools-serdesai/src/lib.rs
  • src/llm-coding-tools-serdesai/README.md
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/*.rs : Prefer `core` crate over `std` where possible (e.g., `core::mem` over `std::mem`)

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-rig/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/llm-coding-tools-rig/**/*.rs : For `llm-coding-tools-rig` and `llm-coding-tools-serdesai` crates, only implement async `Tool` traits; the `blocking` feature only applies to `llm-coding-tools-core`

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-core/src/preamble.rs
  • src/llm-coding-tools-rig/src/lib.rs
  • src/llm-coding-tools-serdesai/examples/serdesai-basic.rs
  • src/llm-coding-tools-serdesai/src/agent_ext.rs
  • src/llm-coding-tools-rig/examples/rig-basic.rs
  • src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs
  • README.MD
  • src/llm-coding-tools-serdesai/src/convert.rs
  • src/llm-coding-tools-rig/README.md
  • src/llm-coding-tools-rig/examples/rig-sandboxed.rs
  • src/llm-coding-tools-serdesai/src/lib.rs
  • src/llm-coding-tools-serdesai/README.md
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/*.rs : Add examples in documentation where helpful for public items

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-rig/src/lib.rs
  • src/llm-coding-tools-serdesai/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: All changes must pass the full build, test, and lint suite: `cargo build`, `cargo test`, `cargo clippy` with `-D warnings`, and `cargo fmt` without errors for all three workspace crates

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-rig/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/Cargo.toml : Keep dependency footprint minimal and avoid unnecessary dependencies

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
  • src/llm-coding-tools-rig/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/Cargo.toml : The `async` feature flag is for internal use only and should not be enabled directly; use the `tokio` feature instead for async functionality

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/Cargo.toml : Enable only the `tokio` feature (default) for async mode with tokio runtime, or the `blocking` feature for sync/blocking mode - never enable both `async` and `blocking` features simultaneously as they are mutually exclusive and cause compile errors

Applied to files:

  • src/llm-coding-tools-core/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/*.rs : Use [`TypeName`] rustdoc links instead of backticks for type references in documentation

Applied to files:

  • src/llm-coding-tools-rig/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Applies to src/**/*.rs : Focus comments on explaining 'why' rather than 'what' the code does

Applied to files:

  • src/llm-coding-tools-rig/src/lib.rs
📚 Learning: 2026-01-17T06:12:43.046Z
Learnt from: CR
Repo: Sewer56/llm-coding-tools PR: 0
File: src/AGENTS.md:0-0
Timestamp: 2026-01-17T06:12:43.046Z
Learning: Place core operation implementations (read, write, edit, glob, grep, bash, etc.) in `src/operations/` directory within `llm-coding-tools-core`

Applied to files:

  • src/llm-coding-tools-rig/src/lib.rs
  • src/llm-coding-tools-serdesai/src/lib.rs
🧬 Code graph analysis (4)
src/llm-coding-tools-serdesai/examples/serdesai-basic.rs (3)
src/llm-coding-tools-serdesai/src/todo.rs (1)
  • create_todo_tools (145-152)
src/llm-coding-tools-rig/examples/rig-basic.rs (1)
  • main (18-46)
src/llm-coding-tools-core/src/preamble.rs (1)
  • new (96-98)
src/llm-coding-tools-rig/examples/rig-basic.rs (4)
src/llm-coding-tools-rig/examples/rig-sandboxed.rs (1)
  • main (20-65)
src/llm-coding-tools-serdesai/examples/serdesai-basic.rs (1)
  • main (17-55)
src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs (1)
  • main (18-63)
src/llm-coding-tools-core/src/preamble.rs (1)
  • new (96-98)
src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs (5)
src/llm-coding-tools-rig/examples/rig-basic.rs (1)
  • main (18-46)
src/llm-coding-tools-rig/examples/rig-sandboxed.rs (1)
  • main (20-65)
src/llm-coding-tools-serdesai/examples/serdesai-basic.rs (1)
  • main (17-55)
src/llm-coding-tools-core/src/preamble.rs (1)
  • new (96-98)
src/llm-coding-tools-core/src/path/allowed.rs (1)
  • allowed_paths (84-86)
src/llm-coding-tools-rig/examples/rig-sandboxed.rs (1)
src/llm-coding-tools-core/src/preamble.rs (1)
  • new (96-98)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-and-test (windows-latest, x86_64-pc-windows-msvc, false)
  • GitHub Check: build-and-test (macos-latest, aarch64-apple-darwin, false)
  • GitHub Check: build-and-test (ubuntu-latest, x86_64-unknown-linux-gnu, false)
🔇 Additional comments (17)
src/llm-coding-tools-serdesai/src/convert.rs (1)

144-164: LGTM! Test simplifications improve consistency.

The direct calls to core_error_to_serdes align with the pattern already used in other tests in this file (e.g., io_error_maps_to_execution_error, execution_error_maps_to_execution_failed). Removing the unnecessary Result wrapping and unwrap_err makes the test intent clearer.

src/llm-coding-tools-core/src/lib.rs (1)

1-1: LGTM - Documentation sourced from README.

Using include_str! with CARGO_PKG_README ensures crate documentation stays in sync with the README file, following the single source of truth principle.

src/llm-coding-tools-core/src/preamble.rs (1)

122-130: LGTM - Documentation updated to reflect agent builder pattern.

The example correctly demonstrates the new idiomatic pattern: tracking tools with pb.track() and attaching the preamble via .preamble(&pb.build()) on the agent builder.

src/llm-coding-tools-rig/src/lib.rs (2)

1-46: LGTM - Well-structured public API expansion.

The expanded re-exports and the allowed_tools namespace module provide a clean API surface for the agent builder pattern. The namespace approach correctly avoids conflicts between absolute and allowed module types with identical names.


48-72: LGTM - Test validates the new API.

The test correctly verifies that [PreambleBuilder] works with the real tool types and that tracked tools are returned unchanged.

src/llm-coding-tools-rig/examples/rig-sandboxed.rs (1)

45-62: LGTM - Correct agent builder pattern for sandboxed tools.

The example correctly demonstrates:

  1. Creating tools with a shared AllowedPathResolver
  2. Tracking tools via pb.track() during the builder chain
  3. Building and attaching the preamble after all tools are tracked

The evaluation order ensures all .tool(pb.track(...)) calls complete before .preamble(&pb.build()) is evaluated.

src/llm-coding-tools-rig/examples/rig-basic.rs (1)

17-45: LGTM - Clean migration to agent builder pattern.

The example correctly demonstrates the new workflow:

  1. Creating shared state (TodoTools)
  2. Building an agent with chained .tool() calls
  3. Tracking tools for preamble generation
  4. Integrating the preamble via .preamble(&pb.build())

This aligns well with the serdesai examples that use .tool_impl() and .system_prompt().

README.MD (1)

41-65: LGTM - Quick Start updated for agent builder pattern.

The example correctly demonstrates the new workflow with PreambleBuilder, tool tracking, and agent construction via the builder pattern. Using rust,no_run is appropriate since this requires an API key.

src/llm-coding-tools-rig/README.md (2)

32-55: Quick Start snippet cleanly reflects the new tool-tracking flow.


84-94: Usage snippet remains clear for absolute vs allowed tools.

src/llm-coding-tools-serdesai/src/lib.rs (2)

1-1: Crate docs sourced from the README are a nice touch.


5-5: Public agent_ext module exposure looks appropriate.

src/llm-coding-tools-serdesai/src/agent_ext.rs (1)

1-79: Adapter + extension trait form a clean bridge for tool registration.

src/llm-coding-tools-serdesai/examples/serdesai-basic.rs (1)

6-53: Example flow is cohesive after the agent-builder migration.

src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs (1)

35-60: Sandboxed agent build/readout flow looks good.

src/llm-coding-tools-serdesai/README.md (2)

31-62: Quick Start block aligns cleanly with the new builder pattern.


71-98: Usage + examples remain consistent with the updated API.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread src/llm-coding-tools-serdesai/examples/serdesai-sandboxed.rs Outdated
Propagate errors from tool constructors instead of panicking.
@Sewer56 Sewer56 merged commit 00eefc9 into main Jan 18, 2026
5 of 6 checks passed
@Sewer56 Sewer56 deleted the refactor/agent-builder-pattern branch January 18, 2026 11:50
Sewer56 added a commit that referenced this pull request Mar 30, 2026
Changed: Migrate examples to agent builder pattern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant