fix: run cmd json format when running command (#2926)

This commit is contained in:
Aiden Cline 2025-10-02 10:37:42 -05:00 committed by GitHub
commit 860e47edea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -165,6 +165,7 @@ export const RunCommand = cmd({
}
let text = ""
const messageID = Identifier.ascending("message")
Bus.subscribe(MessageV2.Event.PartUpdated, async (evt) => {
if (evt.properties.part.sessionID !== session.id) return
@ -223,20 +224,18 @@ export const RunCommand = cmd({
UI.error(err)
})
const result = await (async () => {
if (args.command) {
await SessionPrompt.command({
messageID: Identifier.ascending("message"),
return await SessionPrompt.command({
messageID,
sessionID: session.id,
agent: agent.name,
model: providerID + "/" + modelID,
command: args.command,
arguments: message,
})
return
}
const messageID = Identifier.ascending("message")
const result = await SessionPrompt.prompt({
return await SessionPrompt.prompt({
sessionID: session.id,
messageID,
model: {
@ -252,6 +251,7 @@ export const RunCommand = cmd({
},
],
})
})()
const isPiped = !process.stdout.isTTY
if (isPiped) {