mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
ci: gemini 3 flash doesnt exist in pinned cicd version (#5776)
This commit is contained in:
parent
8b5cea7899
commit
382905602c
2 changed files with 23 additions and 9 deletions
|
|
@ -185,23 +185,37 @@ export async function generateChangelog(previous: string, current: string): Prom
|
|||
|
||||
const commits = commitsWithMeta.join("\n")
|
||||
|
||||
if (!commits.trim()) {
|
||||
console.error("No commits found to generate changelog")
|
||||
}
|
||||
|
||||
// Generate changelog via LLM
|
||||
// different port to not conflict with dev running opencode
|
||||
const opencode = await createOpencode({ port: 8192 })
|
||||
let raw: string | undefined
|
||||
try {
|
||||
const session = await opencode.client.session.create()
|
||||
raw = await opencode.client.session
|
||||
.prompt({
|
||||
path: { id: session.data!.id },
|
||||
const opencode = await createOpencode({ port: 8192 })
|
||||
try {
|
||||
const session = await opencode.client.session.create()
|
||||
if (!session.data?.id) {
|
||||
console.error("Failed to create session:", session)
|
||||
throw new Error("Failed to create session")
|
||||
}
|
||||
const response = await opencode.client.session.prompt({
|
||||
path: { id: session.data.id },
|
||||
body: {
|
||||
model: { providerID: "opencode", modelID: MODEL },
|
||||
parts: [{ type: "text", text: buildPrompt(previous, commits) }],
|
||||
},
|
||||
})
|
||||
.then((x) => x.data?.parts?.find((y) => y.type === "text")?.text)
|
||||
} finally {
|
||||
opencode.server.close()
|
||||
if (!response.data?.parts) {
|
||||
console.error("Empty response from LLM:", response)
|
||||
}
|
||||
raw = response.data?.parts?.find((y) => y.type === "text")?.text
|
||||
} finally {
|
||||
opencode.server.close()
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Failed to generate changelog via LLM:", err)
|
||||
}
|
||||
|
||||
const notes = parseChangelog(raw ?? "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue