opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open shoaibansari5398 opened this issue 20 hours ago • 1 comments

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

shoaibansari5398 avatar Jan 16 '26 13:01 shoaibansari5398