mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
sync
This commit is contained in:
parent
a366d45a8c
commit
f693dd47ef
3 changed files with 0 additions and 12 deletions
|
|
@ -51,11 +51,9 @@ try {
|
|||
if (mode.isPR()) {
|
||||
const prData = await fetchPR()
|
||||
const dataPrompt = buildPromptDataForPR(prData)
|
||||
console.log("!!!@#!@ dataPrompt", dataPrompt)
|
||||
// Local PR
|
||||
if (prData.headRepository.nameWithOwner === prData.baseRepository.nameWithOwner) {
|
||||
await checkoutLocalBranch(prData)
|
||||
// TODO
|
||||
const response = await chat(`${userPrompt}\n\n${dataPrompt}`, promptFiles)
|
||||
if (await branchIsDirty()) {
|
||||
const summary = await summarize(response)
|
||||
|
|
|
|||
|
|
@ -34,10 +34,6 @@ export namespace Git {
|
|||
await $`git config --local ${CONFIG_KEY} "${extraHeaderValue}"`
|
||||
}
|
||||
|
||||
export async function isConfigured() {
|
||||
return Boolean(extraHeaderValue)
|
||||
}
|
||||
|
||||
export function isForkedPr() {
|
||||
const pr = Context.payloadPullRequest()
|
||||
return pr.head.repo?.full_name !== pr.base.repo.full_name
|
||||
|
|
|
|||
|
|
@ -53,10 +53,6 @@ export namespace Opencode {
|
|||
console.log("Sending message to opencode...")
|
||||
const { providerID, modelID } = state()
|
||||
|
||||
// restore git credentials temporarily to avoid prompt injection
|
||||
const isGitConfigured = await Git.isConfigured()
|
||||
if (isGitConfigured) await Git.restore()
|
||||
|
||||
const session = await client()
|
||||
.session.create<true>()
|
||||
.then((r) => r.data)
|
||||
|
|
@ -75,8 +71,6 @@ export namespace Opencode {
|
|||
},
|
||||
})
|
||||
|
||||
if (isGitConfigured) await Git.configure()
|
||||
|
||||
// @ts-ignore
|
||||
const match = chat.data.parts.findLast((p) => p.type === "text")
|
||||
if (!match) throw new Error("Failed to parse the text response")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue