Skip to content

Rename Agent to AgentStep with agent macro#27

Merged
santib merged 2 commits intomainfrom
santib/agent-step
Mar 4, 2026
Merged

Rename Agent to AgentStep with agent macro#27
santib merged 2 commits intomainfrom
santib/agent-step

Conversation

@santib
Copy link
Member

@santib santib commented Mar 1, 2026

Summary

  • Rename Mars::AgentMars::AgentStep — clean break, no backward compat
  • agent macro: class-level DSL to wrap a RubyLLM::Agent subclass. AgentStep#run creates a new agent instance and calls .ask(input).content
  • Removed old Agent's manual RubyLLM::Chat setup (before_run/after_run, system_prompt, tools, schema instance methods) — all of that is now handled by the RubyLLM::Agent subclass natively
  • Rendering: renamed Graph::AgentGraph::AgentStep, updated include_extensions
  • Bump ruby_llm dependency to ~> 1.12 (for RubyLLM::Agent support)

Phase 3 of the v2 refactor. Based on #26.

Test plan

  • AgentStep.agent stores/retrieves agent class
  • AgentStep#run delegates to agent .new.ask(input).content
  • Inherits name, formatter, hooks from Runnable
  • All 64 specs pass, 0 failures
  • Rubocop clean

🤖 Generated with Claude Code

@santib santib mentioned this pull request Mar 1, 2026
10 tasks
@santib santib force-pushed the santib/runnable-refactor branch from ad45966 to 1523685 Compare March 1, 2026 20:56
@santib santib force-pushed the santib/agent-step branch from dfef5a9 to 3d5df32 Compare March 1, 2026 21:14
@santib santib force-pushed the santib/runnable-refactor branch from 1523685 to c08b53a Compare March 4, 2026 15:14
Base automatically changed from santib/runnable-refactor to main March 4, 2026 15:15
Phase 2 of the Mars v2 refactor.

- Runnable: include Hooks, add `name` (auto-derived from class via
  `step_name`), add `formatter` class-level DSL with instance fallback
- Gate, Aggregator, Sequential, Parallel: delegate `name` to Runnable
  via super instead of managing their own attr_reader
- Runnable spec: cover name derivation, formatter DSL, hooks integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@santib santib force-pushed the santib/agent-step branch from 3d5df32 to 2df0282 Compare March 4, 2026 15:16
Phase 3 of the Mars v2 refactor.

- Rename Mars::Agent → Mars::AgentStep with class-level `agent` macro
  that wraps a RubyLLM::Agent subclass
- AgentStep#run creates a new agent instance and delegates via .ask
- Remove old Agent with its manual Chat setup (before_run/after_run,
  system_prompt, tools, schema instance methods)
- Rename rendering graph module accordingly
- Bump ruby_llm dependency to ~> 1.12

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@santib santib force-pushed the santib/agent-step branch from 2df0282 to dbd1e1f Compare March 4, 2026 15:17
@santib santib merged commit 9a7a5f2 into main Mar 4, 2026
1 check passed
@santib santib deleted the santib/agent-step branch March 4, 2026 15:18
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.

2 participants