惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
WordPress大学
WordPress大学
Recent Announcements
Recent Announcements
G
Google Developers Blog
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
Check Point Blog
J
Java Code Geeks
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
量子位
A
About on SuperTechFans
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How AIClaw Keeps Agent Plans Out of Chat History with Run...
chowyu · 2026-06-14 · via DEV Community

chowyu

Most agent products eventually hit the same UX problem: complex tasks need planning, but users do not want the final answer buried under noisy TODO updates.

AIClaw handles that with an existing core feature called Runtime Plan State. Instead of storing planning as ordinary assistant text, AIClaw treats the plan as runtime state owned by the executor. The model can propose or revise a plan, but the harness validates it, persists it, streams it live, and links the final snapshot to the assistant message after execution finishes.

This post is not announcing a brand-new feature. It is a deeper look at how AIClaw already implements planning in a way that stays useful during execution without polluting the conversation itself.

The problem with chat-visible plans

If an agent writes plans directly into chat, several issues show up quickly:

  • progress updates become part of the permanent conversational transcript
  • repeated plan rewrites waste tokens and distract from the real answer
  • tool errors and retries are hard to map back to the current step
  • users can see planning noise, but still cannot reliably inspect execution state

AIClaw's approach is to separate these concerns:

  • the user sees the final answer as an answer
  • the executor keeps the plan as structured runtime state
  • the log timeline shows both plan progress and tool activity

The repository README describes this directly: AIClaw uses Plan State instead of chat-visible TODO blocks, and streaming chat plus execution logs show the plan separately from the assistant answer.

What Runtime Plan State means in AIClaw

At a high level, AIClaw's execution loop does this:

  1. Load the agent, tools, memory, files, and conversation history.
  2. Inject compact runtime context, including the current plan state.
  3. Call the model with tools.
  4. Execute tool calls and track progress.
  5. Let the harness advance the plan after success or failure.
  6. Save the final assistant response and the plan snapshot.

The plan has a small lifecycle instead of being treated like free-form prose:

pending -> running -> completed
                  -> failed
                  -> blocked
pending -> skipped

That lifecycle matters because the harness can enforce behavior the model should not be trusted to enforce by itself.

The design choice: model proposes, harness owns

In internal/agent/plan.go, the internal plan control tool supports actions such as set, update, revise, and read. But the important part is not the tool surface. The important part is ownership:

  • the model proposes plan changes
  • PlanManager normalizes and validates state
  • the store persists the active run and items
  • the executor refreshes the compact plan block before each LLM round

That split keeps the model flexible without giving it full control over task state.

For example, AIClaw enforces that only one plan item can be running at a time. The tests in internal/agent/plan_test.go explicitly verify that if multiple items are proposed as running, the plan is normalized back to a single running item.

Why the prompt stays compact

One subtle but important implementation detail is that AIClaw does not inject the full plan history into every model call.

The PromptBlock path in internal/agent/plan.go builds a compact <plan_state> block with:

  • the goal
  • the current running step
  • a short pending-step summary
  • the latest revision reason
  • numeric progress

The design notes in docs/design/agent-improvements.md call this out clearly: only the goal, current running item, remaining pending summary, and recent revision reason are injected each round so the full history does not consume context budget.

This is a practical design choice. Planning helps the model stay oriented, but dumping the whole plan transcript back into the prompt every round would work against that goal.

How execution advances the plan

The main run loop in internal/agent/run.go refreshes plan state before each model call. When tool or LLM work fails, the harness can mark the current step as failed. When a step succeeds, the harness can complete it and advance to the next pending one.

That behavior is also covered by tests:

  • a failed running step advances the next pending step into running
  • linking the final assistant message marks the last running step as completed
  • failed plans stay failed when the final message is attached

This is the difference between "the model wrote a checklist" and "the system is actually operating a task state machine."

What the user sees

From the product side, Runtime Plan State gives AIClaw a cleaner split between response and observability:

  • the final answer is not cluttered by plan chatter
  • streaming progress can still expose the live plan
  • execution logs keep the plan snapshot, assistant response, and tool timeline separate

That matters for real tool-using agents. If an agent reads files, runs commands, searches the web, or delegates to sub-agents, users need to inspect progress and failures without turning the final answer into a debug trace.

A practical example

Imagine an AIClaw agent is asked to:

  1. inspect a codebase
  2. find the cause of a failing behavior
  3. patch the code
  4. run tests
  5. summarize the result

With Runtime Plan State, the plan can exist as structured execution state while the tool timeline records the underlying work. If the test step fails, AIClaw can mark that step as failed and continue the state transition logic cleanly. If the work completes, the final answer can stay focused on outcome, not internal bookkeeping.

That is a better fit for production-style agent work than chat-visible TODO spam.

Why I think this is the right abstraction

AIClaw's design makes a strong distinction:

  • planning is operational state
  • answers are user-facing output
  • logs are for inspection

Those should not all be the same thing.

A lot of agent systems blur the line between them. AIClaw's Runtime Plan State is interesting precisely because it does not.

If you are building self-hosted agents and want both cleaner chat UX and better execution observability, this is one of the AIClaw features worth studying in the codebase.

AIClaw is open source here: github.com/chowyu12/aiclaw