mirror of
https://github.com/sst/opencode.git
synced 2025-08-31 02:07:24 +00:00
fix init command and escape to cancel
This commit is contained in:
parent
a53d2ea356
commit
31e0326f78
2 changed files with 7 additions and 4 deletions
|
@ -644,7 +644,7 @@ export namespace Session {
|
|||
tools[key] = item
|
||||
}
|
||||
|
||||
const result = streamText({
|
||||
const stream = streamText({
|
||||
onError() {},
|
||||
maxRetries: 10,
|
||||
maxOutputTokens: outputLimit,
|
||||
|
@ -677,7 +677,8 @@ export namespace Session {
|
|||
],
|
||||
}),
|
||||
})
|
||||
return processStream(assistantMsg, model.info, result)
|
||||
const result = await processStream(assistantMsg, model.info, stream)
|
||||
return result
|
||||
}
|
||||
|
||||
async function processStream(
|
||||
|
@ -979,7 +980,7 @@ export namespace Session {
|
|||
}
|
||||
await updateMessage(next)
|
||||
|
||||
const result = streamText({
|
||||
const stream = streamText({
|
||||
abortSignal: abort.signal,
|
||||
model: model.language,
|
||||
messages: [
|
||||
|
@ -1002,7 +1003,8 @@ export namespace Session {
|
|||
],
|
||||
})
|
||||
|
||||
return processStream(next, model.info, result)
|
||||
const result = await processStream(next, model.info, stream)
|
||||
return result
|
||||
}
|
||||
|
||||
function lock(sessionID: string) {
|
||||
|
|
|
@ -384,6 +384,7 @@ func (a *App) InitializeProject(ctx context.Context) tea.Cmd {
|
|||
|
||||
go func() {
|
||||
_, err := a.Client.Session.Init(ctx, a.Session.ID, opencode.SessionInitParams{
|
||||
MessageID: opencode.F(id.Ascending(id.Message)),
|
||||
ProviderID: opencode.F(a.Provider.ID),
|
||||
ModelID: opencode.F(a.Model.ID),
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue