Skip to content

fix(tui): handle --prompt flag when used with --continue (#8850)#8884

Open
shoaibansari5398 wants to merge 1 commit intoanomalyco:devfrom
shoaibansari5398:fix/issue-8850-continue-prompt
Open

fix(tui): handle --prompt flag when used with --continue (#8850)#8884
shoaibansari5398 wants to merge 1 commit intoanomalyco:devfrom
shoaibansari5398:fix/issue-8850-continue-prompt

Conversation

@shoaibansari5398
Copy link

What does this PR do?

Fixes #8850 - Makes --continue --prompt flags work together.

Problem: When using opencode --continue --prompt "message", the prompt was ignored because:

--continue navigates directly to the session route (app.tsx:267-275)
--prompt was only handled in home.tsx:84-87, which never runs when continuing a session

How did you verify your code works?

Solution: Added args.prompt handling to
session/index.tsx
so when a user continues a session with a prompt, it:

Waits for sync to complete loading
Sets the prompt text
Automatically submits it
Change:

Added useArgs import to
session/index.tsx
Extended the existing createEffect for initialPrompt to also handle args.prompt
Added guard to prevent multiple submissions
How did you verify your code works?
Code review confirmed the fix follows the same pattern as home.tsx:84-87
The sync.status !== "loading" check ensures the session is ready before submitting
The initialPromptHandled guard prevents duplicate submissions from reactive effects

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

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.

Bug: opencode --continue --prompt does not work

1 participant