Skip to content

Add prompt readiness hints for interactive agents#2532

Open
nikhilachale wants to merge 2 commits into
AgentWrapper:mainfrom
nikhilachale:codex/clean-upstream
Open

Add prompt readiness hints for interactive agents#2532
nikhilachale wants to merge 2 commits into
AgentWrapper:mainfrom
nikhilachale:codex/clean-upstream

Conversation

@nikhilachale

Copy link
Copy Markdown
Collaborator

Summary

Adds prompt-readiness handling for interactive agent adapters that receive their initial worker task after the CLI starts.

Why

Some terminal-based agents are not ready to accept input immediately after process launch. AO could send the worker prompt
too early, causing it to be ignored, misparsed, or injected before the interactive prompt was active.

Changes

  • Added optional AgentPromptReadinessProvider support for adapters.
  • Added PromptReadinessHints with delay, polling, output patterns, timeout, and line count.
  • Updated the session manager to wait for readiness before sending PromptDeliveryAfterStart prompts.
  • Falls back to sending the prompt after timeout so startup does not block indefinitely.
  • Added readiness hints for Cline, Kimi, Kiro, and Crush.
  • Adjusted Kiro and Crush worker launches so prompted workers stay interactive and receive prompts after startup.
  • Added tests for readiness waits, timeout fallback, and adapter hint coverage.

Verification

GOCACHE=/private/tmp/go-build-ao-agent-readiness go test ./internal/adapters/agent/cline ./internal/adapters/agent/kimi ./
internal/adapters/agent/kiro ./internal/adapters/agent/crush ./internal/session_manager

- Implemented PromptReadinessHints method in the Cline, Crush, Kimi, and Kiro agents to provide initial delay, patterns, poll interval, timeout, and line count for waiting on the interactive prompt before injecting the first task.
- Updated GetPromptDeliveryStrategy methods to accommodate the new behavior for agents that require readiness hints.
- Enhanced session manager to wait for prompt readiness before delivering the first task prompt.
- Added tests for the new readiness hints functionality in respective agent test files and session manager tests.
@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Fix Copilot worker startup so initial tasks execute immediately.

Previously the Copilot adapter launched copilot interactively and relied on AO to inject the prompt into the
terminal after startup. In practice this could leave the task sitting in the input buffer until the user opened the
worker and pressed Enter.

This changes prompted Copilot launches to use copilot --interactive <prompt>, which keeps the interactive terminal
session alive while automatically submitting the initial task. The adapter now reports PromptDeliveryInCommand, so
the session manager no longer performs post-start prompt injection for Copilot.

Tested:

  • GOCACHE=/private/tmp/go-build-ao-copilot go test ./internal/adapters/agent/copilot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant