mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
fix init command and escape to cancel
This commit is contained in:
@@ -644,7 +644,7 @@ export namespace Session {
|
|||||||
tools[key] = item
|
tools[key] = item
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = streamText({
|
const stream = streamText({
|
||||||
onError() {},
|
onError() {},
|
||||||
maxRetries: 10,
|
maxRetries: 10,
|
||||||
maxOutputTokens: outputLimit,
|
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(
|
async function processStream(
|
||||||
@@ -979,7 +980,7 @@ export namespace Session {
|
|||||||
}
|
}
|
||||||
await updateMessage(next)
|
await updateMessage(next)
|
||||||
|
|
||||||
const result = streamText({
|
const stream = streamText({
|
||||||
abortSignal: abort.signal,
|
abortSignal: abort.signal,
|
||||||
model: model.language,
|
model: model.language,
|
||||||
messages: [
|
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) {
|
function lock(sessionID: string) {
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ func (a *App) InitializeProject(ctx context.Context) tea.Cmd {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
_, err := a.Client.Session.Init(ctx, a.Session.ID, opencode.SessionInitParams{
|
_, err := a.Client.Session.Init(ctx, a.Session.ID, opencode.SessionInitParams{
|
||||||
|
MessageID: opencode.F(id.Ascending(id.Message)),
|
||||||
ProviderID: opencode.F(a.Provider.ID),
|
ProviderID: opencode.F(a.Provider.ID),
|
||||||
ModelID: opencode.F(a.Model.ID),
|
ModelID: opencode.F(a.Model.ID),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user