Merge branch 'dev' into llm-centralization
commit
7c395e612e
|
|
@ -8,7 +8,6 @@ import { Faq } from "~/component/faq"
|
|||
import desktopAppIcon from "../../asset/lander/opencode-desktop-icon.png"
|
||||
import { Legal } from "~/component/legal"
|
||||
import { config } from "~/config"
|
||||
import { github } from "~/lib/github"
|
||||
|
||||
function CopyStatus() {
|
||||
return (
|
||||
|
|
@ -20,14 +19,7 @@ function CopyStatus() {
|
|||
}
|
||||
|
||||
export default function Download() {
|
||||
const githubData = createAsync(() => github(), {
|
||||
deferStream: true,
|
||||
})
|
||||
const download = () => {
|
||||
const version = githubData()?.release.tag_name
|
||||
if (!version) return null
|
||||
return `https://github.com/sst/opencode/releases/download/${version}`
|
||||
}
|
||||
const downloadUrl = "https://github.com/sst/opencode/releases/latest/download"
|
||||
const handleCopyClick = (command: string) => (event: Event) => {
|
||||
const button = event.currentTarget as HTMLButtonElement
|
||||
navigator.clipboard.writeText(command)
|
||||
|
|
@ -115,7 +107,7 @@ export default function Download() {
|
|||
macOS (<span data-slot="hide-narrow">Apple </span>Silicon)
|
||||
</span>
|
||||
</div>
|
||||
<a href={download() + "/opencode-desktop-darwin-aarch64.dmg"} data-component="action-button">
|
||||
<a href={downloadUrl + "/opencode-desktop-darwin-aarch64.dmg"} data-component="action-button">
|
||||
Download
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -131,7 +123,7 @@ export default function Download() {
|
|||
</span>
|
||||
<span>macOS (Intel)</span>
|
||||
</div>
|
||||
<a href={download() + "/opencode-desktop-darwin-x64.dmg"} data-component="action-button">
|
||||
<a href={downloadUrl + "/opencode-desktop-darwin-x64.dmg"} data-component="action-button">
|
||||
Download
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -154,7 +146,7 @@ export default function Download() {
|
|||
</span>
|
||||
<span>Windows (x64)</span>
|
||||
</div>
|
||||
<a href={download() + "/opencode-desktop-windows-x64.exe"} data-component="action-button">
|
||||
<a href={downloadUrl + "/opencode-desktop-windows-x64.exe"} data-component="action-button">
|
||||
Download
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -170,7 +162,7 @@ export default function Download() {
|
|||
</span>
|
||||
<span>Linux (.deb)</span>
|
||||
</div>
|
||||
<a href={download() + "/opencode-desktop-linux-amd64.deb"} data-component="action-button">
|
||||
<a href={downloadUrl + "/opencode-desktop-linux-amd64.deb"} data-component="action-button">
|
||||
Download
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -186,7 +178,7 @@ export default function Download() {
|
|||
</span>
|
||||
<span>Linux (.rpm)</span>
|
||||
</div>
|
||||
<a href={download() + "/opencode-desktop-linux-x86_64.rpm"} data-component="action-button">
|
||||
<a href={downloadUrl + "/opencode-desktop-linux-x86_64.rpm"} data-component="action-button">
|
||||
Download
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -783,6 +783,7 @@ export namespace Config {
|
|||
.array(z.string())
|
||||
.optional()
|
||||
.describe("Tools that should only be available to primary agents."),
|
||||
continue_loop_on_deny: z.boolean().optional().describe("Continue the agent loop when a tool call is denied"),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { SessionStatus } from "./status"
|
|||
import { Plugin } from "@/plugin"
|
||||
import type { Provider } from "@/provider/provider"
|
||||
import { LLM } from "./llm"
|
||||
import { Config } from "@/config/config"
|
||||
|
||||
export namespace SessionProcessor {
|
||||
const DOOM_LOOP_THRESHOLD = 3
|
||||
|
|
@ -40,6 +41,7 @@ export namespace SessionProcessor {
|
|||
},
|
||||
async process(streamInput: LLM.StreamInput) {
|
||||
log.info("process")
|
||||
const shouldBreak = (await Config.get()).experimental?.continue_loop_on_deny !== true
|
||||
while (true) {
|
||||
try {
|
||||
let currentText: MessageV2.TextPart | undefined
|
||||
|
|
@ -219,7 +221,7 @@ export namespace SessionProcessor {
|
|||
})
|
||||
|
||||
if (value.error instanceof Permission.RejectedError) {
|
||||
blocked = true
|
||||
blocked = shouldBreak
|
||||
}
|
||||
delete toolcalls[value.toolCallId]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1519,6 +1519,10 @@ export type Config = {
|
|||
* Tools that should only be available to primary agents.
|
||||
*/
|
||||
primary_tools?: Array<string>
|
||||
/**
|
||||
* Continue the agent loop when a tool call is denied
|
||||
*/
|
||||
continue_loop_on_deny?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8283,6 +8283,10 @@
|
|||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"continue_loop_on_deny": {
|
||||
"description": "Continue the agent loop when a tool call is denied",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": ["deb", "rpm", "dmg", "nsis", "appimage"],
|
||||
"targets": ["deb", "rpm", "dmg", "nsis"],
|
||||
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
|
||||
"externalBin": ["sidecars/opencode"],
|
||||
"createUpdaterArtifacts": true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue