<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rubyllm-2-0-the-agentic-loop-exposed-lnhlzosqk" -->

---
title: RubyLLM 2.0: The Agentic Loop, Exposed | daily.dev
description: RubyLLM 2.0 decomposes the previously sealed agentic loop into explicit verbs: ask_later, generate, run_tools, step, and complete?, letting developers drive...
canonical: https://daily.dev/posts/rubyllm-2-0-the-agentic-loop-exposed-lnhlzosqk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: RubyLLM 2.0: The Agentic Loop, Exposed | daily.dev
og:description: RubyLLM 2.0 decomposes the previously sealed agentic loop into explicit verbs: ask_later, generate, run_tools, step, and complete?, letting developers drive...
og:url: https://daily.dev/posts/rubyllm-2-0-the-agentic-loop-exposed-lnhlzosqk
og:image: https://api.daily.dev/og/posts/lnhlZosQk.png
og:image:alt: RubyLLM 2.0: The Agentic Loop, Exposed
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# RubyLLM 2.0: The Agentic Loop, Exposed

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 4 min read · 0 upvotes · 0 comments

## Summary

RubyLLM 2.0 decomposes the previously sealed agentic loop into explicit verbs: ask_later, generate, run_tools, step, and complete?, letting developers drive the model-call/tool-run cycle themselves. This enables per-step persistence, resumable mid-tool-round execution, distributing turns across background jobs, and cancellation via chat.cancel! that checks a database record instead of relying on pub/sub or Redis. The old halt(

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://paolino.me/rubyllm-2-0-agentic-loop>

## Questions this post answers

### What changed in RubyLLM 2.0's agentic loop compared to 1.x?

RubyLLM 2.0 exposes the agentic loop as separate verbs (ask_later, generate, run_tools, step, complete?, complete) instead of sealing it inside ask. Developers can now drive each model call and tool execution manually, checkpoint between steps, resume mid-tool-round after a crash, and distribute turns across background jobs, while ask still works as before.

_Ruby developers rebuilding agent code around RubyLLM 2.0 can track breaking changes like this on daily.dev._

### How do I cancel a running RubyLLM chat in Rails from another process?

Call chat.cancel! on the chat record; acts_as_chat stores the cancellation request in the database, so a background job checks that record at its next checkpoint (before a model call, before a tool call, or between streamed chunks) and raises RubyLLM::CancelledError, requiring no Redis flag or pub/sub channel.

_Developers wiring stop buttons into AI chat UIs can compare implementation approaches on daily.dev._

### How do I stop a RubyLLM tool loop now that halt() is removed in version 2.0?

RubyLLM::Tool::Halt and the halt("done") return value are removed in 2.0; stopping the loop is now the caller's responsibility, done by breaking out of a manual step loop, using chat.with_tool_options(calls: :one) to force a single tool call per response, or counting step/generate calls for a round budget.

_Teams migrating agent tool logic off deprecated APIs can follow changes like this on daily.dev._

## Similar posts on daily.dev

- [RubyLLM 2.x: What's new for your agents](https://daily.dev/posts/rubyllm-2-x-what-s-new-for-your-agents-urumsmse3) · Ruby Flow · 0 upvotes · 0 comments
- [RubyLLM 2.0: Agents That Wait, and Everything Else Your Providers Can Do](https://daily.dev/posts/rubyllm-2-0-agents-that-wait-and-everything-else-your-providers-can-do-80izxvklc) · RUBYLAND · 0 upvotes · 0 comments
- [The Agentic Loop: Three loops in a trench coat](https://daily.dev/posts/the-agentic-loop-three-loops-in-a-trench-coat-jg81mltng) · Hacker News · 0 upvotes · 0 comments
- [RubyLLM 1.12: Agents Are Just LLMs with Tools](https://daily.dev/posts/rubyllm-1-12-agents-are-just-llms-with-tools-scy0gxemk) · RUBYLAND · 0 upvotes · 0 comments
- [Home](https://daily.dev/posts/home-l9pbnpdgr) · Ruby Flow · 0 upvotes · 0 comments

---

Tags: [#ruby](https://daily.dev/tags/ruby), [#rails](https://daily.dev/tags/rails), [#agentic-ai](https://daily.dev/tags/agentic-ai)

[View this post on daily.dev](https://daily.dev/posts/rubyllm-2-0-the-agentic-loop-exposed-lnhlzosqk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"RubyLLM 2.0: The Agentic Loop, Exposed","url":"https://daily.dev/posts/rubyllm-2-0-the-agentic-loop-exposed-lnhlzosqk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rubyllm-2-0-the-agentic-loop-exposed-lnhlzosqk"},"datePublished":"2026-08-28T11:58:49.303Z","dateModified":"2026-08-28T17:52:56.620Z","description":"RubyLLM 2.0 decomposes the previously sealed agentic loop into explicit verbs: ask_later, generate, run_tools, step, and complete?, letting developers drive...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/770741af549103a01f63b495f61574fb?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/770741af549103a01f63b495f61574fb?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rubyllm-2-0-the-agentic-loop-exposed-lnhlzosqk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ruby,rails,agentic-ai","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"RubyLLM 2.0: The Agentic Loop, Exposed"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/rubyllm-2-0-the-agentic-loop-exposed-lnhlzosqk#faq","mainEntity":[{"@type":"Question","name":"What changed in RubyLLM 2.0's agentic loop compared to 1.x?","acceptedAnswer":{"@type":"Answer","text":"RubyLLM 2.0 exposes the agentic loop as separate verbs (ask_later, generate, run_tools, step, complete?, complete) instead of sealing it inside ask. Developers can now drive each model call and tool execution manually, checkpoint between steps, resume mid-tool-round after a crash, and distribute turns across background jobs, while ask still works as before. Ruby developers rebuilding agent code around RubyLLM 2.0 can track breaking changes like this on daily.dev."}},{"@type":"Question","name":"How do I cancel a running RubyLLM chat in Rails from another process?","acceptedAnswer":{"@type":"Answer","text":"Call chat.cancel! on the chat record; acts_as_chat stores the cancellation request in the database, so a background job checks that record at its next checkpoint (before a model call, before a tool call, or between streamed chunks) and raises RubyLLM::CancelledError, requiring no Redis flag or pub/sub channel. Developers wiring stop buttons into AI chat UIs can compare implementation approaches on daily.dev."}},{"@type":"Question","name":"How do I stop a RubyLLM tool loop now that halt() is removed in version 2.0?","acceptedAnswer":{"@type":"Answer","text":"RubyLLM::Tool::Halt and the halt(\"done\") return value are removed in 2.0; stopping the loop is now the caller's responsibility, done by breaking out of a manual step loop, using chat.with_tool_options(calls: :one) to force a single tool call per response, or counting step/generate calls for a round budget. Teams migrating agent tool logic off deprecated APIs can follow changes like this on daily.dev."}}]}
```

