a2aproject / a2aproject/A2A

[Proposal]: Plan Mode Extension for Multi-Phase Agent Workflows

Open
#1,320 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
25.7k
Forks
2.6k
Avg merge
3d 6h
Merged PRs (30d)
16

Description

## Summary

This proposal introduces **Plan Mode**, a protocol extension for multi-phase agent workflows that require iterative user input before task execution.

Plan Mode addresses a common pattern in sophisticated AI agents where the agent needs to:
1. **Gather requirements** through clarifying questions
2. **Discover options** and present them to users
3. **Get user selection** from discovered items
4. **Preview execution plans** before committing
5. **Propose recurring schedules** for automation

## Motivation

### Problem Statement

The current A2A protocol supports direct task execution and basic `input-required` states, but lacks standardized patterns for multi-step workflows where agents need iterative user collaboration before execution.

### Real-World Use Cases

- **Research agents**: Clarify scope → discover sources → select relevant ones → preview analysis plan
- **Data analysis agents**: Understand requirements → discover datasets → select columns → preview transformations
- **Automation agents**: Clarify intent → show execution plan → get approval before running
- **Shopping/booking agents**: Understand needs → discover options → filter/select → preview before purchase

### Current Limitations

The existing `input-required` state is binary - it doesn't specify:
- What type of input (free-form vs structured questions vs selection)
- Where in a multi-phase workflow the agent is
- What the agent has discovered so far
- What execution plan the agent proposes

## Proposed Extension

### New Task States

```typescript
enum TaskState {
// Existing states...

// New Plan Mode states
"clarification-required", // Agent needs answers to questions
"selection-required", // Agent needs user to select from discovered items
"approval-required", // Agent needs approval of execution plan
"schedule-proposed" // Agent proposes a recurring schedule
}
```

### New Message Types

**1. Clarification Request** - Structured questions with types (text, single_choice, multi_choice, etc.)

**2. Discovery Result** - Items found by the agent for user review

**3. Selection Request** - User picks from discovered items (min/max selection)

**4. Execution Preview** - Shows what the agent will do, with steps, duration, and warnings

**5. Schedule Proposal** - Proposes recurring task execution with cron schedule

### Agent Card Extension

```json
{
"capabilities": {
"planMode": {
"supported": true,
"phases": ["clarification", "discovery", "selection", "preview", "schedule"]
}
}
}
```

## Backward Compatibility

Fully backward compatible:
- Existing agents continue to work unchanged
- Clients can map new states to `input-required` for graceful degradation
- Plan mode is opt-in via agent card capabilities

## Reference Implementation

We have a working implementation in Python that demonstrates this pattern in production with research agents. Happy to contribute the implementation details.

## Full Proposal

The complete proposal with TypeScript interfaces, state machine diagrams, and code examples is available here:

**https://github.com/syumpx/a2a-plan-mode-proposal**

## Questions for Discussion

1. Should discovery support streaming intermediate results?
2. Should plan mode support branching based on clarification answers?
3. How should plan mode interact with task cancellation?
4. Is there interest in a formal RFC process for this?

---

We believe Plan Mode would significantly improve A2A's ability to handle sophisticated agent workflows while maintaining the protocol's simplicity. Looking forward to the community's feedback!

**Author:** Pixell Agents (@syumpx)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.