Repository navigation
feat: add interactive chat for multi-turn agent sessions #34
Description
Goal: Give a human a simple, interactive multi-turn conversation with an agent from the terminal, without re-typing identifiers on every turn.
User story: As a developer exploring an agent, I want an interactive chat that remembers the conversation, so that I can go back and forth without re-passing --context-id and --task-id each turn.
Priority: P2 · Area: CLI code
Problem
Driving a multi-turn conversation today means running a2a send repeatedly and manually carrying --context-id (and --task-id while a task is paused) from one command's output into the next. There is no interactive session command:
$ a2a chat --help
Error: unknown command "chat" for "a2a"
Proposed behavior
Add an interactive a2a chat command for a back-and-forth session with one agent:
a2a chat -a <agent>
- Reads a message from the prompt, sends it, prints the agent's reply, and loops.
- Carries the
contextIdacross turns automatically (and the activetaskIdwhile a task is interrupted), so the user never copies identifiers by hand — the CLI stays stateless between processes, but a livechatsession holds this in memory for its own duration only. - On
INPUT_REQUIRED, prompts for the reply and continues the same task; onAUTH_REQUIRED, stops and explains what's needed. - Prints the
taskId/contextIdso a user can resume later witha2a send. - Plain, readable output; exits cleanly on EOF/
Ctrl-Dor a/quitcommand.
Interactive-safety requirements
chatis interactive-only: it must auto-degrade to non-interactivesendbehavior when stdout is not a terminal, and must never block waiting on input in a pipe/CI context.- It must not be the default command; a script's behavior must not change because it happened to run in a terminal.
Who benefits
- Developers exploring or debugging an agent conversationally.
- Anyone giving a quick demo of an agent from the terminal.
Acceptance criteria
-
a2a chat -a <agent>runs a multi-turn loop, carryingcontextId/taskIdautomatically. - Handles
INPUT_REQUIRED(prompt + continue) andAUTH_REQUIRED(stop + explain). - Auto-degrades / does not block when stdout is not a terminal.
-
/quitand EOF exit cleanly; the lasttaskId/contextIdare printed for later resume.
Environment
- CLI version:
a2a version v0.0.0-…1e29dfe94f95+dirty - OS: Linux x86_64
Notes
This is an ergonomics layer built entirely on top of the existing send/task behavior — it introduces no new protocol behavior, only an interactive front-end that manages identifiers for the length of the session.
Activity
ConnorMoss02 commentedon Sep 29, 2026
I'd like to take this if nobody's on it. I'll follow the proposed behavior above and open a PR.