cli: redesign run command output flow and disable todo read tool
- Show run message at execution start with UI formatting - Remove unused show() function and simplify output logic - Add agent/model display when assistant messages begin - Comment out TodoReadTool from registry - Remove mcp context7 configurationpull/11814/head
parent
ac7eaf21dc
commit
2c2b1ea90a
|
|
@ -9,12 +9,7 @@
|
|||
"options": {},
|
||||
},
|
||||
},
|
||||
"mcp": {
|
||||
"context7": {
|
||||
"type": "remote",
|
||||
"url": "https://mcp.context7.com/mcp",
|
||||
},
|
||||
},
|
||||
"mcp": {},
|
||||
"tools": {
|
||||
"github-triage": false,
|
||||
"github-pr-search": false,
|
||||
|
|
|
|||
|
|
@ -367,15 +367,6 @@ export const RunCommand = cmd({
|
|||
}
|
||||
|
||||
async function execute(sdk: OpencodeClient) {
|
||||
function show() {
|
||||
if (args.format === "json") return
|
||||
if (!process.stdout.isTTY) return
|
||||
const text = message.trimEnd()
|
||||
if (!text) return
|
||||
UI.empty()
|
||||
text.split("\n").forEach((line) => UI.println(`> ${line}`))
|
||||
UI.empty()
|
||||
}
|
||||
const seen = new Set<string>()
|
||||
|
||||
function head(info: Message) {
|
||||
|
|
@ -418,7 +409,18 @@ export const RunCommand = cmd({
|
|||
let error: string | undefined
|
||||
|
||||
async function loop() {
|
||||
UI.empty()
|
||||
UI.println(`> ${args.message}`)
|
||||
UI.empty()
|
||||
let start = false
|
||||
for await (const event of events.stream) {
|
||||
if (event.type === "message.updated" && event.properties.info.role === "assistant" && !start) {
|
||||
start = true
|
||||
UI.empty()
|
||||
UI.println(`# ${event.properties.info.agent} · ${event.properties.info.modelID}`)
|
||||
UI.empty()
|
||||
}
|
||||
|
||||
if (event.type === "message.part.updated") {
|
||||
const part = event.properties.part
|
||||
if (part.sessionID !== sessionID) continue
|
||||
|
|
@ -530,8 +532,6 @@ export const RunCommand = cmd({
|
|||
}
|
||||
await share(sdk, sessionID)
|
||||
|
||||
if (!args.command) show()
|
||||
|
||||
loop().catch((e) => {
|
||||
console.error(e)
|
||||
process.exit(1)
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ export namespace ToolRegistry {
|
|||
TaskTool,
|
||||
WebFetchTool,
|
||||
TodoWriteTool,
|
||||
TodoReadTool,
|
||||
// TodoReadTool,
|
||||
WebSearchTool,
|
||||
CodeSearchTool,
|
||||
SkillTool,
|
||||
|
|
|
|||
Loading…
Reference in New Issue