CLI exits 0 when a tool call fails (task add/rm/update, project job get, agent run…)
维护者通常 1 天内回复
@lsegal 已经在做这个了。
开始于 2026年11月28日。
评估
这个 Issue 还没有评估数据。
描述
Summary
Every CLI command that goes through dispatcher.CallTool exits 0 when the tool fails. It prints the tool's error text to stdout as if it were a normal result. Scripts and CI can't tell that aviary task add, task update, task rm, task run, project job get and the rest failed.
Steps to reproduce
Against a running server (seen on main at the time of filing):
$ aviary task add assistant weird "x" --every 0m; echo rc=$?
invalid schedule: invalid every "0m": must be at least 1s
rc=0
$ aviary task rm nosuch; echo rc=$?
task "nosuch" not found; use task_list to see tasks
rc=0
$ aviary task update nosuch --every 1h; echo rc=$?
task "nosuch" not found; use task_list to see tasks
rc=0
$ aviary task add nobody t "x" --every 1h; echo rc=$?
agent "nobody" not found; use agent_list to see available agents
rc=0
$ aviary project job get 99999; echo rc=$?
no job #99999
rc=0
$ aviary agent run nobody hi; echo rc=$?
agent "nobody" not foundrc=0 # also no trailing newline
Expected
A tool result with IsError set should make the command exit non-zero and print the message to stderr.
Cause
internal/mcp/dispatch.go Dispatcher.CallTool returns extractText(result), nil and drops result.IsError. CallToolWithProgress already reports isError, and watch.go checks it. All 15 CallTool call sites in cmd/aviary/cmd (agent, agent_resolve, project, task, tool, tool_command, upgrade) inherit the problem.
Suggested fix
Have CallTool return an error, for example ToolError{Text}, when result.IsError is set, so cobra exits 1. Error messages also mention MCP tool names (use task_list, use agent_list). In the CLI they could name aviary task list / aviary agent list instead.
Regression test
A cmd/aviary/cmd test that runs task rm nosuch and task add ... --every 0m against the in-process dispatcher and asserts a non-nil error/non-zero exit.
Created by Engine: /aviary:FC88FDCA
- 主要语言
- Go
- 星标
- 12
- 派生
- 5
- 平均合并
- 53 分钟
- 30 天内合并 PR
- 640
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lsegal/aviary 的其他 Issue
-
enhancement go
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
E2E: add regression coverage for System → Sessions (agent picker, create, Clear vs Remove, live Stop)可能已有人在做 @lsegal 今天认领。 未关闭javascript
lsegal/aviary#1673 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Docs: System → Sessions is per-agent, with Create, and Clear for Main Chat (control panel guide is out of date)可能已有人在做 @lsegal 今天认领。 未关闭documentation
lsegal/aviary#1672 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
Task retarget keeps the old host in task scope and adds the new host in a form that matches nothing可能已有人在做 @chaitanya0305 今天认领。 未关闭bug P2
难度 2/5 1-3 小时 新手友好度 62/100
BaaRai/ARTEX#652 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
compiler-explorer/compiler-explorer#9710 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 65/100
losisin/helm-values-schema-json#437 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复