agent-orchestrator/packages/integration-tests/src
prateek 91dd7cc15f
fix: keep Claude Code interactive after initial prompt (#145)
* fix: keep Claude Code interactive after initial prompt

Claude Code's -p flag runs in one-shot mode (exits after responding),
which prevents follow-up messages via `ao send`. Instead, launch Claude
interactively and deliver the initial prompt post-launch via
runtime.sendMessage().

Adds `promptDelivery` property to the Agent interface so each agent
plugin can declare whether prompts should be inlined in the launch
command or sent after the agent starts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: make post-launch prompt delivery non-fatal and add test coverage

- Move sendMessage call outside the try/catch that destroys the session.
  A prompt delivery failure should not kill a running agent — user can
  retry with `ao send`.
- Add tests: no-prompt + post-launch agent, sendMessage failure resilience,
  5s delay verification, systemPrompt/systemPromptFile alongside omitted -p.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add integration test for prompt delivery (proves bug and fix)

Two real-Claude integration tests that contrast:
1. `-p` mode: Claude exits after responding (the bug)
2. Interactive + sendMessage: Claude stays alive, follow-up works (the fix)

Runs in CI with ANTHROPIC_API_KEY. Skips when prerequisites missing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(test): skip interactive test without auth, improve TUI readiness detection

The integration test failed in CI because interactive Claude requires
full login auth (not just ANTHROPIC_API_KEY). Skip the interactive suite
when `claude auth status` reports not logged in.

Also fix local flakiness: replace blind 5s sleep with polling for
Claude's TUI prompt character (❯) before sending the first message,
and increase scrollback capture from 200 to 500 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(test): skip interactive test in CI, fix TUI readiness detection

The interactive test ran in CI despite hasInteractiveAuth() — Claude
reports logged in when ANTHROPIC_API_KEY is set, but interactive mode
requires OAuth. Use `!process.env.CI` as the skip condition instead.

Also fix waitForTuiReady false positive: the OAuth screen's
"Paste code here if prompted >" matched the `>` regex. Now checks
the last non-empty line for Claude's specific ❯ prompt character,
and bails early if the OAuth/login screen is detected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:11:06 +05:30
..
helpers feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
agent-aider.integration.test.ts feat(web): redesign dashboard, session detail, and orchestrator terminal (#125) 2026-02-20 18:43:57 +05:30
agent-claude-code.integration.test.ts feat(web): redesign dashboard, session detail, and orchestrator terminal (#125) 2026-02-20 18:43:57 +05:30
agent-codex.integration.test.ts feat(web): redesign dashboard, session detail, and orchestrator terminal (#125) 2026-02-20 18:43:57 +05:30
agent-opencode.integration.test.ts feat(web): redesign dashboard, session detail, and orchestrator terminal (#125) 2026-02-20 18:43:57 +05:30
cli-session-ls.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
cli-spawn-core-read-new.integration.test.ts fix: activity detection — fix path encoding bug, add ready state (#71) 2026-02-18 03:48:19 +05:30
cli-spawn-send-kill.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
config-metadata-service.integration.test.ts fix: dashboard config discovery + CLI service layer refactoring (#70) 2026-02-18 17:08:48 +05:30
metadata-lifecycle.integration.test.ts fix: dashboard config discovery + CLI service layer refactoring (#70) 2026-02-18 17:08:48 +05:30
notifier-composio.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
notifier-desktop.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
notifier-slack.integration.test.ts feat: publish to npm under @composio scope (#32) 2026-02-15 04:28:57 +05:30
notifier-webhook.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
prompt-delivery.integration.test.ts fix: keep Claude Code interactive after initial prompt (#145) 2026-02-27 18:11:06 +05:30
runtime-process.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
runtime-tmux.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
terminal-iterm2.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
terminal-web.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30
tracker-linear.integration.test.ts fix: activity detection — fix path encoding bug, add ready state (#71) 2026-02-18 03:48:19 +05:30
workspace-clone.integration.test.ts fix: recognize terminated/done session states and hide terminal for dead sessions (#40) 2026-02-15 05:15:41 +05:30
workspace-worktree.integration.test.ts feat: seamless onboarding with enhanced documentation (#66) 2026-02-16 22:22:13 +05:30