Skip to content

Accept an initial prompt as Freebuff's first argument - #1636

Open
athal7 wants to merge 1 commit into
CodebuffAI:mainfrom
athal7:freebuff-initial-prompt
Open

athal7 wants to merge 1 commit into
CodebuffAI:mainfrom
athal7:freebuff-initial-prompt

Conversation

@athal7

@athal7 athal7 commented Nov 8, 2026

Copy link
Copy Markdown

freebuff "fix the flaky login test" exits with:

error: command-argument value 'fix the flaky login test' is invalid for argument 'command'. Allowed choices are login, doctor.

The Freebuff branch of parseArgs declares its positional with
choices(['login', 'doctor']), so validation runs before the prompt is used.
The TUI already accepts an initialPrompt threaded from parseArgs into the
chat component, but the return object hardcodes
initialPrompt: !isFreebuff && args.length > 0 ? ... : null, so a Freebuff
build can never set it from argv.

That blocks launchers. Agent of Empires starts an agent in a tmux pane with
--extra-args appended to the launch line, and its dotfiles already pass a
first task that way for other agents (-- '<prompt>'). For Freebuff there is
nothing to hand the task to, so the only workaround is typing into the TUI,
which is what a launcher exists to avoid.

This change accepts bare words as the initial prompt the way the Codebuff
branch already does, and keeps login and doctor as commands:

argv parsed
freebuff "fix the flaky login test" initialPrompt: "fix the flaky login test"
freebuff login command: "login", initialPrompt: null
freebuff --trust-agents fix it trustAgents: true, initialPrompt: "fix it"

Tests: four cases in cli/src/__tests__/cli-args.test.ts covering those shapes
and the unchanged Codebuff path. No dependency changes.

I ran them with bun test against the patched parser (21 pass, 0 fail) by
stubbing only the two workspace imports, since no bun install was available
locally; public CI will run the real suite.

freebuff "fix the flaky login test" fails with "command-argument value ...
is invalid for argument 'command'", because the Freebuff branch declares its
positional with choices(['login', 'doctor']). That check runs before the prompt
is used, so the initialPrompt the TUI already accepts can never be set from
argv, and a launcher has no way to start a session with its task except by
typing into the TUI.

Take bare words as the initial prompt the way the Codebuff branch already does,
while keeping login and doctor as commands.

This branch has not been deployed

No deployments
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