Skip to content

Commit 6e5f595

Browse files
kitlangtonrustybret
authored andcommitted
refactor(opencode): extract session LLM request prep (anomalyco#28560)
1 parent 867d832 commit 6e5f595

1 file changed

Lines changed: 2 additions & 33 deletions

File tree

  • packages/opencode/src/session

packages/opencode/src/session/llm.ts

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -212,39 +212,8 @@ const live: Layer.Layer<
212212
})
213213
: undefined
214214

215-
l.info("params", {
216-
temperature: params.temperature,
217-
topP: params.topP,
218-
topK: params.topK,
219-
maxOutputTokens: params.maxOutputTokens,
220-
variant: input.user.model.variant,
221-
providerOptions: ProviderTransform.providerOptions(input.model, params.options),
222-
limit: input.model.limit,
223-
capabilities: input.model.capabilities,
224-
})
225-
226-
const opencodeProjectID = input.model.providerID.startsWith("opencode")
227-
? (yield* InstanceState.context).project.id
228-
: undefined
229-
230-
const requestHeaders = {
231-
...(input.model.providerID.startsWith("opencode")
232-
? {
233-
...(opencodeProjectID ? { "x-opencode-project": opencodeProjectID } : {}),
234-
"x-opencode-session": input.sessionID,
235-
"x-opencode-request": input.user.id,
236-
"x-opencode-client": flags.client,
237-
"User-Agent": `opencode/${InstallationVersion}`,
238-
}
239-
: {
240-
"x-session-affinity": input.sessionID,
241-
...(input.parentSessionID ? { "x-parent-session-id": input.parentSessionID } : {}),
242-
"User-Agent": `opencode/${InstallationVersion}`,
243-
}),
244-
...input.model.headers,
245-
...headers,
246-
}
247-
215+
// Runtime seam: native is an opt-in adapter over @opencode-ai/llm. It
216+
// either returns a ready LLMEvent stream or a concrete fallback reason.
248217
if (flags.experimentalNativeLlm) {
249218
const native = LLMNativeRuntime.stream({
250219
model: input.model,

0 commit comments

Comments
 (0)