Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/opencode/src/bus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export namespace Bus {
return Effect.gen(function* () {
const state = yield* InstanceState.get(cache)
const payload: Payload = { type: def.type, properties }
log.info("publishing", { type: def.type })
log.debug("publishing", { type: def.type })

const ps = state.typed.get(def.type)
if (ps) yield* PubSub.publish(ps, payload)
Expand Down
65 changes: 33 additions & 32 deletions packages/opencode/src/session/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,38 +128,39 @@ export namespace LLM {
...input.messages,
]

const params = await Plugin.trigger(
"chat.params",
{
sessionID: input.sessionID,
agent: input.agent,
model: input.model,
provider,
message: input.user,
},
{
temperature: input.model.capabilities.temperature
? (input.agent.temperature ?? ProviderTransform.temperature(input.model))
: undefined,
topP: input.agent.topP ?? ProviderTransform.topP(input.model),
topK: ProviderTransform.topK(input.model),
options,
},
)

const { headers } = await Plugin.trigger(
"chat.headers",
{
sessionID: input.sessionID,
agent: input.agent,
model: input.model,
provider,
message: input.user,
},
{
headers: {},
},
)
const [params, { headers }] = await Promise.all([
Plugin.trigger(
"chat.params",
{
sessionID: input.sessionID,
agent: input.agent,
model: input.model,
provider,
message: input.user,
},
{
temperature: input.model.capabilities.temperature
? (input.agent.temperature ?? ProviderTransform.temperature(input.model))
: undefined,
topP: input.agent.topP ?? ProviderTransform.topP(input.model),
topK: ProviderTransform.topK(input.model),
options,
},
),
Plugin.trigger(
"chat.headers",
{
sessionID: input.sessionID,
agent: input.agent,
model: input.model,
provider,
message: input.user,
},
{
headers: {},
},
),
])

const maxOutputTokens =
isOpenaiOauth || provider.id.includes("github-copilot")
Expand Down
4 changes: 2 additions & 2 deletions packages/opencode/src/session/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export namespace SessionProcessor {
const part = reasoningMap[value.id]
part.text += value.text
if (value.providerMetadata) part.metadata = value.providerMetadata
await Session.updatePartDelta({
Session.updatePartDelta({
sessionID: part.sessionID,
messageID: part.messageID,
partID: part.id,
Expand Down Expand Up @@ -307,7 +307,7 @@ export namespace SessionProcessor {
if (currentText) {
currentText.text += value.text
if (value.providerMetadata) currentText.metadata = value.providerMetadata
await Session.updatePartDelta({
Session.updatePartDelta({
sessionID: currentText.sessionID,
messageID: currentText.messageID,
partID: currentText.id,
Expand Down
Loading