mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-02 22:40:22 +00:00
feat(desktop): optimistic prompt submit
This commit is contained in:
parent
dbdea2f659
commit
b4209582fb
2 changed files with 55 additions and 5 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue