Skip to content

fix: launch grok prompts interactively#2518

Open
nikhilachale wants to merge 14 commits into
AgentWrapper:mainfrom
nikhilachale:ao/agent-orchestrator_d14024986e-90/fix-grok-interactive-prompt
Open

fix: launch grok prompts interactively#2518
nikhilachale wants to merge 14 commits into
AgentWrapper:mainfrom
nikhilachale:ao/agent-orchestrator_d14024986e-90/fix-grok-interactive-prompt

Conversation

@nikhilachale

Copy link
Copy Markdown
Collaborator

Summary

  • launch Grok worker prompts as positional args instead of -p single-turn mode
  • update Grok launch arg tests to assert normal prompts do not use -p / --single
  • refresh Grok adapter comments to match the current interactive launch behavior

Closes #2516

Tests

  • cd backend && go test ./internal/adapters/agent/grok
  • cd backend && go test ./internal/adapters/agent/... (fails in unrelated internal/adapters/agent/kilocode: TestAuthStatusUnknownWhenKeyOnlyComesFromInteractiveShell times out; reproduced with go test ./internal/adapters/agent/kilocode)

Risks

  • Low: preserves existing --no-auto-update, permission flags, and restore args; only changes fresh Grok prompt delivery.

@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Superseded by a clean branch based on upstream/main; reopening with only the Grok fix commit.

@nikhilachale nikhilachale reopened this Jul 8, 2026
@nikhilachale

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-07-08 at 20 49 36

@illegalcall illegalcall left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed this together with #2521 because both PRs move worker launches back toward interactive TUI behavior. I left one inline edge-case comment.


if cfg.Prompt != "" {
cmd = append(cmd, "-p", cfg.Prompt)
cmd = append(cmd, cfg.Prompt)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Terminate flags before the positional prompt

Once the task is passed positionally, a worker prompt that starts with - can be parsed as another Grok CLI option instead of task text. Several sibling interactive adapters append -- before the prompt and have tests with prompts like -add a health check for this reason. Please append the prompt as --, cfg.Prompt (assuming Grok accepts the standard option terminator) and add a regression test for a leading-dash prompt so user task text cannot become flags.

@nikhilachale nikhilachale requested a review from illegalcall July 8, 2026 17:45
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.

grok worker launches in single-turn mode and exits without editing

2 participants