diff options
| author | Adam <[email protected]> | 2025-12-17 15:04:13 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-17 15:42:55 -0600 |
| commit | b4209582fb7d696e28b499b2b254ef4f853e0a13 (patch) | |
| tree | 688da3912bd0f5a1e7e94ffe4fb675a2d9a57bb7 /packages/desktop/src/components | |
| parent | dbdea2f65958b088bda2998f0f225eafa1b95b43 (diff) | |
| download | opencode-b4209582fb7d696e28b499b2b254ef4f853e0a13.tar.gz opencode-b4209582fb7d696e28b499b2b254ef4f853e0a13.zip | |
feat(desktop): optimistic prompt submit
Diffstat (limited to 'packages/desktop/src/components')
| -rw-r--r-- | packages/desktop/src/components/prompt-input.tsx | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/packages/desktop/src/components/prompt-input.tsx b/packages/desktop/src/components/prompt-input.tsx index a8f0736f8..1a6e233e3 100644 --- a/packages/desktop/src/components/prompt-input.tsx +++ b/packages/desktop/src/components/prompt-input.tsx @@ -709,13 +709,28 @@ export const PromptInput: Component<PromptInputProps> = (props) => { } } + const model = { + modelID: local.model.current()!.id, + providerID: local.model.current()!.provider.id, + } + const agent = local.agent.current()!.name + + sync.session.addOptimisticMessage({ + sessionID: existing.id, + text, + parts: [ + { type: "text", text } as import("@opencode-ai/sdk/v2/client").Part, + ...(fileAttachmentParts as import("@opencode-ai/sdk/v2/client").Part[]), + ...(imageAttachmentParts as import("@opencode-ai/sdk/v2/client").Part[]), + ], + agent, + model, + }) + sdk.client.session.prompt({ sessionID: existing.id, - agent: local.agent.current()!.name, - model: { - modelID: local.model.current()!.id, - providerID: local.model.current()!.provider.id, - }, + agent, + model, parts: [ { type: "text", |
