Skip to content
Agent

Interactive Agents

by dcramer

AI Summary

Interactive Agents enables multi-level agent communication through a stack-based model where subagents take over conversation threads interactively until completion. Developers building complex agent systems with nested tool calls and dynamic routing will benefit from this orchestration pattern.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to set up the "Interactive Agents" agent in my project.

Please run this command in my terminal:
# Add AGENTS.md to your project root
curl --retry 3 --retry-delay 2 --retry-all-errors -o AGENTS.md "https://raw.githubusercontent.com/dcramer/ash/main/specs/interactive-agents.md"

Then explain what the agent does and how to invoke it.

Description

> Stack-based model for interactive subagent communication

Overview

When the main agent invokes a skill or agent via use_skill / use_agent, the subagent takes over the conversation thread. The user talks directly to the subagent until it calls complete(result), then control returns to the caller. Subagents can nest arbitrarily: main → skill-writer → research. This replaces the batch execution model (where subagents ran to completion internally) with an interactive model managed by a provider-level orchestration loop.

Interactive Agents

> Stack-based model for interactive subagent communication Files: src/ash/agents/types.py, src/ash/agents/executor.py, src/ash/tools/builtin/skills.py, src/ash/tools/builtin/complete.py, src/ash/providers/telegram/handlers/message_handler.py

MUST

• Subagent text responses (no tool calls) are sent directly to the user • User messages are routed to the top-of-stack subagent • complete(result) tool pops the subagent and returns result to parent as tool_result • Stack supports arbitrary nesting depth (main → skill → agent → ...) • Parent resumes when child completes — may call LLM again, produce text, call more tools, or spawn another child • Max iterations per frame are enforced; exceeding cascades error to parent • ChildActivated(BaseException) propagates through except Exception handlers • Main agent's paused state (session, iteration count) is preserved as a StackFrame • Provider routes messages based on stack state: empty → main agent, non-empty → top of stack • Built-in skills (claude-code) bypass the stack and use their own execution path

SHOULD

• Log stack depth changes (push/pop) for debugging • Provide clear error messages when max iterations are hit • Clean up stack state when errors occur

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1mo ago
Active
AdoptionUnder 100 stars
61 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars61
Forks3
Issues5
Updated1mo ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code
Claude.ai