use treesitter to parse bash commands and catch commands that go outside of cwd (#1443)

This commit is contained in:
Dax
2025-07-30 20:57:52 -04:00
committed by GitHub
parent 3b7085ca28
commit 18888351e9
13 changed files with 226 additions and 59 deletions

View File

@@ -290,6 +290,9 @@ export namespace Session {
export function abort(sessionID: string) {
const controller = state().pending.get(sessionID)
if (!controller) return false
log.info("aborting", {
sessionID,
})
controller.abort()
state().pending.delete(sessionID)
return true
@@ -765,7 +768,11 @@ export namespace Session {
}
const stream = streamText({
onError() {},
onError(e) {
log.error("streamText error", {
error: e,
})
},
async prepareStep({ messages }) {
const queue = (state().queued.get(input.sessionID) ?? []).filter((x) => !x.processed)
if (queue.length) {
@@ -1030,7 +1037,7 @@ export namespace Session {
}
break
case "text":
case "text-delta":
if (currentText) {
currentText.text += value.text
if (currentText.text) await updatePart(currentText)

View File

@@ -1,5 +1,3 @@
# Beast Mode 3.1
You are opencode, an agent - please keep going until the users query is completely resolved, before ending your turn and yielding back to the user.
Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.