Skip to content

Comments

feat: add --branch/--prompt to spawn CLI + file-based prompt delivery#102

Open
AgentWrapper wants to merge 1 commit intomainfrom
feat/spawn-branch-prompt-file
Open

feat: add --branch/--prompt to spawn CLI + file-based prompt delivery#102
AgentWrapper wants to merge 1 commit intomainfrom
feat/spawn-branch-prompt-file

Conversation

@AgentWrapper
Copy link
Collaborator

Summary

  • Fixes prompt truncation bug where long composed prompts passed via -p get mangled by tmux/zsh (same root cause as orchestrator system prompt fix in feat: first-class orchestrator session + file-based system prompt #101)
  • Adds promptFile to AgentLaunchConfigspawn() writes prompts to {sessionId}-prompt.md files, and all agent plugins use $(cat ...) shell substitution
  • Adds --branch and --prompt CLI options to ao spawn, enabling revival of sessions on existing branches: ao spawn project --branch feat/existing-branch

Test plan

  • pnpm typecheck passes
  • pnpm lint passes (0 errors)
  • pnpm test passes (129/129)
  • Manually verified: spawned 5 sessions with --branch for existing PRs on integrator project — all launched correctly with prompts delivered via file

🤖 Generated with Claude Code

@AgentWrapper AgentWrapper force-pushed the feat/spawn-branch-prompt-file branch from b89e1c3 to a04c6d0 Compare February 18, 2026 15:06
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@AgentWrapper AgentWrapper force-pushed the feat/spawn-branch-prompt-file branch from e84a435 to c50fd01 Compare February 18, 2026 19:55
@AgentWrapper
Copy link
Collaborator Author

Addressing review comments

All 4 bugbot comments reference code from old commits that were removed during rebase. After the rebase onto main:

  1. "Restored session PR field always null" — The restore() implementation was moved to PR feat: implement session restore for crashed/exited agents #104 (already merged). This PR no longer contains any restore code. Additionally, parsePrUrl() was extracted as a shared helper.

  2. "Runtime leaked if metadata write fails in restore" — Same as above — restore() is on main via PR feat: implement session restore for crashed/exited agents #104 with proper error handling.

  3. "Duplicated PR parsing logic" — Resolved by extracting a shared parsePrUrl() helper that's used by metadataToSession(). The restore code on main can also use it.

  4. "Test mock restore returns undefined" — This PR no longer modifies api-routes.test.ts or the restore route. PR feat: implement session restore for crashed/exited agents #104 includes properly mocked restore tests.

- Add --branch and --prompt options to `ao spawn` CLI command
- Write long prompts to file and use $(cat ...) to avoid tmux truncation
- Add promptFile field to AgentLaunchConfig, handled by all 4 agent plugins
- Extract shared parsePrUrl() helper to deduplicate PR URL parsing
- Fix duplicate React keys in CIBadge when CI checks share names

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AgentWrapper AgentWrapper force-pushed the feat/spawn-branch-prompt-file branch from c50fd01 to 6d1f05f Compare February 20, 2026 13:55
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