Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(harness): print a run's text once in vibe runs show, and add --brief (#2430)

Call Whitef2d8470765d4
diff --git a/docs/CLI.md b/docs/CLI.md
index d9ad805d3..849b741ae 100644
--- a/docs/CLI.md
+++ b/docs/CLI.md
@@ -350,12 +350,16 @@ List and inspect Agent run records.
```bash
vibe runs list --session-id sesk8m4q2p7x --brief
vibe runs show run_abc123
+vibe runs show run_abc123 --brief # status, timing, error, and callback fields only
vibe runs show # inside an Avibe Agent shell, show the caller Run
```
`vibe runs list` keeps its global listing behavior unless a filter such as
`--session-id` is provided. `vibe runs show` can omit the run id inside an
-Avibe-injected Agent run and defaults to `AVIBE_RUN_ID`.
+Avibe-injected Agent run and defaults to `AVIBE_RUN_ID`. It prints the full
+record, with the text sent to the Agent as `message` and the reply as
+`result_text`; `--brief` prints the same compact row as `vibe runs list`, for
+status checks.
### `vibe task`
diff --git a/docs/CLI_ZH.md b/docs/CLI_ZH.md
index 392f35651..2cdfab59e 100644
--- a/docs/CLI_ZH.md
+++ b/docs/CLI_ZH.md
@@ -306,12 +306,15 @@ vibe session update --title 'Release review' # 在 Avibe Agent s
```bash
vibe runs list --session-id sesk8m4q2p7x --brief
vibe runs show run_abc123
+vibe runs show run_abc123 --brief # 只看状态、时间、错误和回调字段
vibe runs show # 在 Avibe Agent shell 内查看调用方 Run
```
`vibe runs list` 无过滤参数时仍保持全局列表语义;传入 `--session-id` 等参数
才会筛选。`vibe runs show` 在 Avibe 已注入 caller context 的 Agent run 内
-可以省略 run id,并默认使用 `AVIBE_RUN_ID`。
+可以省略 run id,并默认使用 `AVIBE_RUN_ID`。它输出完整记录:发给 Agent 的文本在
+`message`,回复在 `result_text`;`--brief` 只输出与 `vibe runs list` 相同的精简行,
+用于查看状态。
### `vibe task`
diff --git a/docs/plans/agent-run-harness.md b/docs/plans/agent-run-harness.md
index 48677faac..cea2d7183 100644
--- a/docs/plans/agent-run-harness.md
+++ b/docs/plans/agent-run-harness.md
@@ -525,7 +525,7 @@ Field details:
| `legacy_session_key` | Existing, compatibility | Legacy target for old imported runs. | Migration/display only. |
| `scope_id` | Target field | Scope placement snapshot. | Audit placement and query runs by Scope. |
| legacy delivery fields | Existing, compatibility | Old delivery override snapshots. | Preserve old run history only; new user-facing contracts should prefer Scope placement and Session callback fields. |
-| `prompt` | Existing, compatibility | Legacy message field. | Read compatibility for old runs; target schema uses `message`. |
+| `prompt` | Existing, compatibility | Legacy message field. | Read compatibility for old runs; target schema uses `message`. The run record that `vibe runs show` prints omits it: its text is already in `message`. |
| `message` | New | Actual message sent to the Agent. | Align with `--message` and separate user message from system prompt. |
| `message_payload_json` | New | Optional structured payload. | Support webhook/API structured input. |
| `result_text` | New | Final user-visible result when available. | Support sync run output, run show, and Web UI summaries. |
diff --git a/docs/plans/agent-run-harness.zh.md b/docs/plans/agent-run-harness.zh.md
index f8221f038..0e2398bf6 100644
--- a/docs/plans/agent-run-harness.zh.md
+++ b/docs/plans/agent-run-harness.zh.md
@@ -501,7 +501,7 @@ Definition 表的迁移优先级:
| `legacy_session_key` | 现有,兼容 | 旧导入 runs 的兼容 target。 | 只用于迁移和兼容展示。 |
| `scope_id` | 目标字段 | Scope placement snapshot。 | 记录 placement,支持按 Scope 查 runs。 |
| legacy delivery fields | 现有,兼容 | 旧 delivery override snapshot。 | 只保留旧 run history;新的 user-facing contract 应优先使用 Scope placement 和 Session callback 字段。 |
-| `prompt` | 现有,兼容 | 旧消息字段。 | 迁移期兼容旧 run;目标 schema 用 `message`。 |
+| `prompt` | 现有,兼容 | 旧消息字段。 | 迁移期兼容旧 run;目标 schema 用 `message`。`vibe runs show` 输出的 run 记录不含此字段:其文本已在 `message` 中。 |
| `message` | 新增 | 发送给 Agent 的实际消息。 | 与 `--message` 对齐,并和 Agent system prompt 分离。 |
| `message_payload_json` | 新增 | 可选结构化 payload。 | 支持 webhook/API 传结构化输入。 |
| `result_text` | 新增 | 最终用户可见结果。 | 支持 sync `agent run` 回显、run show、Web UI 摘要。 |
diff --git a/skills/agent-prompt-audit/SKILL.md b/skills/agent-prompt-audit/SKILL.md
index 3d19d1332..fe9fd9069 100644
--- a/skills/agent-prompt-audit/SKILL.md
+++ b/skills/agent-prompt-audit/SKILL.md
@@ -98,14 +98,14 @@ the Agent's current definition. A Session's model and effort can change during
its life and ordinary IM turns have no run record, so treat the Session row as
the current setting and mark the target unconfirmed if it may have changed.
Attribute a symptom only to prompt text that existed when it ran. Each run's
-`prompt` and `message` in `vibe runs show` snapshot what a Task or Watch
-actually sent; file-owned text needs Git or release history matching the run;
+`message` in `vibe runs show` snapshots what a Task or Watch actually
+sent; file-owned text needs Git or release history matching the run;
Agent system prompts have no history. A long-lived Codex thread also keeps
earlier injected prompt snapshots in its native history, so text since removed
may still have been in view. Where the text may have changed since the run and
no history covers it, say the attribution is unconfirmed.
-`vibe runs show <id>` gives one run's prompt, result, and callback state;
+`vibe runs show <id>` gives one run's message, result, and callback state;
`vibe data query` is read-only SQLite over `agent_sessions`, `agent_runs`, and
`messages`. Keep evidence to the Session the user reported, plus any others they point
to — a channel's `scope_id` can hold other people's threads; the user's
diff --git a/skills/use-avibe/references/harness.md b/skills/use-avibe/references/harness.md
index 9bdd74343..71aaed7f2 100644
--- a/skills/use-avibe/references/harness.md
+++ b/skills/use-avibe/references/harness.md
@@ -30,7 +30,7 @@ Preferred CLI shape:
- managed background watch for this conversation: `vibe watch add --message '...' -- <cmd>` (or `--shell '<cmd>'` to pass a single shell string)
- watch that creates a visible sibling Session: `vibe watch add --create-session --same-scope --message '...' -- <cmd>`
- update a watch: `vibe watch update <id> --name '...' --timeout 1200`
-- inspect a run: `vibe runs show <run-id>`
+- inspect a run: `vibe runs show <run-id>`; add `--brief` for only its status, timing, error, and callback fields
- cancel a run: `vibe runs cancel <run-id>`
Targeting and callbacks:
diff --git a/tests/test_cli_pagination.py b/tests/test_cli_pagination.py
index ff0f5afec..d0e64a09f 100644
--- a/tests/test_cli_pagination.py
+++ b/tests/test_cli_pagination.py
@@ -340,6 +340,43 @@ def test_runs_show_defaults_to_caller_run(monkeypatch, tmp_path, capsys) -> None
}
+def test_runs_show_prints_the_run_text_once_and_brief_prints_the_list_row(monkeypatch, tmp_path, capsys) -> None:
+ """#2425: a long delegation brief appears once, as `message`; `--brief` is the status row `runs list` prints."""
+
+ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))
+ paths.ensure_data_dirs()
+ delegation_brief = "Review PR #1 and report every finding. " * 100
+ store = SQLiteBackgroundTaskStore()
+ try:
+ store.enqueue_run(
+ {
+ "id": "run-done",
+ "request_type": "agent_run",
+ "status": "succeeded",
+ "agent_name": "helper",
+ "agent_backend": "codex",
+ "session_id": "ses-alpha",
+ "message": delegation_brief,
+ "result_text": "No findings.",
+ "created_at": "2026-05-25T00:00:00+00:00",
+ "updated_at": "2026-05-25T00:00:00+00:00",
+ }
+ )
+ finally:
+ store.close()
+
+ assert cli.cmd_runs_show(cli.build_parser().parse_args(["runs", "show", "run-done"])) == 0
+ run = json.loads(capsys.readouterr().out)["run"]
+ assert "prompt" not in run
+ assert (run["message"], run["result_text"]) == (delegation_brief, "No findings.")
+
+ assert cli.cmd_runs_show(cli.build_parser().parse_args(["runs", "show", "run-done", "--brief"])) == 0
+ brief = json.loads(capsys.readouterr().out)["run"]
+ assert cli.cmd_runs_list(cli.build_parser().parse_args(["runs", "list"])) == 0
+ assert brief == json.loads(capsys.readouterr().out)["runs"][0]
+ assert (brief["status"], "message" in brief) == ("succeeded", False)
+
+
def test_runs_show_attaches_live_session_owner_for_queued_run(monkeypatch, tmp_path, capsys) -> None:
"""HFR-002: CLI diagnosis names the authoritative live Session owner."""
diff --git a/vibe/cli.py b/vibe/cli.py
index 5623e68a0..401399f82 100644
--- a/vibe/cli.py
+++ b/vibe/cli.py
@@ -3787,6 +3787,9 @@ def _run_payload(run: dict, *, brief: bool = False) -> dict:
"callback_run_id": normalized.get("callback_run_id"),
}
normalized["metadata"] = public_message_metadata(normalized.get("metadata") or {})
+ # `prompt` is the legacy copy of `message`: every writer stores the same text in both, and the
+ # store already falls back to it for `message`, so the record carries that text once.
+ normalized.pop("prompt", None)
return normalized
@@ -6473,7 +6476,7 @@ def _resolve_callback_session_id(args, caller_context, *, target_session_id: Opt
if no_callback:
message = (
"Started async Agent Run without a callback. This run will not post its final result back into a "
- "Session automatically. Track it with `vibe runs show <run-id>` or by polling/listing runs for the "
+ "Session automatically. Track it with `vibe runs show <run-id> --brief` or by polling/listing runs for the "
"target Session. To receive a follow-up message next time, use `--callback-session-id <session-id>` "
"or run from a resolved caller context so Avibe can default the callback to the current Session."
)
@@ -7083,7 +7086,7 @@ def cmd_runs_show(args):
if run is None:
_print_task_error(TaskCliError(f"run '{run_id}' not found", code="run_not_found", details={"run_id": run_id}))
return 1
- run_payload = _run_payload(run)
+ run_payload = _run_payload(run, brief=getattr(args, "brief", False))
session_runtime = _live_session_runtime_for_run(run_payload)
if session_runtime is not None:
run_payload["session_runtime"] = session_runtime
@@ -17105,6 +17108,11 @@ def build_parser():
_add_json_noop(runs_list_parser)
runs_show_parser = runs_subparsers.add_parser("show", help="Show one Agent run")
runs_show_parser.add_argument("run_id", nargs="?")
+ runs_show_parser.add_argument(
+ "--brief",
+ action="store_true",
+ help=i18n_t("harness.run.cli.help.showBrief", _configured_cli_language()),
+ )
_add_json_noop(runs_show_parser)
runs_cancel_parser = runs_subparsers.add_parser(
"cancel",
diff --git a/vibe/i18n/en.json b/vibe/i18n/en.json
index dec8602aa..377ee5c8f 100644
--- a/vibe/i18n/en.json
+++ b/vibe/i18n/en.json
@@ -187,7 +187,8 @@
"bindingUnresolvedPaused": "paused: pinned agent session {session} cannot accept a turn. This definition would fail on every run. Re-point it with: vibe task update {id} --session-id <id>; then resume it with: vibe task resume {id}.",
"cli": {
"help": {
- "cancel": "Request best-effort cancellation for one run; a run already in the live Session turn stops that whole turn, like Session Stop"
+ "cancel": "Request best-effort cancellation for one run; a run already in the live Session turn stops that whole turn, like Session Stop",
+ "showBrief": "Show only status, timing, error, and callback fields, as in vibe runs list"
},
"canceledBeforeLiveTurn": "Run was canceled before its input reached the live Session turn."
}
diff --git a/vibe/i18n/zh.json b/vibe/i18n/zh.json
index c4722808b..ce156eea9 100644
--- a/vibe/i18n/zh.json
+++ b/vibe/i18n/zh.json
@@ -187,7 +187,8 @@
"bindingUnresolvedPaused": "已暂停:绑定的 Agent 会话 {session} 无法接收请求,该定义继续运行只会反复失败。请用以下命令重新绑定:vibe task update {id} --session-id <id>;然后恢复:vibe task resume {id}。",
"cli": {
"help": {
- "cancel": "\u8bf7\u6c42\u5c3d\u529b\u53d6\u6d88\u4e00\u4e2a run\uff1b\u82e5\u8be5 run \u5df2\u8fdb\u5165\u6b63\u5728\u8fd0\u884c\u7684 Session turn\uff0c\u4f1a\u50cf Session Stop \u4e00\u6837\u505c\u6b62\u6574\u4e2a turn"
+ "cancel": "\u8bf7\u6c42\u5c3d\u529b\u53d6\u6d88\u4e00\u4e2a run\uff1b\u82e5\u8be5 run \u5df2\u8fdb\u5165\u6b63\u5728\u8fd0\u884c\u7684 Session turn\uff0c\u4f1a\u50cf Session Stop \u4e00\u6837\u505c\u6b62\u6574\u4e2a turn",
+ "showBrief": "只显示状态、时间、错误和回调字段,与 vibe runs list 相同"
},
"canceledBeforeLiveTurn": "\u8be5 run \u5728\u5176\u8f93\u5165\u8fdb\u5165\u6b63\u5728\u8fd0\u884c\u7684 Session turn \u4e4b\u524d\u5df2\u88ab\u53d6\u6d88\u3002"
}