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.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
feat(cli): scope Session-owned lists to the caller Session (#2961)
Call White5e7792db7201
diff --git a/core/services/harness_status.py b/core/services/harness_status.pyindex d308e08ee..1722dfa2a 100644--- a/core/services/harness_status.py+++ b/core/services/harness_status.py@@ -74,6 +74,7 @@ def _project_run(row: dict[str, Any], now: datetime) -> dict[str, Any]:"agent_name": row.get("agent_name"),"agent_backend": row.get("agent_backend"),"session_id": row.get("session_id"),+ "callback_session_id": row.get("callback_session_id"),"definition_id": row.get("definition_id") or row.get("task_id"),"created_at": row.get("created_at"),"started_at": row.get("started_at"),@@ -128,10 +129,18 @@ def build_harness_status(watches: Iterable[dict[str, Any]],tasks: Iterable[dict[str, Any]],runtime_snapshot: dict[str, Any],+ session_id: str | None = None,truncated: dict[str, bool] | None = None,now: datetime | None = None,) -> dict[str, Any]:- """Combine durable and controller facts without inventing lifecycle state."""+ """Combine durable and controller facts without inventing lifecycle state.++ ``runs``, ``watches`` and ``tasks`` arrive already read for the requested+ Session (``None`` is every Session). The controller snapshot is always the+ whole runtime, because a working-directory conflict is between Sessions: a+ scoped view keeps only that Session's runtime rows, and the conflicts and+ controller faults that involve it.+ """observed_now = now or datetime.now(timezone.utc)if observed_now.tzinfo is None:@@ -251,21 +260,27 @@ def build_harness_status(continuefor member in members:member.setdefault("anomaly_codes", []).append("active_workdir_conflict")+ conflict_session_ids = sorted(+ {+ str(member.get("session_id") or member.get("base_session_id"))+ for member in members+ }+ )+ if session_id is not None and session_id not in conflict_session_ids:+ continueanomalies.append({"code": "active_workdir_conflict","severity": "warning","workdir": workdir,- "session_ids": sorted(- {- str(member.get("session_id") or member.get("base_session_id"))- for member in members- }- ),+ "session_ids": conflict_session_ids,"backends": sorted({str(member.get("backend")) for member in members}),})+ if session_id is not None:+ runtime_rows = [row for row in runtime_rows if row.get("session_id") == session_id]+return {"generated_at": observed_now.isoformat(),"controller": {diff --git a/core/show_pages.py b/core/show_pages.pyindex 653b49ab1..7d38b5e7f 100644--- a/core/show_pages.py+++ b/core/show_pages.py@@ -635,17 +635,13 @@ def _new_share_id() -> str:return candidate-def _like_pattern(value: str, *, prefix: bool = False, contains: bool = False) -> str:+def _like_contains_pattern(value: str) -> str:escaped = (value.replace(_LIKE_ESCAPE, _LIKE_ESCAPE + _LIKE_ESCAPE).replace("%", _LIKE_ESCAPE + "%").replace("_", _LIKE_ESCAPE + "_"))- if contains:- return f"%{escaped}%"- if prefix:- return f"{escaped}%"- return escaped+ return f"%{escaped}%"def _resolve_resource_access_context(user_context: Any = None):@@ -1079,13 +1075,13 @@ class ShowPageStore:show_pages.c.access_mode == visibility,)if session_id:- statement = statement.where(show_pages.c.session_id.like(_like_pattern(session_id, prefix=True), escape=_LIKE_ESCAPE))+ statement = statement.where(show_pages.c.session_id == session_id)if updated_after:statement = statement.where(show_pages.c.updated_at >= updated_after)if updated_before:statement = statement.where(show_pages.c.updated_at <= updated_before)if query:- pattern = _like_pattern(query, contains=True)+ pattern = _like_contains_pattern(query)clauses = [show_pages.c.session_id.like(pattern, escape=_LIKE_ESCAPE),show_pages.c.share_id.like(pattern, escape=_LIKE_ESCAPE),diff --git a/docs/CLI.md b/docs/CLI.mdindex 3257bb96e..1fb50cf19 100644--- a/docs/CLI.md+++ b/docs/CLI.md@@ -25,6 +25,32 @@ and never provide an unpaginated `--all` bypass. Follow`pagination.next_command` for the next page and use the corresponding `show` or`get` command for full record detail.+### Session-owned lists++`vibe harness status`, `vibe runs list`, `vibe task list`, `vibe watch list`,+and `vibe show list` read records that belong to an Agent Session, and share one+scope grammar:++```bash+vibe watch list # the caller Session (AVIBE_SESSION_ID)+vibe watch list --session-id sesk8m4q2p7x # another Session+vibe watch list --global # every Session+```++Inside an Avibe Agent shell the caller Session is the default. Outside one there+is no default: pass `--session-id` or `--global`, otherwise the command fails+with `missing_caller_session`. The two flags cannot be combined. Each response+reports the scope it read as `session_id` and `global`, and+`pagination.next_command` repeats the scope flags you passed.++A Session's Runs are the Runs it ran, dispatched from its Agent, or receives a+result from, so delegated work stays visible to the Session that delegated it.+Its Watches are the Watches that follow up in it, its Tasks the Tasks it created+(or that run in it when the creator is unknown or gone), and its Show Page the+page with its id; Watches and Tasks match the Workbench's "this Session" filter.+`vibe harness status` keeps controller faults and any working-directory conflict+that involves the Session.+## Remote Web UI AccessBy default, the Web UI binds to `127.0.0.1:5123` on the machine where Avibe is running.@@ -393,14 +419,15 @@ may be omitted and defaults to the caller Session from `AVIBE_SESSION_ID`.List and inspect Agent run records.```bash-vibe runs list --session-id sesk8m4q2p7x --brief+vibe runs list --brief # inside an Avibe Agent shell, the caller Session's runs+vibe runs list --global --definition-id <task-or-watch-id> # every fire, across per-run Sessionsvibe runs show run_abc123vibe runs show run_abc123 --brief # status, timing, error, and callback fields onlyvibe 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+`vibe runs list` follows the [Session-owned list](#session-owned-lists) scope+grammar. `vibe runs show` can omit the run id inside anAvibe-injected Agent run and defaults to `AVIBE_RUN_ID`. It prints the fullrecord, 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@@ -561,7 +588,8 @@ vibe watch resume <watch-id>vibe watch remove <watch-id>```-`vibe task list` and `vibe watch list` return 20 definitions per page and+`vibe task list` and `vibe watch list` read the caller Session by default (see+[Session-owned lists](#session-owned-lists)), return 20 definitions per page, andinclude `pagination.next_command` when more rows exist. Successful one-shotdefinitions are hidden by default. Add `--include-finished` to page throughhistory. List output is always bounded; there is no unpaginated `--all` mode.diff --git a/docs/CLI_ZH.md b/docs/CLI_ZH.mdindex b08ae591b..ef2c12d00 100644--- a/docs/CLI_ZH.md+++ b/docs/CLI_ZH.md@@ -23,6 +23,28 @@ list/marks、`vibe data query`、`vibe task list` 和 `vibe watch list`。默认绕过。使用 `pagination.next_command` 继续翻页;完整记录详情通过对应的 `show`或 `get` 命令获取。+### Session 归属的列表++`vibe harness status`、`vibe runs list`、`vibe task list`、`vibe watch list`+和 `vibe show list` 读取归属于某个 Agent Session 的记录,共用同一套范围语法:++```bash+vibe watch list # 调用方 Session(AVIBE_SESSION_ID)+vibe watch list --session-id sesk8m4q2p7x # 其他 Session+vibe watch list --global # 所有 Session+```++在 Avibe Agent shell 内默认读取调用方 Session。在 Agent shell 之外没有默认值:+需要传 `--session-id` 或 `--global`,否则命令以 `missing_caller_session` 失败。+两个参数不能同时使用。每个响应都用 `session_id` 和 `global` 说明实际读取的范围,+`pagination.next_command` 会重复你传入的范围参数。++Session 的 Run 包括在它里面运行的、由它的 Agent 派发的,以及结果回调给它的 Run,+因此委派出去的工作对委派方 Session 仍然可见。Watch 归属于它回调的 Session,+Task 归属于创建它的 Session(创建方未知或已不存在时归属于它运行所在的 Session),+Show Page 按 Session id 归属;Watch 和 Task 的归属与 Workbench 的“只看本会话”一致。+`vibe harness status` 会保留控制器故障,以及涉及该 Session 的工作目录冲突。+## 远程访问 Web UI默认情况下,Web UI 只监听在运行 Avibe 的那台机器的 `127.0.0.1:5123`。@@ -304,14 +326,15 @@ vibe session update --title 'Release review' # 在 Avibe Agent s列出和查看 Agent run 记录。```bash-vibe runs list --session-id sesk8m4q2p7x --brief+vibe runs list --brief # 在 Avibe Agent shell 内查看调用方 Session 的 run+vibe runs list --global --definition-id <task-or-watch-id> # 跨每次运行各自的 Session 查看全部触发vibe runs show run_abc123vibe 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 内+`vibe runs list` 遵循 [Session 归属的列表](#session-归属的列表) 的范围语法。+`vibe runs show` 在 Avibe 已注入 caller context 的 Agent run 内可以省略 run id,并默认使用 `AVIBE_RUN_ID`。它输出完整记录:发给 Agent 的文本在`message`,回复在 `result_text`;`--brief` 只输出与 `vibe runs list` 相同的精简行,用于查看状态。@@ -454,7 +477,8 @@ vibe watch resume <watch-id>vibe watch remove <watch-id>```-`vibe task list` 和 `vibe watch list` 默认每页返回 20 条定义;还有下一页时,+`vibe task list` 和 `vibe watch list` 默认读取调用方 Session(见+[Session 归属的列表](#session-归属的列表)),每页返回 20 条定义;还有下一页时,响应会包含 `pagination.next_command`。默认隐藏成功结束的一次性定义;使用`--include-finished` 分页查看历史。列表输出始终有上限,不提供无分页的 `--all` 模式。task 和 watch 命令用 `definition` 表示单条记录、用 `definitions` 表示列表,diff --git a/docs/COMMANDS.md b/docs/COMMANDS.mdindex ab80f1e72..f1e1f378a 100644--- a/docs/COMMANDS.md+++ b/docs/COMMANDS.md@@ -853,10 +853,12 @@ exists.### `vibe task list````bash-vibe task list [--include-finished] [--page N] [--limit N]+vibe task list [--session-id <id> | --global] [--include-finished] [--page N] [--limit N]```-Returns compact rows, 20 per page by default and at most 100. Use+Lists the caller Session's tasks inside an Avibe Agent shell; pass `--session-id`+for another Session or `--global` for every Session (required outside an Agent+shell). Returns compact rows, 20 per page by default and at most 100. Use`pagination.next_command` to continue; use `vibe task show <task_id>` for detail.List and show expose the Workbench lifecycle projection. Watch rows additionallyinclude tri-state `process_alive`; compatibility `state` / `last_status` fields@@ -1001,7 +1003,7 @@ direct Agent Run calls.| Subcommand | Purpose || --- | --- |-| `vibe runs list` | List recent runs |+| `vibe runs list` | List the caller Session's recent runs; `--session-id <id>` for another Session, `--global` for every Session || `vibe runs show <run_id>` | Show one run || `vibe runs cancel <run_id>` | Request cancellation; once the run's input reached the live Session turn, this stops that turn like Session Stop, including other runs sharing it |@@ -1038,6 +1040,6 @@ Use the right command family for the job:vibevibe statusvibe doctor-vibe task list+vibe task list --globalvibe agent run --no-callback --session-id sesk8m4q2p7x --message 'Share the latest build summary.'```diff --git a/docs/COMMANDS_ZH.md b/docs/COMMANDS_ZH.mdindex 09e1dbc4c..abdf0f8af 100644--- a/docs/COMMANDS_ZH.md+++ b/docs/COMMANDS_ZH.md@@ -789,10 +789,11 @@ vibe task update <task_id> [options]### `vibe task list````bash-vibe task list [--include-finished] [--page N] [--limit N]+vibe task list [--session-id <id> | --global] [--include-finished] [--page N] [--limit N]```-默认每页返回 20 条紧凑记录,单页最多 100 条。按 `pagination.next_command`+在 Avibe Agent shell 内列出调用方 Session 的任务;用 `--session-id` 查看其他+Session,用 `--global` 查看所有 Session(在 Agent shell 之外必须二选一)。默认每页返回 20 条紧凑记录,单页最多 100 条。按 `pagination.next_command`继续翻页;需要完整详情时使用 `vibe task show <task_id>`。list 和 show 会返回与 Workbench 相同的 lifecycle 投影。watch 还包含三态的`process_alive`;兼容字段 `state` / `last_status` 不定义 lifecycle。@@ -926,7 +927,7 @@ Session、`--create-session` 或 fork)设置模型,该 Session 会沿用它| 子命令 | 作用 || --- | --- |-| `vibe runs list` | 列出最近 run |+| `vibe runs list` | 列出调用方 Session 最近的 run;`--session-id <id>` 查看其他 Session,`--global` 查看所有 Session || `vibe runs show <run_id>` | 查看单个 run || `vibe runs cancel <run_id>` | 请求取消 run;若该 run 的输入已进入正在运行的 Session turn,会像 Session Stop 一样停止整个 turn,同一 turn 中的其他 run 也会一起停止 |@@ -963,6 +964,6 @@ Session、`--create-session` 或 fork)设置模型,该 Session 会沿用它vibevibe statusvibe doctor-vibe task list+vibe task list --globalvibe agent run --no-callback --session-id sesk8m4q2p7x --message 'Share the latest build summary.'```diff --git a/docs/maintenance/upstream-dependency-maintenance.md b/docs/maintenance/upstream-dependency-maintenance.mdindex e3c79e3ae..638766c49 100644--- a/docs/maintenance/upstream-dependency-maintenance.md+++ b/docs/maintenance/upstream-dependency-maintenance.md@@ -33,7 +33,7 @@ scheduled GitHub workflow, daemon, or live Task in a dependency PR.## Weekly or on-demand procedure1. **Preflight ownership.** Inspect `vibe data query` for live Sessions and- Runs, `vibe watch list`, and `gh pr list --state open`. Do not touch another+ Runs, `vibe watch list --global`, and `gh pr list --state open`. Do not touch anotherowner's dirty worktree or candidate branch. If a matching owner PR is live,coalesce into that work only when its owner explicitly accepts the handoff;otherwise report and skip.diff --git a/docs/plans/agent-run-scope-semantics.md b/docs/plans/agent-run-scope-semantics.mdindex 6f4e1eec1..27dded9a3 100644--- a/docs/plans/agent-run-scope-semantics.md+++ b/docs/plans/agent-run-scope-semantics.md@@ -82,8 +82,20 @@ sync runs, the route is recorded for future detach-to-async behavior.## Other CLI Defaults-- `vibe runs list` remains global by default.-- `vibe runs list --current-session` filters to `AVIBE_SESSION_ID`.+- Lists of Session-owned records (`vibe harness status`, `vibe runs list`,+ `vibe task list`, `vibe watch list`, `vibe show list`) read the caller Session+ from `AVIBE_SESSION_ID` by default. `--session-id <id>` reads another Session+ and `--global` reads every Session; the two are mutually exclusive. Without a+ caller Session there is no default, and the command fails with+ `missing_caller_session` rather than silently widening to every Session.+ A Session's Runs are those it ran, dispatched from its Agent+ (`source_kind='agent'`, `source_actor`), or receives a result from+ (`callback_session_id`); Watch and Task ownership is the Workbench "this+ Session" filter's. Responses report the scope they read as `session_id` and+ `global`.+- Lists of records that do not belong to a Session (`vibe agent list`,+ `vibe skill list`, Vault lists, `vibe session list`) have no Session scope;+ `vibe session ...` commands address the Session itself positionally.- `vibe runs show` may default to `AVIBE_RUN_ID`.- `vibe runs cancel` stays explicit; no `--current-run` shortcut in this batch.- Single-object session commands may default object id from `AVIBE_SESSION_ID`.diff --git a/scripts/terminal_bench/runner.py b/scripts/terminal_bench/runner.pyindex 65740d6ed..530d53ffd 100644--- a/scripts/terminal_bench/runner.py+++ b/scripts/terminal_bench/runner.py@@ -352,7 +352,7 @@ class FullRuntimeTrial:# A Run's final reply can hand over to a Watch, scheduled Task# or subagent. They are real product work, not noise to discard# at the first terminal. This home belongs only to this trial.- status = self._call("cli", "harness", "status", timeout=15)+ status = self._call("cli", "harness", "status", "--global", timeout=15)if (not status.get("controller", {}).get("available")or any(status.get("truncated", {}).values())):raise TrialError("harness_quiescence_unconfirmed")diff --git a/skills/agent-prompt-audit/SKILL.md b/skills/agent-prompt-audit/SKILL.mdindex fe9fd9069..d478cf400 100644--- a/skills/agent-prompt-audit/SKILL.md+++ b/skills/agent-prompt-audit/SKILL.md@@ -82,7 +82,7 @@ actually loads rather than assuming default paths.| Project rules | nearest `AGENTS.md` / `CLAUDE.md` chain | The repository's own delivery process || Agent system prompt, model, effort | `vibe agent show <name> --json` | `vibe agent update <name> --system-prompt-file <file>` || Skills | user skill dirs (follow symlinks), Avibe `skills/`, project `.agents/skills/` | The directory's owner |-| Task and Watch messages (re-sent every fire) | `vibe task list` / `vibe watch list` for ids, then `vibe task show <id>` / `vibe watch show <id>` for the full text | `vibe task update`, `vibe watch update` |+| Task and Watch messages (re-sent every fire) | `vibe task list --session-id <id>` / `vibe watch list --session-id <id>` (or `--global`) for ids, then `vibe task show <id>` / `vibe watch show <id>` for the full text | `vibe task update`, `vibe watch update` || User preferences (read on demand) | `~/.avibe/state/user_preferences.md`; inspect only the reported user's part, and only when the transcript shows it was read | The user || Delegation briefs and callbacks | `agent_runs.message` / `result_text` | The prompt or Skill that writes them |@@ -110,7 +110,7 @@ no history covers it, say the attribution is unconfirmed.`messages`. Keep evidence to the Session the user reported, plus any others they pointto — a channel's `scope_id` can hold other people's threads; the user'sown corrections in `messages` are usually the sharpest evidence. For a-recurring Task or Watch, `vibe runs list --definition-id <id>` gathers its+recurring Task or Watch, `vibe runs list --global --definition-id <id>` gathers itsfires across per-run Sessions. A stuck delegated turn stays `running`, so includelong-running rows when the complaint is a stall; ordinary IM turns have no`agent_runs` row, so read that Session's messages instead. A delegated run can succeed whilediff --git a/skills/use-avibe-harness/SKILL.md b/skills/use-avibe-harness/SKILL.mdindex dc04e7a5b..058fbf970 100644--- a/skills/use-avibe-harness/SKILL.md+++ b/skills/use-avibe-harness/SKILL.md@@ -31,7 +31,7 @@ Relationship: Scope routes work; Agent defines who acts; Session holds continuit- The authoritative current Session id is provided by Avibe at the start of the System Prompt.### Inspecting Harness state-Use `vibe harness status` first for active Runs, armed Watches, upcoming Tasks, controller ownership, and explicit live anomalies. Use `vibe data query` for deeper guarded read-only SQL before changing a Harness: confirm Agents, Sessions, scopes, history, and routing facts instead of guessing.+Use `vibe harness status` first for this Session's active Runs, armed Watches, upcoming Tasks, runtime, and live anomalies. Session-owned lists (`vibe harness status`, `vibe runs list`, `vibe task list`, `vibe watch list`, `vibe show list`) read this Session by default; add `--session-id <id>` for another Session or `--global` for every Session. Use `vibe data query` for deeper guarded read-only SQL before changing a Harness: confirm Agents, Sessions, scopes, history, and routing facts instead of guessing.Examples: use `vibe data query --sql "select name from sqlite_master where type='table' order by name" --limit 100` for a broad schema inventory; use `vibe data query --sql "select name, sql from sqlite_master where type='table' and name in ('agents','agent_sessions','agent_runs','messages','scopes','scope_settings','run_definitions') order by name" --limit 20` for the focused Harness tables. Follow `pagination.next_command` if either result has more pages.@@ -50,7 +50,7 @@ Useful Harness queries include schema discovery, current session lookup, existin| Promote an existing queued Session head now | `vibe session send-now <session-id>` || Branch from current Session context | `vibe agent run --fork-self ...` || Live/anomaly inspection | `vibe harness status` |-| State/history inspection | `vibe data query`, `vibe runs list --current-session`, `vibe runs show` |+| State/history inspection | `vibe data query`, `vibe runs list`, `vibe runs show` || Recurring specialist workflow | `vibe agent create/update` plus tasks, watches, or runs |`vibe task add` creates a time-triggered saved Agent message. Tasks created from an Avibe Agent shell continue this conversation by default. Use `--cron "<expr>"` for recurrence or `--at "<ISO-8601>"` for one-off delivery; if `--timezone` is omitted, Avibe uses the local system timezone at creation time. Write cron weekdays as names (`mon` ... `sun`, e.g. `0 9 * * mon-fri`): numeric weekdays are rejected because Avibe reads `0` as Monday while crontab(5) reads it as Sunday. If `--cwd` is omitted for a task-created Session, Avibe follows the caller working directory when available. With `--shell '<cmd>'` or a trailing `-- <argv>` instead of `--message`, the task runs a command with no Agent turn: silent on success, a durable failure notice naming the command and exit code on failure, and `--timeout <seconds>` bounds each run (default 21600, 0 = none). Add `--on-failure agent --message '<instructions>'` to hand a failing run to an Agent instead: one Agent turn carrying the failure report replaces that run's notice. A pure command task takes no session, scope, or agent flags.@@ -75,7 +75,7 @@ Use `vibe session update --visible|--hidden` (`--visibility foreground|backgrounFor tasks, use `--message "..."` or `--message-file <path>` as the stored message. For watches, use `--message "..."` or `--message-file <path>` as the follow-up instruction template sent with waiter output. Prefer `--same-scope` or `--scope-id <scopes.id>` for new Session placement.-Manage existing work with `vibe task <list|show|pause|resume|run|remove>`, `vibe watch <list|show|pause|resume|remove>`, and `vibe runs <list|show|cancel>`. Use `vibe harness status` for one unified live/anomaly snapshot. For current-session run history, use `vibe runs list --current-session`. `vibe runs show` can default to the current Run from the injected environment; `vibe runs cancel` still requires an explicit run id; once that run's input reached the live Session turn, it stops the whole turn like Session Stop, including other runs sharing it.+Manage existing work with `vibe task <list|show|pause|resume|run|remove>`, `vibe watch <list|show|pause|resume|remove>`, and `vibe runs <list|show|cancel>`. Use `vibe harness status` for one unified live/anomaly snapshot. These lists cover this Session unless you pass `--session-id <id>` or `--global`. `vibe runs show` can default to the current Run from the injected environment; `vibe runs cancel` still requires an explicit run id; once that run's input reached the live Session turn, it stops the whole turn like Session Stop, including other runs sharing it.The CLI exposes more options than this prompt lists. Before creating or changing Harness state, or whenever syntax/runtime effects are uncertain, read the relevant help: `vibe <command> --help` or `vibe <command> <subcommand> --help`.diff --git a/skills/use-avibe/references/harness.md b/skills/use-avibe/references/harness.mdindex 99b9158ed..aedf4b7c7 100644--- a/skills/use-avibe/references/harness.md+++ b/skills/use-avibe/references/harness.md@@ -55,6 +55,7 @@ Targeting and callbacks:Operational guidance:- use `vibe task list` before editing or deleting an existing task; use `vibe watch list` before touching a managed watch+- `vibe harness status`, `vibe runs list`, `vibe task list`, `vibe watch list`, and `vibe show list` read this Session by default; pass `--session-id <id>` for another Session or `--global` for every Session- if this is the first time using `vibe task add`, `vibe agent run`, `vibe runs`, or `vibe watch add`, read the matching `--help` output first — watches and command tasks both accept `--shell` and `--timeout` (per-cycle for watches, per-run for tasks), while `--lifetime-timeout` (overall), `--forever`, `--retry-exit-code`, and `--retry-delay` stay watch-only- for Watch waiters, exit `0` means one new reportable event; an allowed retry exit code keeps either mode waiting, while `64` plus `avibe-watch: no-event` ends a once Watch or re-arms a forever Watch without an Agent Run; a once waiter that is still waiting must use a retry exit code- a forever waiter must keep a durable cursor, state transition, or domain cooldown; Avibe serializes its event follow-ups and automatically pauses plus sends a repair Run after six successful events within 60 secondsdiff --git a/skills/use-avibe/references/operations.md b/skills/use-avibe/references/operations.mdindex 81d74a4de..54f368897 100644--- a/skills/use-avibe/references/operations.md+++ b/skills/use-avibe/references/operations.md@@ -79,17 +79,17 @@ Screenshots:Scheduled tasks:-- `vibe task add`, `vibe task update`, `vibe task list [--include-finished] [--page N] [--limit N]`, `vibe task show <id>`, `vibe task run <id>`, `vibe task pause <id>`, `vibe task resume <id>`, `vibe task remove <id>`+- `vibe task add`, `vibe task update`, `vibe task list [--session-id <id> | --global] [--include-finished] [--page N] [--limit N]`, `vibe task show <id>`, `vibe task run <id>`, `vibe task pause <id>`, `vibe task resume <id>`, `vibe task remove <id>`- Switching a task between message and command form, or changing `--on-failure`, is rejected — remove and recreate.Agent runs:- `vibe agent run` — run one Agent job now. Runs are async by default; pass `--sync` only when the CLI should wait.-- `vibe runs list`, `vibe runs show <id>`, `vibe runs cancel <id>` — inspect and manage concrete Agent Run records+- `vibe runs list [--session-id <id> | --global]`, `vibe runs show <id>`, `vibe runs cancel <id>` — inspect and manage concrete Agent Run recordsWatches:-- `vibe watch add`, `vibe watch update <id>`, `vibe watch list [--include-finished] [--page N] [--limit N]`, `vibe watch show <id>`, `vibe watch pause <id>`, `vibe watch resume <id>`, `vibe watch remove <id>`+- `vibe watch add`, `vibe watch update <id>`, `vibe watch list [--session-id <id> | --global] [--include-finished] [--page N] [--limit N]`, `vibe watch show <id>`, `vibe watch pause <id>`, `vibe watch resume <id>`, `vibe watch remove <id>`For any subcommand, prefer `<command> --help` before composing a new invocation. Harness commands default to this Agent Session inside an Avibe-injected Agent shell. Use `--session-id` only to target a different existing Session, `--same-scope` or `--scope-id` when creating a Session in a visible scope, and `--no-callback` only when an async Agent run will be inspected later through `vibe runs`. Use `--message` / `--message-file` for user messages. `vibe task add` and `vibe watch add` take `--name`; only `vibe task add` takes `--cron` / `--at` / `--timezone`; `vibe agent run` takes `--sync`; and `vibe watch add` takes its own waiter options (`--shell` or a positional command after `--`, `--cwd`, `--timeout`, `--forever`, `--lifetime-timeout`, `--retry-exit-code`, `--retry-delay`). `vibe task add` also accepts `--shell` or a command after `--`, plus `--on-failure {none,agent}` and a per-run `--timeout`; a pure command task takes no session, scope, or agent flags. Do not copy flags between task, watch, and agent-run commands without checking help.diff --git a/storage/background.py b/storage/background.pyindex fa9e03e6a..bdb15ff74 100644--- a/storage/background.py+++ b/storage/background.py@@ -4579,11 +4579,14 @@ class SQLiteBackgroundTaskStore:)return page_result_from_limit_plus_one(rows, page_request)- def list_active_runs(self, *, limit: int) -> list[dict[str, Any]]:- """Return a bounded anomaly-first snapshot of operator-visible Runs."""+ def list_active_runs(self, *, limit: int, session_id: Optional[str] = None) -> list[dict[str, Any]]:+ """Return a bounded anomaly-first snapshot of operator-visible Runs.++ ``session_id`` narrows it to one Session's Runs; ``None`` reads every Session.+ """stmt = (- self._runs_query(exclude_run_type=(_WATCH_RUNTIME_RUN_TYPE,))+ self._runs_query(exclude_run_type=(_WATCH_RUNTIME_RUN_TYPE,), session_id=session_id).where(agent_runs.c.status.in_(_status_query_values("queued") + _status_query_values("running")@@ -4630,13 +4633,18 @@ class SQLiteBackgroundTaskStore:definition_type: str,*,limit: int,+ session_id: Optional[str] = None,) -> list[dict[str, Any]]:- """Return a bounded snapshot of armed Tasks or Watches."""+ """Return a bounded snapshot of armed Tasks or Watches.++ ``session_id`` narrows it with the same Session ownership the Workbench+ "this Session" filter uses; ``None`` reads every Session.+ """if definition_type not in {"scheduled", "watch"}:raise ValueError("definition_type must be scheduled or watch")row_limit = max(0, int(limit))- stmt = self._definitions_query(definition_type).where(+ stmt = self._definitions_query(definition_type, session_id=session_id).where(run_definitions.c.enabled != 0)converter = (@@ -4812,7 +4820,19 @@ class SQLiteBackgroundTaskStore:if agent_backend:stmt = stmt.where(agent_runs.c.agent_backend == agent_backend)if session_id:- stmt = stmt.where(agent_runs.c.session_id == session_id)+ # A Run belongs to the Session it runs in, the Session its result+ # returns to, and the Session whose Agent dispatched it: a delegated+ # Run is the dispatching Session's work as much as its target's.+ stmt = stmt.where(+ or_(+ agent_runs.c.session_id == session_id,+ agent_runs.c.callback_session_id == session_id,+ and_(+ agent_runs.c.source_kind == "agent",+ agent_runs.c.source_actor == session_id,+ ),+ )+ )if definition_id:stmt = stmt.where(agent_runs.c.definition_id == definition_id)if created_after:diff --git a/tests/test_cli_agent_run_schema.py b/tests/test_cli_agent_run_schema.pyindex ff451afcc..ffdd39afa 100644--- a/tests/test_cli_agent_run_schema.py+++ b/tests/test_cli_agent_run_schema.py@@ -1918,32 +1918,6 @@ def test_resolve_run_cwd_defaults_by_session_target(monkeypatch, tmp_path: Path)assert cli._resolve_run_cwd(args, session_policy="create", scoped_session=True, help_command="x") == str(tmp_path)-def test_runs_list_current_session_filters_from_caller_env(tmp_path: Path, capsys) -> None:- request_store = cli.TaskExecutionStore(tmp_path / "task_requests")- request_store.enqueue_agent_run(- message="current",- agent_name="worker",- session_id="ses-current",- )- request_store.enqueue_agent_run(- message="other",- agent_name="worker",- session_id="ses-other",- )- parser = cli.build_parser()- args = parser.parse_args(["runs", "list", "--current-session"])-- with (- patch.dict("os.environ", {"AVIBE_SESSION_ID": "ses-current"}),- patch("vibe.cli._task_request_store", return_value=request_store),- ):- result = cli.cmd_runs_list(args)-- assert result == 0- payload = json.loads(capsys.readouterr().out)- assert [run["session_id"] for run in payload["runs"]] == ["ses-current"]--@pytest.mark.parametrize("activity_at",(@@ -1964,14 +1938,3 @@ def test_brief_run_payload_parses_supported_iso_instants(activity_at: str) -> No)assert payload["activity_age_seconds"] == 0.0---def test_runs_list_current_session_conflicts_with_session_id(capsys) -> None:- parser = cli.build_parser()- args = parser.parse_args(["runs", "list", "--current-session", "--session-id", "ses-explicit"])-- result = cli.cmd_runs_list(args)-- assert result == 1- payload = json.loads(capsys.readouterr().err)- assert payload["code"] == "conflicting_session_filter"diff --git a/tests/test_cli_definition_read_projection.py b/tests/test_cli_definition_read_projection.pyindex f7cfb019a..89d301cc7 100644--- a/tests/test_cli_definition_read_projection.py+++ b/tests/test_cli_definition_read_projection.py@@ -148,12 +148,12 @@ def test_cli_and_workbench_share_the_definition_read_projection(capsys) -> None:before_definitions = _rows(store, run_definitions)before_runs = _rows(store, agent_runs)- assert cli.cmd_task_list(page_request=PageRequest(limit=20)) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), page_request=PageRequest(limit=20)) == 0cli_tasks = {row["id"]: rowfor row in json.loads(capsys.readouterr().out)["definitions"]}- assert cli.cmd_watch_list(include_finished=True, page_request=PageRequest(limit=20)) == 0+ assert cli.cmd_watch_list(scope=cli.SessionListScope(), include_finished=True, page_request=PageRequest(limit=20)) == 0cli_watches = {row["id"]: rowfor row in json.loads(capsys.readouterr().out)["definitions"]@@ -248,13 +248,13 @@ def test_cli_definition_lists_page_before_enrichment(monkeypatch, capsys) -> Nonmonkeypatch.setattr(SQLiteBackgroundTaskStore, "_enrich_definitions", record_page)page_request = PageRequest(page=1, limit=2)- assert cli.cmd_task_list(page_request=page_request) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), page_request=page_request) == 0task_payload = json.loads(capsys.readouterr().out)- assert cli.cmd_watch_list(page_request=page_request) == 0+ assert cli.cmd_watch_list(scope=cli.SessionListScope(), page_request=page_request) == 0watch_payload = json.loads(capsys.readouterr().out)- assert task_payload["pagination"]["next_command"] == "vibe task list --page 2 --limit 2"- assert watch_payload["pagination"]["next_command"] == "vibe watch list --page 2 --limit 2"+ assert task_payload["pagination"]["next_command"] == "vibe task list --global --page 2 --limit 2"+ assert watch_payload["pagination"]["next_command"] == "vibe watch list --global --page 2 --limit 2"assert enriched_sizes == [("scheduled", 3), ("watch", 3)]@@ -271,7 +271,7 @@ def test_task_list_pagination_is_stable_across_run_at_boundary(capsys) -> None:)_task(store, "still-waiting", created_at="2026-07-27T12:01:00+00:00")- assert cli.cmd_task_list(page_request=PageRequest(page=1, limit=1)) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), page_request=PageRequest(page=1, limit=1)) == 0first_page = json.loads(capsys.readouterr().out)# Simulate the wall clock crossing run_at between offset pages.@@ -282,7 +282,7 @@ def test_task_list_pagination_is_stable_across_run_at_boundary(capsys) -> None:.values(run_at=PAST))- assert cli.cmd_task_list(page_request=PageRequest(page=2, limit=1)) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), page_request=PageRequest(page=2, limit=1)) == 0second_page = json.loads(capsys.readouterr().out)assert [first_page["definitions"][0]["id"], second_page["definitions"][0]["id"]] == [@@ -361,6 +361,7 @@ def test_task_list_and_show_keep_unverifiable_retirements_unknown(capsys) -> Non)assert cli.cmd_task_list(+ scope=cli.SessionListScope(),include_finished=True,page_request=PageRequest(limit=20),) == 0diff --git a/tests/test_cli_pagination.py b/tests/test_cli_pagination.pyindex d0e64a09f..a6c858aab 100644--- a/tests/test_cli_pagination.py+++ b/tests/test_cli_pagination.py@@ -190,7 +190,7 @@ def test_runs_list_cli_defaults_to_first_page(monkeypatch, tmp_path, capsys) ->finally:store.close()- args = cli.build_parser().parse_args(["runs", "list", "--brief"])+ args = cli.build_parser().parse_args(["runs", "list", "--global", "--brief"])assert cli.cmd_runs_list(args) == 0payload = json.loads(capsys.readouterr().out)@@ -198,7 +198,7 @@ def test_runs_list_cli_defaults_to_first_page(monkeypatch, tmp_path, capsys) ->assert len(payload["runs"]) == 20assert payload["runs"][0]["id"] == "run-24"assert payload["pagination"]["has_more"] is True- assert payload["pagination"]["next_command"] == "vibe runs list --brief --page 2 --limit 20"+ assert payload["pagination"]["next_command"] == "vibe runs list --global --brief --page 2 --limit 20"assert "More records are available" in payload["message"]@@ -236,7 +236,7 @@ def test_runs_list_cli_filters_status_and_query(monkeypatch, tmp_path, capsys) -finally:store.close()- args = cli.build_parser().parse_args(["runs", "list", "--status", "succeeded", "--q", "weekly", "--brief"])+ args = cli.build_parser().parse_args(["runs", "list", "--global", "--status", "succeeded", "--q", "weekly", "--brief"])assert cli.cmd_runs_list(args) == 0payload = json.loads(capsys.readouterr().out)@@ -270,7 +270,7 @@ def test_runs_list_cli_normalizes_offset_time_filters(monkeypatch, tmp_path, capfinally:store.close()- args = cli.build_parser().parse_args(["runs", "list", "--created-after", "2026-05-25T10:00:00+08:00", "--brief"])+ args = cli.build_parser().parse_args(["runs", "list", "--global", "--created-after", "2026-05-25T10:00:00+08:00", "--brief"])assert cli.cmd_runs_list(args) == 0payload = json.loads(capsys.readouterr().out)@@ -295,7 +295,7 @@ def test_runs_list_cli_next_command_uses_absolute_time_filters(monkeypatch, tmp_finally:store.close()- args = cli.build_parser().parse_args(["runs", "list", "--created-after", "2026-05-25T08:00:00+08:00", "--limit", "10"])+ args = cli.build_parser().parse_args(["runs", "list", "--global", "--created-after", "2026-05-25T08:00:00+08:00", "--limit", "10"])assert cli.cmd_runs_list(args) == 0payload = json.loads(capsys.readouterr().out)@@ -372,7 +372,7 @@ def test_runs_show_prints_the_run_text_once_and_brief_prints_the_list_row(monkeyassert cli.cmd_runs_show(cli.build_parser().parse_args(["runs", "show", "run-done", "--brief"])) == 0brief = json.loads(capsys.readouterr().out)["run"]- assert cli.cmd_runs_list(cli.build_parser().parse_args(["runs", "list"])) == 0+ assert cli.cmd_runs_list(cli.build_parser().parse_args(["runs", "list", "--global"])) == 0assert brief == json.loads(capsys.readouterr().out)["runs"][0]assert (brief["status"], "message" in brief) == ("succeeded", False)diff --git a/tests/test_cli_session_list_scope.py b/tests/test_cli_session_list_scope.pynew file mode 100644index 000000000..c639257dd--- /dev/null+++ b/tests/test_cli_session_list_scope.py@@ -0,0 +1,259 @@+"""One scope grammar for every CLI list of Session-owned records.++An Agent reads its own Session by default (``AVIBE_SESSION_ID``); ``--session-id``+names another Session and ``--global`` reads every Session. Outside an Agent+shell there is no default, so the command asks for one of the two.+"""++from __future__ import annotations++import json+import sys++import pytest++from config import paths+from core.show_pages import ShowPageStore+from storage.background import SQLiteBackgroundTaskStore+from vibe import cli, internal_client++MINE = "ses-mine"+OTHER = "ses-other"+CREATED_AT = "2026-08-12T00:00:00+00:00"+++def _definition_sessions(payload: dict) -> set[str]:+ return {item["session_id"] for item in payload["definitions"]}+++def _harness_sessions(payload: dict) -> set[str]:+ return {+ row["session_id"]+ for section in ("runs", "watches", "tasks", "runtime_agents")+ for row in payload[section]+ }+++# (argv, sessions in the payload). Each command reads a different store, so each+# one is a separate wiring of the shared scope.+COMMANDS = {+ "task list": (["task", "list"], _definition_sessions),+ "watch list": (["watch", "list"], _definition_sessions),+ "runs list": (["runs", "list"], lambda payload: {run["session_id"] for run in payload["runs"]}),+ "harness status": (["harness", "status"], _harness_sessions),+ "show list": (["show", "list", "--json"], lambda payload: {page["session_id"] for page in payload["pages"]}),+}+++def two_sessions(monkeypatch, tmp_path):+ """Each Session-owned record kind, once in this Session and once in another."""++ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))+ paths.ensure_data_dirs()+ store = SQLiteBackgroundTaskStore()+ try:+ for session_id in (MINE, OTHER):+ store.upsert_watch(+ {+ "id": f"watch-{session_id}",+ "name": f"watch {session_id}",+ "session_id": session_id,+ "shell_command": "true",+ "enabled": True,+ "created_at": CREATED_AT,+ "updated_at": CREATED_AT,+ }+ )+ store.upsert_scheduled_task(+ {+ "id": f"task-{session_id}",+ "name": f"task {session_id}",+ "session_id": session_id,+ "schedule_type": "at",+ "run_at": "2099-01-01T00:00:00+00:00",+ "timezone": "UTC",+ "enabled": True,+ "created_at": CREATED_AT,+ "updated_at": CREATED_AT,+ }+ )+ store.enqueue_run(+ {+ "id": f"run-{session_id}",+ "request_type": "agent_run",+ "status": "queued",+ "agent_name": "worker",+ "agent_backend": "codex",+ "session_id": session_id,+ "message": "continue",+ "created_at": CREATED_AT,+ "updated_at": CREATED_AT,+ }+ )+ finally:+ store.close()+ show_store = ShowPageStore()+ try:+ show_store.ensure(MINE)+ show_store.ensure(OTHER)+ finally:+ show_store.close()++ async def _controller_snapshot(*, run_ids):+ return {+ "status_code": 200,+ "body": {+ "ok": True,+ "agents": [+ {"backend": "codex", "state": "active", "session_id": session_id, "workdir": f"/work/{session_id}"}+ for session_id in (MINE, OTHER)+ ],+ "owned_run_ids": [],+ "ownership_available": True,+ },+ }++ monkeypatch.setattr(internal_client, "list_running_agents", _controller_snapshot)+++def _run_cli(monkeypatch, capsys, argv: list[str]) -> tuple[int, dict]:+ monkeypatch.setattr(sys, "argv", ["vibe", *argv])+ with pytest.raises(SystemExit) as exc:+ cli.main()+ captured = capsys.readouterr()+ return exc.value.code, json.loads(captured.out or captured.err)++[email protected]("command", COMMANDS)+ ("scope_args", "expected_sessions", "expected_scope"),+ (+ ([], {MINE}, {"session_id": MINE, "global": False}),+ (["--session-id", OTHER], {OTHER}, {"session_id": OTHER, "global": False}),+ (["--global"], {MINE, OTHER}, {"session_id": None, "global": True}),+ ),+ ids=("caller", "session-id", "global"),+)+def test_session_owned_lists_default_to_the_caller_session(+ two_sessions, monkeypatch, capsys, command, scope_args, expected_sessions, expected_scope+) -> None:+ argv, sessions_of = COMMANDS[command]+ monkeypatch.setenv("AVIBE_SESSION_ID", MINE)++ code, payload = _run_cli(monkeypatch, capsys, [*argv, *scope_args])++ assert code == 0+ assert sessions_of(payload) == expected_sessions+ assert {key: payload[key] for key in ("session_id", "global")} == expected_scope++[email protected]("command", COMMANDS)+def test_session_owned_lists_need_a_scope_outside_an_agent_shell(+ two_sessions, monkeypatch, capsys, command+) -> None:+ argv, _ = COMMANDS[command]++ code, payload = _run_cli(monkeypatch, capsys, argv)++ assert code == 1+ assert payload["code"] == "missing_caller_session"+ assert "--session-id <id>" in payload["hint"] and "--global" in payload["hint"]++[email protected]("command", COMMANDS)+def test_session_id_and_global_are_one_choice(monkeypatch, capsys, command) -> None:+ argv, _ = COMMANDS[command]++ code, payload = _run_cli(monkeypatch, capsys, [*argv, "--session-id", OTHER, "--global"])++ assert code == 2+ assert payload["code"] == "invalid_arguments"+++def test_a_session_lists_the_runs_it_dispatched(monkeypatch, tmp_path, capsys) -> None:+ """A delegated Run is the dispatching Session's work, with or without a callback."""++ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))+ paths.ensure_data_dirs()+ store = SQLiteBackgroundTaskStore()+ try:+ for run_id, fields in (+ ("run-here", {"session_id": MINE}),+ ("run-reporting-back", {"session_id": "ses-child", "callback_session_id": MINE}),+ (+ "run-dispatched-no-callback",+ {"session_id": "ses-child-2", "source_kind": "agent", "source_actor": MINE},+ ),+ ("run-elsewhere", {"session_id": OTHER, "source_kind": "agent", "source_actor": OTHER}),+ # A callback Run's actor is the Run it reports, never a Session.+ ("run-callback-actor", {"session_id": OTHER, "source_kind": "callback", "source_actor": MINE}),+ ):+ store.enqueue_run(+ {+ "id": run_id,+ "request_type": "agent_run",+ "status": "queued",+ "message": "continue",+ "created_at": CREATED_AT,+ "updated_at": CREATED_AT,+ **fields,+ }+ )+ finally:+ store.close()+ monkeypatch.setenv("AVIBE_SESSION_ID", MINE)++ code, payload = _run_cli(monkeypatch, capsys, ["runs", "list"])++ assert code == 0+ assert {run["id"] for run in payload["runs"]} == {+ "run-here",+ "run-reporting-back",+ "run-dispatched-no-callback",+ }+++ ("argv", "expected"),+ (+ (["watch", "list", "--limit", "1"], "vibe watch list --page 2 --limit 1"),+ (["watch", "list", "--session-id", OTHER, "--limit", "1"], f"vibe watch list --session-id {OTHER} --page 2 --limit 1"),+ (["runs", "list", "--global", "--limit", "1"], "vibe runs list --global --page 2 --limit 1"),+ ),+)+def test_next_page_repeats_the_scope_the_caller_chose(two_sessions, monkeypatch, capsys, argv, expected) -> None:+ """The next page reads the same Sessions, and an implicit caller scope stays implicit."""++ store = SQLiteBackgroundTaskStore()+ try:+ store.upsert_watch(+ {+ "id": "watch-other-2",+ "name": "second",+ "session_id": OTHER,+ "shell_command": "true",+ "enabled": True,+ "created_at": CREATED_AT,+ "updated_at": CREATED_AT,+ }+ )+ store.upsert_watch(+ {+ "id": "watch-mine-2",+ "name": "second",+ "session_id": MINE,+ "shell_command": "true",+ "enabled": True,+ "created_at": CREATED_AT,+ "updated_at": CREATED_AT,+ }+ )+ finally:+ store.close()+ monkeypatch.setenv("AVIBE_SESSION_ID", MINE)++ code, payload = _run_cli(monkeypatch, capsys, argv)++ assert code == 0+ assert payload["pagination"]["next_command"] == expecteddiff --git a/tests/test_cli_task_command.py b/tests/test_cli_task_command.pyindex c6bbc0cad..aeb15c1ad 100644--- a/tests/test_cli_task_command.py+++ b/tests/test_cli_task_command.py@@ -1361,7 +1361,7 @@ def test_task_list_hides_completed_one_shots_by_default(tmp_path: Path, capsys)) == "failed"with patch("vibe.cli._task_store", return_value=store):- result = cli.cmd_task_list()+ result = cli.cmd_task_list(scope=cli.SessionListScope())assert result == 0payload = json.loads(capsys.readouterr().out)@@ -1383,7 +1383,7 @@ def test_task_list_brief_returns_scheduling_focused_view(tmp_path: Path, capsys))with patch("vibe.cli._task_store", return_value=store):- result = cli.cmd_task_list(brief=True)+ result = cli.cmd_task_list(scope=cli.SessionListScope(), brief=True)assert result == 0payload = json.loads(capsys.readouterr().out)@@ -1412,7 +1412,7 @@ def test_paused_recurring_task_keeps_failed_run_in_last_status(store.set_enabled(task.id, False)with patch("vibe.cli._task_store", return_value=store):- assert cli.cmd_task_list(brief=True) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), brief=True) == 0payload = json.loads(capsys.readouterr().out)assert payload["definitions"][0]["state"] == "paused"@@ -1432,7 +1432,7 @@ def test_task_list_defaults_to_first_page(tmp_path: Path, capsys) -> None:)with patch("vibe.cli._task_store", return_value=store):- result = cli.cmd_task_list(brief=True)+ result = cli.cmd_task_list(scope=cli.SessionListScope(), brief=True)assert result == 0payload = json.loads(capsys.readouterr().out)@@ -1444,9 +1444,9 @@ def test_task_list_defaults_to_first_page(tmp_path: Path, capsys) -> None:"returned": 20,"has_more": True,"next_page": 2,- "next_command": "vibe task list --page 2 --limit 20",+ "next_command": "vibe task list --global --page 2 --limit 20",}- assert payload["message"].endswith("vibe task list --page 2 --limit 20")+ assert payload["message"].endswith("vibe task list --global --page 2 --limit 20")def test_task_list_keeps_enabled_tasks_ahead_of_paused_history(@@ -1474,7 +1474,7 @@ def test_task_list_keeps_enabled_tasks_ahead_of_paused_history()with patch("vibe.cli._task_store", return_value=store):- assert cli.cmd_task_list(brief=True) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), brief=True) == 0payload = json.loads(capsys.readouterr().out)assert payload["definitions"][0]["id"] == active.id@@ -1498,14 +1498,14 @@ def test_task_list_cli_dispatches_pagination_flags(timezone_name="UTC",)- monkeypatch.setattr(sys, "argv", ["vibe", "task", "list", "--limit", "2"])+ monkeypatch.setattr(sys, "argv", ["vibe", "task", "list", "--global", "--limit", "2"])with patch("vibe.cli._task_store", return_value=store), pytest.raises(SystemExit) as exc:cli.main()assert exc.value.code == 0payload = json.loads(capsys.readouterr().out)assert len(payload["definitions"]) == 2- assert payload["pagination"]["next_command"] == "vibe task list --page 2 --limit 2"+ assert payload["pagination"]["next_command"] == "vibe task list --global --page 2 --limit 2"def test_task_list_order_is_stable_across_cron_boundaries(@@ -1542,7 +1542,7 @@ def test_task_list_order_is_stable_across_cron_boundaries()with patch("vibe.cli._task_store", return_value=store):- assert cli.cmd_task_list(brief=True) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), brief=True) == 0first_ids = [item["id"] for item in json.loads(capsys.readouterr().out)["definitions"]]@@ -1555,7 +1555,7 @@ def test_task_list_order_is_stable_across_cron_boundaries(lambda **kwargs: second_next_runs[str(kwargs["timezone_name"])],)with patch("vibe.cli._task_store", return_value=store):- assert cli.cmd_task_list(brief=True) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), brief=True) == 0second_ids = [item["id"] for item in json.loads(capsys.readouterr().out)["definitions"]]assert second_ids == first_ids == [later.id, earlier.id]@@ -1596,7 +1596,7 @@ def test_task_list_include_finished_includes_completed_one_shots(tmp_path: Path,store.mark_task_result(done.id, error=None)with patch("vibe.cli._task_store", return_value=store):- result = cli.cmd_task_list(include_finished=True)+ result = cli.cmd_task_list(scope=cli.SessionListScope(), include_finished=True)assert result == 0payload = json.loads(capsys.readouterr().out)@@ -1619,6 +1619,7 @@ def test_task_list_include_finished_keeps_history_paginated(tmp_path: Path, capswith patch("vibe.cli._task_store", return_value=store):result = cli.cmd_task_list(+ scope=cli.SessionListScope(),include_finished=True,brief=True,page_request=cli.PageRequest(page=1, limit=2),@@ -1629,7 +1630,7 @@ def test_task_list_include_finished_keeps_history_paginated(tmp_path: Path, capsassert len(payload["definitions"]) == 2assert payload["pagination"]["has_more"] is Trueassert payload["pagination"]["next_command"] == (- "vibe task list --include-finished --page 2 --limit 2"+ "vibe task list --global --include-finished --page 2 --limit 2")diff --git a/tests/test_cli_watch_command.py b/tests/test_cli_watch_command.pyindex 9641a4402..0846d0267 100644--- a/tests/test_cli_watch_command.py+++ b/tests/test_cli_watch_command.py@@ -1100,7 +1100,7 @@ def test_watch_list_brief_includes_runtime_state(tmp_path: Path, capsys) -> Nonepatch("vibe.cli._watch_store", return_value=store),patch("vibe.cli._watch_runtime_store", return_value=runtime_store),):- result = cli.cmd_watch_list(brief=True)+ result = cli.cmd_watch_list(scope=cli.SessionListScope(), brief=True)assert result == 0payload = json.loads(capsys.readouterr().out)@@ -1125,7 +1125,7 @@ def test_watch_list_hides_finished_one_shots_by_default(tmp_path: Path, capsys)patch("vibe.cli._watch_store", return_value=store),patch("vibe.cli._watch_runtime_store", return_value=runtime_store),):- result = cli.cmd_watch_list(brief=True)+ result = cli.cmd_watch_list(scope=cli.SessionListScope(), brief=True)assert result == 0payload = json.loads(capsys.readouterr().out)@@ -1148,7 +1148,7 @@ def test_resumed_then_paused_one_shot_remains_in_default_list(tmp_path: Path, capatch("vibe.cli._watch_store", return_value=store),patch("vibe.cli._watch_runtime_store", return_value=runtime_store),):- assert cli.cmd_watch_list() == 0+ assert cli.cmd_watch_list(scope=cli.SessionListScope()) == 0payload = json.loads(capsys.readouterr().out)assert [item["id"] for item in payload["definitions"]] == [watch.id]@@ -1187,7 +1187,7 @@ def test_paused_forever_watch_changed_to_once_starts_new_lifecycle(patch("vibe.cli._watch_store", return_value=store),patch("vibe.cli._watch_runtime_store", return_value=runtime_store),):- assert cli.cmd_watch_list() == 0+ assert cli.cmd_watch_list(scope=cli.SessionListScope()) == 0payload = json.loads(capsys.readouterr().out)assert [item["id"] for item in payload["definitions"]] == [watch.id]@@ -1204,7 +1204,7 @@ def test_watch_list_defaults_to_first_page(tmp_path: Path, capsys) -> None:patch("vibe.cli._watch_store", return_value=store),patch("vibe.cli._watch_runtime_store", return_value=runtime_store),):- result = cli.cmd_watch_list(brief=True)+ result = cli.cmd_watch_list(scope=cli.SessionListScope(), brief=True)assert result == 0payload = json.loads(capsys.readouterr().out)@@ -1216,7 +1216,7 @@ def test_watch_list_defaults_to_first_page(tmp_path: Path, capsys) -> None:"returned": 20,"has_more": True,"next_page": 2,- "next_command": "vibe watch list --page 2 --limit 20",+ "next_command": "vibe watch list --global --page 2 --limit 20",}@@ -1230,7 +1230,7 @@ def test_watch_list_cli_dispatches_pagination_flags(for index in range(3):_add_test_watch(store, name=f"Watch {index}")- monkeypatch.setattr(sys, "argv", ["vibe", "watch", "list", "--limit", "2"])+ monkeypatch.setattr(sys, "argv", ["vibe", "watch", "list", "--global", "--limit", "2"])with (patch("vibe.cli._watch_store", return_value=store),patch("vibe.cli._watch_runtime_store", return_value=runtime_store),@@ -1241,7 +1241,7 @@ def test_watch_list_cli_dispatches_pagination_flags(assert exc.value.code == 0payload = json.loads(capsys.readouterr().out)assert len(payload["definitions"]) == 2- assert payload["pagination"]["next_command"] == "vibe watch list --page 2 --limit 2"+ assert payload["pagination"]["next_command"] == "vibe watch list --global --page 2 --limit 2"def test_watch_list_include_finished_keeps_history_paginated(tmp_path: Path, capsys) -> None:@@ -1256,6 +1256,7 @@ def test_watch_list_include_finished_keeps_history_paginated(tmp_path: Path, cappatch("vibe.cli._watch_runtime_store", return_value=runtime_store),):result = cli.cmd_watch_list(+ scope=cli.SessionListScope(),include_finished=True,brief=True,page_request=cli.PageRequest(page=1, limit=2),@@ -1266,7 +1267,7 @@ def test_watch_list_include_finished_keeps_history_paginated(tmp_path: Path, capassert len(payload["definitions"]) == 2assert payload["pagination"]["has_more"] is Trueassert payload["pagination"]["next_command"] == (- "vibe watch list --include-finished --page 2 --limit 2"+ "vibe watch list --global --include-finished --page 2 --limit 2")diff --git a/tests/test_harness_failure_visibility.py b/tests/test_harness_failure_visibility.pyindex 2ad28efe0..8e57800bd 100644--- a/tests/test_harness_failure_visibility.py+++ b/tests/test_harness_failure_visibility.py@@ -9179,7 +9179,7 @@ def test_definition_health_reaches_the_cli_list_after_a_success(capsys) -> None:})- assert cli.cmd_task_list(page_request=PageRequest(limit=20)) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), page_request=PageRequest(limit=20)) == 0finally:store.close()@@ -9207,7 +9207,7 @@ def test_brief_task_payload_carries_last_error(capsys) -> None:store = SQLiteBackgroundTaskStore()try:_task(store, "task-broken", last_error="unresolvable session binding", last_run_at=_EPOCH)- assert cli.cmd_task_list(page_request=PageRequest(limit=20)) == 0+ assert cli.cmd_task_list(scope=cli.SessionListScope(), page_request=PageRequest(limit=20)) == 0finally:store.close()@@ -9252,7 +9252,7 @@ def test_a_watch_reports_processing_health_separately_from_waiter_health(capsys)"completed_at": _instant(1.98),})- assert cli.cmd_watch_list(page_request=PageRequest(limit=20)) == 0+ assert cli.cmd_watch_list(scope=cli.SessionListScope(), page_request=PageRequest(limit=20)) == 0finally:store.close()diff --git a/tests/test_harness_live_status.py b/tests/test_harness_live_status.pyindex 46c736135..00c10d8ca 100644--- a/tests/test_harness_live_status.py+++ b/tests/test_harness_live_status.py@@ -210,6 +210,42 @@ def test_hfr_481_unified_view_marks_workdir_conflict_and_watch_failure() -> None)+ ("session_id", "runtime_sessions", "conflicts"),+ (+ ("ses-a", ["ses-a"], [["ses-a", "ses-b"]]),+ ("ses-c", ["ses-c"], []),+ ),+)+def test_session_view_keeps_its_runtime_and_the_conflicts_it_is_part_of(+ session_id, runtime_sessions, conflicts+) -> None:+ """A conflict is between Sessions: it is found across the runtime, then shown to its members."""++ snapshot = build_harness_status(+ runs=[],+ watches=[],+ tasks=[],+ runtime_snapshot={+ "available": True,+ "ownership_available": True,+ "owned_run_ids": [],+ "agents": [+ {"backend": "codex", "state": "active", "session_id": "ses-a", "workdir": "/repo/project"},+ {"backend": "claude", "state": "active", "session_id": "ses-b", "workdir": "/repo/project"},+ {"backend": "codex", "state": "active", "session_id": "ses-c", "workdir": "/repo/other"},+ ],+ },+ session_id=session_id,+ )++ assert [row["session_id"] for row in snapshot["runtime_agents"]] == runtime_sessions+ assert [+ row["session_ids"] for row in snapshot["anomalies"] if row["code"] == "active_workdir_conflict"+ ] == conflicts+ assert snapshot["counts"]["runtime_agents"] == 1++def test_same_backend_shared_process_is_not_a_workdir_conflict() -> None:snapshot = build_harness_status(runs=[],@@ -301,9 +337,9 @@ def test_activity_age_accepts_utc_z_timestamps() -> None:def test_harness_status_cli_returns_one_unified_payload(monkeypatch, capsys) -> None:sqlite_store = SimpleNamespace(- list_active_runs=lambda *, limit: [],+ list_active_runs=lambda *, limit, session_id: [],active_run_ids=lambda run_ids: set(run_ids),- list_enabled_definitions=lambda definition_type, *, limit: [],+ list_enabled_definitions=lambda definition_type, *, limit, session_id: [],)monkeypatch.setattr(cli,@@ -325,7 +361,7 @@ def test_harness_status_cli_returns_one_unified_payload(monkeypatch, capsys) ->}monkeypatch.setattr(internal_client, "list_running_agents", _controller_snapshot)- args = cli.build_parser().parse_args(["harness", "status"])+ args = cli.build_parser().parse_args(["harness", "status", "--global"])assert cli.cmd_harness_status(args) == 0payload = json.loads(capsys.readouterr().out)@@ -343,9 +379,9 @@ def test_harness_status_cli_revalidates_runs_after_ownership_snapshot() -> None:run = {"id": "run-finished", "status": "running"}sqlite_store = SimpleNamespace(- list_active_runs=lambda *, limit: [run],+ list_active_runs=lambda *, limit, session_id: [run],active_run_ids=lambda run_ids: set(),- list_enabled_definitions=lambda definition_type, *, limit: [],+ list_enabled_definitions=lambda definition_type, *, limit, session_id: [],)monkeypatch.setattr(cli,@@ -367,7 +403,7 @@ def test_harness_status_cli_revalidates_runs_after_ownership_snapshot(monkeypatch.setattr(internal_client, "list_running_agents", _controller_snapshot)- assert cli.cmd_harness_status(SimpleNamespace()) == 0+ assert cli.cmd_harness_status(SimpleNamespace(global_scope=True)) == 0payload = json.loads(capsys.readouterr().out)assert payload["runs"] == []assert payload["anomalies"] == []@@ -378,9 +414,9 @@ def test_harness_status_cli_preserves_pre_snapshot_run_truncation() -> None:runs = [{"id": f"run-{index}", "status": "running"} for index in range(101)]sqlite_store = SimpleNamespace(- list_active_runs=lambda *, limit: runs,+ list_active_runs=lambda *, limit, session_id: runs,active_run_ids=lambda run_ids: {"run-0"},- list_enabled_definitions=lambda definition_type, *, limit: [],+ list_enabled_definitions=lambda definition_type, *, limit, session_id: [],)monkeypatch.setattr(cli,@@ -401,7 +437,7 @@ def test_harness_status_cli_preserves_pre_snapshot_run_truncation(monkeypatch.setattr(internal_client, "list_running_agents", _controller_snapshot)- assert cli.cmd_harness_status(SimpleNamespace()) == 0+ assert cli.cmd_harness_status(SimpleNamespace(global_scope=True)) == 0payload = json.loads(capsys.readouterr().out)assert [row["id"] for row in payload["runs"]] == ["run-0"]assert payload["truncated"]["runs"] is True@@ -453,7 +489,7 @@ def test_harness_status_prioritizes_running_run_before_bounded_probe(monkeypatch.setattr(internal_client, "list_running_agents", _controller_snapshot)- assert cli.cmd_harness_status(SimpleNamespace()) == 0+ assert cli.cmd_harness_status(SimpleNamespace(global_scope=True)) == 0payload = json.loads(capsys.readouterr().out)assert probed_run_ids[:3] == [diff --git a/tests/test_show_pages.py b/tests/test_show_pages.pyindex c200e9929..50949867f 100644--- a/tests/test_show_pages.py+++ b/tests/test_show_pages.py@@ -1553,18 +1553,22 @@ def test_store_lists_show_pages_with_page_and_query(monkeypatch, tmp_path):first_page = store.list_page(page_request=PageRequest(page=1, limit=20))second_page = store.list_page(page_request=PageRequest(page=2, limit=20))- filtered = store.list_page(session_id="ses-2", query="ses-24", page_request=PageRequest(page=1, limit=20))+ exact = store.list_page(session_id="ses-24", page_request=PageRequest(page=1, limit=20))+ not_a_prefix = store.list_page(session_id="ses-2", page_request=PageRequest(page=1, limit=20))+ queried = store.list_page(query="ses-2", page_request=PageRequest(page=1, limit=20))assert first_page.has_more is Trueassert len(first_page.items) == 20assert second_page.has_more is Falseassert len(second_page.items) == 5- assert [page.session_id for page in filtered.items] == ["ses-24"]+ assert [page.session_id for page in exact.items] == ["ses-24"]+ assert not_a_prefix.items == []+ assert sorted(page.session_id for page in queried.items) == [f"ses-{index}" for index in range(20, 25)]finally:store.close()-def test_store_escapes_show_page_session_id_prefix_filter(monkeypatch, tmp_path):+def test_store_escapes_show_page_query_filter(monkeypatch, tmp_path):monkeypatch.setenv("AVIBE_HOME", str(tmp_path))paths.ensure_data_dirs()_save_config()@@ -1575,10 +1579,8 @@ def test_store_escapes_show_page_session_id_prefix_filter(monkeypatch, tmp_path)store.ensure("fooxbar")store.ensure("fooybar")- underscore_pages = store.list_page(session_id="foo_", page_request=PageRequest(page=1, limit=20))query_pages = store.list_page(query="foo_", page_request=PageRequest(page=1, limit=20))- assert [page.session_id for page in underscore_pages.items] == ["foo_bar"]assert [page.session_id for page in query_pages.items] == ["foo_bar"]finally:store.close()@@ -2820,7 +2822,7 @@ def test_show_list_cli_json_reports_existing_pages(monkeypatch, tmp_path, capsysfinally:store.close()- args = cli.build_parser().parse_args(["show", "list", "--json"])+ args = cli.build_parser().parse_args(["show", "list", "--global", "--json"])assert cli.cmd_show_list(args) == 0payload = json.loads(capsys.readouterr().out)@@ -2845,14 +2847,14 @@ def test_show_list_cli_json_reports_pagination(monkeypatch, tmp_path, capsys):finally:store.close()- args = cli.build_parser().parse_args(["show", "list", "--json"])+ args = cli.build_parser().parse_args(["show", "list", "--global", "--json"])assert cli.cmd_show_list(args) == 0payload = json.loads(capsys.readouterr().out)assert payload["count"] == 20assert payload["pagination"]["has_more"] is Trueassert payload["pagination"]["next_page"] == 2- assert "vibe show list --json --page 2 --limit 20" == payload["pagination"]["next_command"]+ assert "vibe show list --global --json --page 2 --limit 20" == payload["pagination"]["next_command"]assert "More records are available" in payload["message"]@@ -2869,7 +2871,7 @@ def test_show_list_cli_next_command_uses_absolute_time_filters(monkeypatch, tmp_store.close()args = cli.build_parser().parse_args(- ["show", "list", "--json", "--updated-after", "2026-05-25T08:00:00+08:00", "--limit", "10"]+ ["show", "list", "--global", "--json", "--updated-after", "2026-05-25T08:00:00+08:00", "--limit", "10"])assert cli.cmd_show_list(args) == 0@@ -2899,17 +2901,18 @@ def test_show_list_cli_filters_visibility(monkeypatch, tmp_path, capsys):finally:store.close()- args = cli.build_parser().parse_args(["show", "list", "--visibility", "private"])+ args = cli.build_parser().parse_args(["show", "list", "--global", "--visibility", "private"])assert cli.cmd_show_list(args) == 0output = capsys.readouterr().out+ assert "Sessions: all" in outputassert "Count: 1" in outputassert "Filter: visibility=private" in outputassert "- ses-private" in outputassert "- ses-limited" not in outputassert "- ses-public" not in output- args = cli.build_parser().parse_args(["show", "list", "--visibility", "limited"])+ args = cli.build_parser().parse_args(["show", "list", "--global", "--visibility", "limited"])assert cli.cmd_show_list(args) == 0output = capsys.readouterr().outdiff --git a/vibe/cli.py b/vibe/cli.pyindex 07ea7c6e3..7157425e7 100644--- a/vibe/cli.py+++ b/vibe/cli.py@@ -1073,10 +1073,12 @@ def _print_definition_list_payload(*,payload_for_item,command: list[str],+ scope: "SessionListScope",) -> None:item_payloads = [payload_for_item(item) for item in page_result.items]_print_cli_payload("run_definitions",+ **scope.payload(),definitions=item_payloads,**_paginated_fields(page_result, command=command),)@@ -1955,7 +1957,7 @@ def _show_examples_text() -> str:Examples:vibe show list- vibe show list --visibility public+ vibe show list --global --visibility publicvibe show path --session-id sesk8m4q2p7xvibe show status --session-id sesk8m4q2p7x --jsonvibe show update --session-id sesk8m4q2p7x --visibility public@@ -3519,25 +3521,70 @@ def _validate_callback_session_id(session_id: str, *, help_command: str) -> None_require_cli_turn_authority(session_id, help_command=help_command)-def _resolve_runs_list_session_filter(args) -> Optional[str]:- explicit_session_id = (getattr(args, "session_id", None) or "").strip()- current_session = bool(getattr(args, "current_session", False))- if explicit_session_id and current_session:+@dataclass(frozen=True)+class SessionListScope:+ """The Sessions a Session-owned list reads: one Session, or every Session.++ ``session_id=None`` is the explicit ``--global`` inventory. ``from_caller``+ records that the Session came from ``AVIBE_SESSION_ID`` rather than a flag, so+ a ``next_command`` repeats exactly the scope flags the caller typed.+ """++ session_id: Optional[str] = None+ from_caller: bool = False++ def command_args(self) -> list[str]:+ if self.session_id is None:+ return ["--global"]+ return [] if self.from_caller else ["--session-id", self.session_id]++ def payload(self) -> dict[str, Any]:+ return {"session_id": self.session_id, "global": self.session_id is None}+++def _add_session_scope_args(parser, *, items: str) -> None:+ """One grammar for every list of Session-owned records.++ The caller Session is the default; ``--session-id`` names another Session and+ ``--global`` reads every Session.+ """++ scope_group = parser.add_mutually_exclusive_group()+ scope_group.add_argument(+ "--session-id",+ help=f"List {items} of this Agent Session instead of the caller Session",+ )+ scope_group.add_argument(+ "--global",+ dest="global_scope",+ action="store_true",+ help=f"List {items} of every Session",+ )+++def _resolve_session_list_scope(args, *, help_command: str) -> SessionListScope:+ if getattr(args, "global_scope", False):+ return SessionListScope()+ explicit = getattr(args, "session_id", None)+ if explicit is not None:+ session_id = str(explicit).strip()+ if not session_id:+ raise TaskCliError(+ "--session-id must name an Agent Session",+ code="invalid_session_id",+ hint="Pass an Agent Session ID, or --global to list every Session.",+ help_command=help_command,+ )+ return SessionListScope(session_id=session_id)+ session_id = _default_session_id_from_caller(caller_context_from_env())+ if not session_id:raise TaskCliError(- "use either --session-id or --current-session, not both",- code="conflicting_session_filter",- hint="Use --current-session to resolve AVIBE_SESSION_ID, or pass a specific --session-id.",- help_command="vibe runs list --help",- )- if explicit_session_id:- return explicit_session_id- if current_session:- return _require_caller_session_id(- caller_context_from_env(),- purpose="--current-session",- help_command="vibe runs list --help",+ "This list defaults to the caller Session, and no Avibe Agent caller Session is set.",+ code="missing_caller_session",+ hint="Run it from an Avibe Agent shell, pass --session-id <id> for one Session, or --global for every Session.",+ help_command=help_command,)- return None+ return SessionListScope(session_id=session_id, from_caller=True)def _validate_delivery_args(@@ -4105,27 +4152,30 @@ def _run_payload(run: dict, *, brief: bool = False) -> dict:return normalized-def cmd_harness_status(_args) -> int:+def cmd_harness_status(args) -> int:"""Print one bounded operational snapshot across Harness work types."""from core.services.harness_status import build_harness_statusfrom vibe import internal_clienttry:+ scope = _resolve_session_list_scope(args, help_command="vibe harness status --help")language = _configured_cli_language()request_store = _task_request_store()sqlite_store = request_store.sqlite_backendif sqlite_store is None:raise RuntimeError(i18n_t("harness.cli.error.sqliteRequired", language))fetch_limit = MAX_PAGE_LIMIT + 1- raw_runs = sqlite_store.list_active_runs(limit=fetch_limit)+ raw_runs = sqlite_store.list_active_runs(limit=fetch_limit, session_id=scope.session_id)raw_watches = sqlite_store.list_enabled_definitions("watch",limit=fetch_limit,+ session_id=scope.session_id,)raw_tasks = sqlite_store.list_enabled_definitions("scheduled",limit=fetch_limit,+ session_id=scope.session_id,)runs_truncated = len(raw_runs) > MAX_PAGE_LIMIT@@ -4173,13 +4223,14 @@ def cmd_harness_status(_args) -> int:watches=raw_watches[:MAX_PAGE_LIMIT],tasks=raw_tasks[:MAX_PAGE_LIMIT],runtime_snapshot=runtime_snapshot,+ session_id=scope.session_id,truncated={"runs": runs_truncated,"watches": len(raw_watches) > MAX_PAGE_LIMIT,"tasks": len(raw_tasks) > MAX_PAGE_LIMIT,},)- _print_cli_payload("harness_status", **snapshot)+ _print_cli_payload("harness_status", **scope.payload(), **snapshot)return 0except Exception as exc:_print_task_error(exc, help_command="vibe harness status --help")@@ -4693,23 +4744,26 @@ def cmd_task_add(args):def cmd_task_list(*,+ scope: SessionListScope,include_finished: bool = False,brief: bool = True,page_request: PageRequest = PageRequest(),):with _definition_read_store() as store:page_result = store.list_scheduled_tasks_page(+ session_id=scope.session_id,page_request=page_request,include_successful_finished=include_finished,enabled_first=True,)- command = ["vibe", "task", "list"]+ command = ["vibe", "task", "list", *scope.command_args()]if include_finished:command.append("--include-finished")_print_definition_list_payload(page_result,payload_for_item=lambda task: _task_projection_payload(task, brief=brief),command=command,+ scope=scope,)return 0@@ -7404,6 +7458,7 @@ def _wait_for_run_result(store: TaskExecutionStore, run_id: str, *, wait_timeoutdef cmd_runs_list(args):try:+ scope = _resolve_session_list_scope(args, help_command="vibe runs list --help")page_request = _page_request_from_args(args, help_command="vibe runs list --help")created_after = _parse_cli_time_filter(getattr(args, "created_after", None),@@ -7420,7 +7475,7 @@ def cmd_runs_list(args):run_type=getattr(args, "type", None),agent_name=getattr(args, "agent", None),agent_backend=getattr(args, "backend", None),- session_id=_resolve_runs_list_session_filter(args),+ session_id=scope.session_id,definition_id=getattr(args, "definition_id", None),created_after=created_after,created_before=created_before,@@ -7428,14 +7483,11 @@ def cmd_runs_list(args):page_request=page_request,newest_first=True,)- command = ["vibe", "runs", "list"]+ command = ["vibe", "runs", "list", *scope.command_args()]_add_optional_arg(command, "--status", getattr(args, "status", None))_add_optional_arg(command, "--type", getattr(args, "type", None))_add_optional_arg(command, "--agent", getattr(args, "agent", None))_add_optional_arg(command, "--backend", getattr(args, "backend", None))- _add_optional_arg(command, "--session-id", getattr(args, "session_id", None))- if getattr(args, "current_session", False):- command.append("--current-session")_add_optional_arg(command, "--definition-id", getattr(args, "definition_id", None))_add_optional_arg(command, "--created-after", created_after)_add_optional_arg(command, "--created-before", created_before)@@ -7443,6 +7495,7 @@ def cmd_runs_list(args):if getattr(args, "brief", False):command.append("--brief")payload = {+ **scope.payload(),"runs": [_run_payload(run, brief=True) for run in result.items],**_paginated_fields(result, command=command),}@@ -11621,23 +11674,26 @@ def cmd_watch_add(args):def cmd_watch_list(*,+ scope: SessionListScope,include_finished: bool = False,brief: bool = True,page_request: PageRequest = PageRequest(),):with _definition_read_store() as store:page_result = store.list_watches_page(+ session_id=scope.session_id,page_request=page_request,include_successful_finished=include_finished,enabled_first=True,)- command = ["vibe", "watch", "list"]+ command = ["vibe", "watch", "list", *scope.command_args()]if include_finished:command.append("--include-finished")_print_definition_list_payload(page_result,payload_for_item=lambda watch: _watch_projection_payload(watch, brief=brief),command=command,+ scope=scope,)return 0@@ -15257,6 +15313,10 @@ def _print_show_page_status_missing(session_id: str) -> None:def _print_show_page_list(payload: dict) -> None:pages = payload.get("pages") or []print("Show Pages:")+ if payload.get("global"):+ print(" Sessions: all")+ elif payload.get("session_id"):+ print(f" Session: {payload['session_id']}")print(f" Count: {payload.get('count', 0)}")visibility = payload.get("visibility")if visibility:@@ -15313,6 +15373,7 @@ def cmd_show_list(args):store = _load_show_page_store()try:+ scope = _resolve_session_list_scope(args, help_command="vibe show list --help")page_request = _page_request_from_args(args, help_command="vibe show list --help")updated_after = _parse_cli_time_filter(getattr(args, "updated_after", None),@@ -15326,15 +15387,14 @@ def cmd_show_list(args):)result = store.list_page(visibility=getattr(args, "visibility", None),- session_id=getattr(args, "session_id", None),+ session_id=scope.session_id,updated_after=updated_after,updated_before=updated_before,query=getattr(args, "query", None),page_request=page_request,)- command = ["vibe", "show", "list"]+ command = ["vibe", "show", "list", *scope.command_args()]_add_optional_arg(command, "--visibility", getattr(args, "visibility", None))- _add_optional_arg(command, "--session-id", getattr(args, "session_id", None))_add_optional_arg(command, "--updated-after", updated_after)_add_optional_arg(command, "--updated-before", updated_before)_add_optional_arg(command, "--q", getattr(args, "query", None))@@ -15342,6 +15402,7 @@ def cmd_show_list(args):command.append("--json")payload = {"ok": True,+ **scope.payload(),"count": len(result.items),"visibility": getattr(args, "visibility", None),"pages": [show_page_payload(page) for page in result.items],@@ -18165,13 +18226,20 @@ def build_parser():)runs_subparsers = runs_parser.add_subparsers(dest="runs_command", metavar="{list,show,cancel}")runs_subparsers.required = True- runs_list_parser = runs_subparsers.add_parser("list", help="List Agent runs")+ runs_list_parser = runs_subparsers.add_parser(+ "list",+ help="List Agent runs",+ description=(+ "List Agent runs in the caller Session, newest first. Use --session-id for another "+ "Session or --global for every Session."+ ),+ error_help_command="vibe runs list --help",+ )+ _add_session_scope_args(runs_list_parser, items="runs")runs_list_parser.add_argument("--status", help="Filter by run status")runs_list_parser.add_argument("--type", help="Filter by run type")runs_list_parser.add_argument("--agent", help="Filter by Avibe Agent name")runs_list_parser.add_argument("--backend", choices=AGENT_BACKENDS, help="Filter by backend")- runs_list_parser.add_argument("--session-id", help="Filter by Agent Session ID")- runs_list_parser.add_argument("--current-session", action="store_true", help="Filter to this current Agent Session")runs_list_parser.add_argument("--definition-id", help="Filter by task or watch definition ID")runs_list_parser.add_argument("--created-after", help="Filter by created_at >= timestamp, or relative value such as 6h or 7d")runs_list_parser.add_argument("--created-before", help="Filter by created_at <= timestamp, or relative value such as 6h or 7d")@@ -18209,7 +18277,10 @@ def build_parser():harness_status_parser = harness_subparsers.add_parser("status",help=i18n_t("harness.cli.help.status", harness_help_language),+ description=i18n_t("harness.cli.help.statusDescription", harness_help_language),+ error_help_command="vibe harness status --help",)+ _add_session_scope_args(harness_status_parser, items="Harness work")_add_json_noop(harness_status_parser)session_parser = subparsers.add_parser(@@ -18686,7 +18757,10 @@ def build_parser():show_list_parser = show_subparsers.add_parser("list",help="List existing Show Pages",- description="List existing Show Pages across Agent Sessions without creating new pages.",+ description=(+ "List existing Show Pages without creating new pages: the caller Session's page by default, "+ "another Session's with --session-id, or every Session's with --global."+ ),formatter_class=argparse.RawDescriptionHelpFormatter,error_help_command="vibe show list --help",)@@ -18695,7 +18769,7 @@ def build_parser():choices=("private", "limited", "public", "offline"),help="Filter by Show Page visibility.",)- show_list_parser.add_argument("--session-id", help="Filter by Agent Session ID prefix.")+ _add_session_scope_args(show_list_parser, items="Show Pages")show_list_parser.add_argument("--updated-after", help="Filter by updated_at >= timestamp, or relative value such as 6h or 7d.")show_list_parser.add_argument("--updated-before", help="Filter by updated_at <= timestamp, or relative value such as 6h or 7d.")show_list_parser.add_argument("--q", dest="query", help="Search session ID, share ID, or visibility.")@@ -19094,7 +19168,8 @@ def build_parser():"list",help="List scheduled tasks",description=(- f"List stored scheduled tasks, {DEFAULT_PAGE_LIMIT} per page. Successful one-shot tasks are hidden by default; "+ f"List the caller Session's scheduled tasks, {DEFAULT_PAGE_LIMIT} per page. Use --session-id for another "+ "Session or --global for every Session. Successful one-shot tasks are hidden by default; ""use --include-finished to page through their history."),epilog="Use the returned task IDs with 'vibe task show', 'vibe task update', 'vibe task run', 'vibe task pause', 'vibe task resume', or 'vibe task remove'.",@@ -19102,6 +19177,7 @@ def build_parser():error_help_command="vibe task list --help",)task_list_parser = task_subparsers.choices["list"]+ _add_session_scope_args(task_list_parser, items="scheduled tasks")task_list_parser.add_argument("--include-finished",action="store_true",@@ -19396,13 +19472,15 @@ def build_parser():"list",help="List background watches",description=(- f"List stored managed background watches, {DEFAULT_PAGE_LIMIT} per page. Successful one-shot watches are hidden "+ f"List the caller Session's background watches, {DEFAULT_PAGE_LIMIT} per page. Use --session-id for another "+ "Session or --global for every Session. Successful one-shot watches are hidden ""by default; use --include-finished to page through their history."),epilog="Use the returned watch IDs with 'vibe watch show', 'vibe watch update', 'vibe watch pause', 'vibe watch resume', or 'vibe watch remove'.",formatter_class=argparse.RawDescriptionHelpFormatter,error_help_command="vibe watch list --help",)+ _add_session_scope_args(watch_list_parser, items="background watches")watch_list_parser.add_argument("--include-finished",action="store_true",@@ -20089,8 +20167,14 @@ def _dispatch_parsed_command(parser: argparse.ArgumentParser, args) -> None:except TaskCliError as exc:_print_task_error(exc, help_command="vibe task list --help")sys.exit(1)+ try:+ scope = _resolve_session_list_scope(args, help_command="vibe task list --help")+ except TaskCliError as exc:+ _print_task_error(exc, help_command="vibe task list --help")+ sys.exit(1)sys.exit(cmd_task_list(+ scope=scope,include_finished=getattr(args, "include_finished", False),brief=True,page_request=page_request,@@ -20122,8 +20206,14 @@ def _dispatch_parsed_command(parser: argparse.ArgumentParser, args) -> None:except TaskCliError as exc:_print_task_error(exc, help_command="vibe watch list --help")sys.exit(1)+ try:+ scope = _resolve_session_list_scope(args, help_command="vibe watch list --help")+ except TaskCliError as exc:+ _print_task_error(exc, help_command="vibe watch list --help")+ sys.exit(1)sys.exit(cmd_watch_list(+ scope=scope,include_finished=getattr(args, "include_finished", False),brief=True,page_request=page_request,diff --git a/vibe/i18n/en.json b/vibe/i18n/en.jsonindex 59f908e66..a99994181 100644--- a/vibe/i18n/en.json+++ b/vibe/i18n/en.json@@ -109,7 +109,8 @@"help": {"command": "Inspect unified Harness live state and anomalies","description": "Inspect active Runs, armed Watches, upcoming Tasks, and live anomalies.",- "status": "Show the bounded live/anomaly snapshot"+ "status": "Show the bounded live/anomaly snapshot",+ "statusDescription": "Show live Runs, armed Watches, upcoming Tasks, and anomalies for the caller Session. Use --session-id for another Session or --global for every Session."},"error": {"sqliteRequired": "Harness status requires the SQLite task store.",@@ -710,8 +711,8 @@"new": {"started": "Started a fresh session. Your next message will begin a new conversation.","pausedReason": "the bound agent session was cleared by /new",- "pausedTasks": "⏸️ Paused {count} scheduled task(s) pinned to the cleared session. Re-point with `vibe task list` → `vibe task update <id> --session-id <new>`, then `vibe task resume <id>`.",- "pausedWatches": "⏸️ Paused {count} watch(es) pinned to the cleared session. Re-point with `vibe watch list` → `vibe watch update <id> --session-id <new>`, then `vibe watch resume <id>`."+ "pausedTasks": "⏸️ Paused {count} scheduled task(s) pinned to the cleared session. Re-point with `vibe task list --global` → `vibe task update <id> --session-id <new>`, then `vibe task resume <id>`.",+ "pausedWatches": "⏸️ Paused {count} watch(es) pinned to the cleared session. Re-point with `vibe watch list --global` → `vibe watch update <id> --session-id <new>`, then `vibe watch resume <id>`."},"clear": {"noSessions": "No active sessions to clear.\nSession state has been reset.",diff --git a/vibe/i18n/zh.json b/vibe/i18n/zh.jsonindex 0ac6aac86..cee1b7aeb 100644--- a/vibe/i18n/zh.json+++ b/vibe/i18n/zh.json@@ -109,7 +109,8 @@"help": {"command": "检查统一的 Harness 实时状态和异常","description": "检查活跃 Run、已启用 Watch、即将触发的 Task 和实时异常。",- "status": "显示有界的实时状态与异常快照"+ "status": "显示有界的实时状态与异常快照",+ "statusDescription": "显示调用方 Session 的活跃 Run、已启用 Watch、即将触发的 Task 和实时异常。用 --session-id 查看其他 Session,用 --global 查看所有 Session。"},"error": {"sqliteRequired": "Harness 状态需要 SQLite Task 存储。",@@ -710,8 +711,8 @@"new": {"started": "已开启新的会话。你下一条消息会从全新对话开始。","pausedReason": "绑定的 Agent 会话已被 /new 清除",- "pausedTasks": "⏸️ 已暂停 {count} 个绑定到被清理会话的定时任务。用 `vibe task list` → `vibe task update <id> --session-id <new>` 重新指向,再 `vibe task resume <id>`。",- "pausedWatches": "⏸️ 已暂停 {count} 个绑定到被清理会话的 watch。用 `vibe watch list` → `vibe watch update <id> --session-id <new>` 重新指向,再 `vibe watch resume <id>`。"+ "pausedTasks": "⏸️ 已暂停 {count} 个绑定到被清理会话的定时任务。用 `vibe task list --global` → `vibe task update <id> --session-id <new>` 重新指向,再 `vibe task resume <id>`。",+ "pausedWatches": "⏸️ 已暂停 {count} 个绑定到被清理会话的 watch。用 `vibe watch list --global` → `vibe watch update <id> --session-id <new>` 重新指向,再 `vibe watch resume <id>`。"},"clear": {"noSessions": "没有要清除的活动会话。\n会话状态已重置。",