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
Default agent run to async
Call White538d9cf800cc
diff --git a/core/system_prompt_injection.py b/core/system_prompt_injection.pyindex fa1054abc..d2cb3b930 100644--- a/core/system_prompt_injection.py+++ b/core/system_prompt_injection.py@@ -181,7 +181,7 @@ Useful Harness queries include schema discovery, current session lookup, existin`vibe watch add` creates a managed monitor, usually backed by a small script or command, for any observable condition that must be watched until true: product signals, business events, files, logs, CI/reviews/deploys, service health, data freshness, and similar signals. Watches created from an Avibe Agent shell follow up in this conversation by default. If `--cwd` is omitted, Avibe runs the waiter from the caller working directory when available.-Use `vibe agent run --agent <agent-name> --message ...` when one Agent delegates work to another Agent. By default this creates a private/background Session for the target Agent and waits synchronously unless `--async` is passed. Avibe records caller provenance for both sync and async runs. From this Avibe Agent shell, async runs return their final result to this conversation by default; pass `--no-callback` only when you intentionally want to inspect the run later, and pass `--callback-session-id <id>` only to route the final result elsewhere. Add `--same-scope` when the new Session should live under the same Workbench project or IM scope as the caller. Add `--scope-id <scopes.id>` only when placing the new Session in a specific existing scope.+Use `vibe agent run --agent <agent-name> --message ...` when one Agent delegates work to another Agent. By default this creates a private/background Session for the target Agent, returns immediately, and from this Avibe Agent shell sends the final result back to this conversation. Avibe records caller provenance for both async and `--sync` runs. Pass `--sync` only when the current process must wait for the result. Pass `--no-callback` only when you intentionally want no automatic follow-up and will inspect the run later; pass `--callback-session-id <id>` only to route the final result elsewhere. Add `--same-scope` when the new Session should live under the same Workbench project or IM scope as the caller. Add `--scope-id <scopes.id>` only when placing the new Session in a specific existing scope.Use `vibe agent run --fork-self --message ...` when work should branch from this current Session's native backend context without mutating it. Use `--fork-session <source-session-id>` only when branching from a different explicit Session. Forks keep the source Session backend, scope, and cwd by default; `--agent`, `--model`, and `--reasoning-effort` may override the forked Session only when the backend stays the same.@@ -206,7 +206,7 @@ Rules:- For another Agent doing an independent trial, comparison, delegation, or specialist subtask, use `vibe agent run --agent <agent-name> --message ...`.- Use `vibe agent run --agent <agent-name> --session-id ... --message ...` only when the user intends to continue that same existing Session. Async callbacks return to this conversation by default.- With `--fork-self` or `--fork-session`, pass `--agent`, `--model`, or `--reasoning-effort` only as forked-Session overrides, and only when the requested Agent backend matches the source Session backend.-- `--async` changes waiting behavior, not session identity: synchronous waits for the result; async runs in the background and is inspected later with `vibe runs`.+- `--sync` changes waiting behavior, not session identity: default async runs in the background and return through callbacks; synchronous runs wait for the result and are still recorded in `vibe runs`.- Create or update Agents only when it captures a reusable role, reduces repeated prompting, or makes a long-running Harness more reliable.### Mentions in user messagesdiff --git a/docs/CLI.md b/docs/CLI.mdindex af2e5df28..38770a0af 100644--- a/docs/CLI.md+++ b/docs/CLI.md@@ -221,15 +221,16 @@ the Agent Session ID shown in the active Avibe prompt.### `vibe agent run`-Run an Agent directly. Use `--async` for a queued background run without storing-a scheduled task definition.+Run an Agent directly. Runs are async by default and do not store a scheduled+task definition. Use `--sync` only when the terminal should wait for completion.```bash-vibe agent run --agent release-reviewer --message 'Review the latest deployment result.'-vibe agent run --async --no-callback --session-id sesk8m4q2p7x --message 'The export finished. Share the summary.'-vibe agent run --async --no-callback --fork-session sesk8m4q2p7x --message 'Explore this alternate fix from the current context.'-vibe agent run --async --session-id sesworker123 --callback-session-id sescaller456 --message 'Run the delegated investigation.'-vibe agent run --async --no-callback --create-session --scope-id slack::channel::C999 --agent release-reviewer --message 'Post the deployment summary.'+vibe agent run --no-callback --agent release-reviewer --message 'Review the latest deployment result.'+vibe agent run --sync --agent release-reviewer --message 'Review the latest deployment result and print it here.'+vibe agent run --no-callback --session-id sesk8m4q2p7x --message 'The export finished. Share the summary.'+vibe agent run --no-callback --fork-session sesk8m4q2p7x --message 'Explore this alternate fix from the current context.'+vibe agent run --session-id sesworker123 --callback-session-id sescaller456 --message 'Run the delegated investigation.'+vibe agent run --no-callback --create-session --scope-id slack::channel::C999 --agent release-reviewer --message 'Post the deployment summary.'```Use `--fork-session <session-id>` when a new Agent Session should branch fromdiff --git a/docs/CLI_ZH.md b/docs/CLI_ZH.mdindex 7ded4defc..03b9871ab 100644--- a/docs/CLI_ZH.md+++ b/docs/CLI_ZH.md@@ -203,14 +203,16 @@ session creation 参数和 delivery 参数仍然优先。### `vibe agent run`-直接运行一个 Agent。加 `--async` 时会队列化一次后台 run,但不会创建持久化任务定义。+直接运行一个 Agent。Run 默认异步,并且不会创建持久化任务定义。只有终端需要等待完成时才使用+`--sync`。```bash-vibe agent run --agent release-reviewer --message 'Review the latest deployment result.'-vibe agent run --async --no-callback --session-id sesk8m4q2p7x --message 'The export finished. Share the summary.'-vibe agent run --async --no-callback --fork-session sesk8m4q2p7x --message 'Explore this alternate fix from the current context.'-vibe agent run --async --session-id sesworker123 --callback-session-id sescaller456 --message 'Run the delegated investigation.'-vibe agent run --async --no-callback --create-session --scope-id slack::channel::C999 --agent release-reviewer --message 'Post the deployment summary.'+vibe agent run --no-callback --agent release-reviewer --message 'Review the latest deployment result.'+vibe agent run --sync --agent release-reviewer --message 'Review the latest deployment result and print it here.'+vibe agent run --no-callback --session-id sesk8m4q2p7x --message 'The export finished. Share the summary.'+vibe agent run --no-callback --fork-session sesk8m4q2p7x --message 'Explore this alternate fix from the current context.'+vibe agent run --session-id sesworker123 --callback-session-id sescaller456 --message 'Run the delegated investigation.'+vibe agent run --no-callback --create-session --scope-id slack::channel::C999 --agent release-reviewer --message 'Post the deployment summary.'```当一个新 Agent Session 需要从现有 Session 的 native backend 上下文分叉,而不是空白开始时,diff --git a/docs/COMMANDS.md b/docs/COMMANDS.mdindex 733286d15..0ca1232de 100644--- a/docs/COMMANDS.md+++ b/docs/COMMANDS.md@@ -830,13 +830,18 @@ Important options:- `--scope-id`- `--model`- `--reasoning-effort`-- `--async`+- `--sync`- `--message`- `--message-file`If neither `--session-id` nor a creation policy is provided, the run uses aprivate no-delivery session and is best suited for sub-agent style calls.+Runs are asynchronous by default: the command queues the run, returns a payload+with `run_id` / `session_id`, and uses the callback policy to deliver the final+result later. Use `--sync` only when the terminal should wait for completion.+`--async` is still accepted for older scripts but is no longer required.+`--fork-session <session_id>` creates a new Agent Session by forking the sourceSession's native backend context. It is for alternate investigations ordelegated work that should keep the source context without mutating the source@@ -869,7 +874,7 @@ Use the right command family for the job:- Want to control the local daemon or troubleshoot installation:- use `vibe`, `vibe status`, `vibe doctor`, `vibe upgrade`- Want asynchronous automation:- - use `vibe task ...`, `vibe watch ...`, or `vibe agent run --async ...`+ - use `vibe task ...`, `vibe watch ...`, or `vibe agent run ...`## 7. Quick Examples@@ -892,5 +897,5 @@ vibevibe statusvibe doctorvibe task list --brief-vibe agent run --async --no-callback --session-id sesk8m4q2p7x --message 'Share the latest build summary.'+vibe 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 6dba2279f..a46ef966a 100644--- a/docs/COMMANDS_ZH.md+++ b/docs/COMMANDS_ZH.md@@ -806,13 +806,17 @@ vibe agent run (--session-id <session_id> | --create-session | --fork-session <s- `--scope-id`- `--model`- `--reasoning-effort`-- `--async`+- `--sync`- `--message`- `--message-file`如果不传 `--session-id` 或创建策略,run 会使用 privateno-delivery session,更适合 sub-agent 调用。+Run 默认异步:命令会队列化 run,立即返回包含 `run_id` / `session_id` 的+payload,并按 callback 策略稍后投递最终结果。只有终端需要等待完成时才使用+`--sync`。`--async` 仍兼容旧脚本,但不再需要显式传入。+`--fork-session <session_id>` 会基于源 Session 的 native backend 上下文创建一个新的Agent Session,适合在保留上下文的同时做分支调查或委派工作,而不修改源 Session。fork 会保持源 Session 的 backend;只有 backend 不变时,`--agent`、`--model`@@ -842,7 +846,7 @@ fork 会保持源 Session 的 backend;只有 backend 不变时,`--agent`、`- 想管理本地守护进程或排查安装问题:- 用 `vibe`、`vibe status`、`vibe doctor`、`vibe upgrade`- 想做异步自动化:- - 用 `vibe task ...`、`vibe watch ...` 或 `vibe agent run --async ...`+ - 用 `vibe task ...`、`vibe watch ...` 或 `vibe agent run ...`## 7. 快速示例@@ -865,5 +869,5 @@ vibevibe statusvibe doctorvibe task list --brief-vibe agent run --async --no-callback --session-id sesk8m4q2p7x --message 'Share the latest build summary.'+vibe agent run --no-callback --session-id sesk8m4q2p7x --message 'Share the latest build summary.'```diff --git a/docs/plans/agent-run-callback-session.md b/docs/plans/agent-run-callback-session.mdindex 091487c28..fd93d76d2 100644--- a/docs/plans/agent-run-callback-session.md+++ b/docs/plans/agent-run-callback-session.md@@ -4,10 +4,10 @@ Status: proposal.## Background-`vibe agent run --async` already lets one Agent queue work that continues in the-background. The missing piece is a first-class way for the completed run to-return its full result to the Session that initiated or is waiting for that-work.+`vibe agent run` lets one Agent queue async work that continues in the+background by default. The missing piece is a first-class way for the completed+run to return its full result to the Session that initiated or is waiting for+that work.This is especially important for Agent-to-Agent delegation:@@ -37,7 +37,6 @@ Add a callback option to direct Agent Runs:```bashvibe agent run \- --async \--session-id <target-session-id> \--callback-session-id <caller-session-id> \--message "Run this delegated task."@@ -91,7 +90,8 @@ Add to `vibe agent run`:Validation:-- v1 requires `--async` when `--callback-session-id` is passed.+- `vibe agent run` is async by default, so `--callback-session-id` works+ without an explicit async flag.- The callback session id must resolve to an active `agent_sessions` row.- Archived sessions are invalid.- Callback to the same Session is allowed but should be documented as a loop@@ -156,7 +156,7 @@ terminal and after `result_text` has been recorded.High-level flow:-1. `vibe agent run --async ... --callback-session-id ses_calling` enqueues an+1. `vibe agent run ... --callback-session-id ses_calling` enqueues an`agent_run` row with `callback_session_id=ses_calling` and`callback_status=pending`.2. The scheduler/request drain executes the target run as today.@@ -169,8 +169,8 @@ High-level flow:Important boundary:-- Do not implement callback in the CLI process. `--async` returns immediately,- and callback must survive CLI exit and service restart.+- Do not implement callback in the CLI process. Default-async runs return+ immediately, and callback must survive CLI exit and service restart.## Turn/Queue Semantics@@ -210,7 +210,7 @@ Retries:Focused test coverage:-- CLI parser accepts `--callback-session-id` only for async direct Agent Runs.+- CLI parser accepts `--callback-session-id` for default-async direct Agent Runs.- CLI payload and persisted row include `callback_session_id`.- unresolved/archived callback Session is rejected.- completed successful run dispatches full `result_text` into Caller Session.diff --git a/docs/plans/agent-run-harness.md b/docs/plans/agent-run-harness.mdindex 82a74b02e..48677faac 100644--- a/docs/plans/agent-run-harness.md+++ b/docs/plans/agent-run-harness.md@@ -47,16 +47,16 @@ The shared primitive is the run record, not the task.### `vibe agent run`-Synchronous Agent Run:+Asynchronous Agent Run (default):```bash-vibe agent run --agent release-reviewer --message "Review this diff."+vibe agent run --agent release-reviewer --no-callback --message "Review this diff."```-Asynchronous Agent Run:+Synchronous Agent Run:```bash-vibe agent run --agent release-reviewer --async --message-file request.md+vibe agent run --agent release-reviewer --sync --message-file request.md```Continue an existing session:@@ -90,14 +90,15 @@ Rules:Agent from the session or placement Scope defaults.- `--same-scope` places a new Session in the caller/source Scope.- `--scope-id <scope-id>` places a new Session in a specific existing Scope.-- `--async` returns after the run is queued.-- Without `--async`, the command waits for completion and prints the result.+- Runs return after they are queued by default.+- `--sync` waits for completion and prints the result.+- `--async` remains a compatibility alias for the default queued behavior.Execution controls:- The run uses the scope/session workdir when a scope/session is present;otherwise it uses the service default workdir.-- `--wait-timeout <seconds>` controls how long a synchronous command waits; it+- `--wait-timeout <seconds>` controls how long a `--sync` command waits; itdoes not terminate the run. There is no fixed default wait limit; if asynchronous run exceeds 30 minutes, the CLI returns an accepted response andthe run continues asynchronously. The 30-minute threshold is a system@@ -110,7 +111,7 @@ Execution controls:Compatibility window:```bash-vibe hook send ... -> vibe agent run --async ...+vibe hook send ... -> vibe agent run ...```Rules:@@ -230,7 +231,7 @@ Rules:### One-Off Agent Run vs One-Off Task-`vibe agent run --async` and `vibe task add --at ...` can both execute once, but+`vibe agent run` and `vibe task add --at ...` can both execute once, butthey answer different product needs:- Agent Run: execute now; no saved definition; managed through run history.@@ -349,8 +350,8 @@ Rules:| `--create-session-per-run` without scope placement | N/A | Reject | Reject | Every per-run Session needs a Scope. || `--create-session-per-run` + `task add --at` | N/A | Reject | N/A | One-shot tasks run once; use `--create-session`. || `--agent` + `--session-id` | Allow if backend matches | Allow if backend matches | Allow if backend matches | `--agent` only overrides this run/definition and does not mutate the Session; reject if Agent backend differs from Session backend. |+| default async + `--wait-timeout` | Reject | N/A | N/A | `--wait-timeout` only controls `--sync` CLI waiting and does not control async run lifetime. || `--agent` + `--scope-id` | Allow | Allow | Allow | `--agent` overrides the Scope default Agent; `--scope-id` controls placement. |-| `--async` + `--wait-timeout` | Reject | N/A | N/A | `--wait-timeout` only controls synchronous CLI waiting and does not control async run lifetime. |### Delivery Policies@@ -478,7 +479,7 @@ Definition table migration priority:`agent_runs` stores every actual execution:- immediate `vibe agent run`;-- async `vibe agent run --async`;+- async `vibe agent run`;- scheduled task fire;- watch terminal event/follow-up;- future webhook invocation.@@ -791,10 +792,10 @@ vibe runs cancel run123## Runtime And Recursion Policy-`vibe agent run --async` should always enqueue a `agent_runs` row and let-the Vibe runtime execute it.+`vibe agent run` should always enqueue a `agent_runs` row and let the Vibe+runtime execute it.-Synchronous `vibe agent run` should still create a run record first, then either:+Synchronous `vibe agent run --sync` should still create a run record first, then either:- execute through the local runtime service and wait for completion; or- claim/execute the run inline only if the runtime service is unavailable anddiff --git a/docs/plans/agent-run-harness.zh.md b/docs/plans/agent-run-harness.zh.mdindex 887622702..f8221f038 100644--- a/docs/plans/agent-run-harness.zh.md+++ b/docs/plans/agent-run-harness.zh.md@@ -46,16 +46,16 @@ Web UI 可以是清晰的三个 tab:### `vibe agent run`-同步 Agent Run:+异步 Agent Run(默认):```bash-vibe agent run --agent release-reviewer --message "Review this diff."+vibe agent run --agent release-reviewer --no-callback --message "Review this diff."```-异步 Agent Run:+同步 Agent Run:```bash-vibe agent run --agent release-reviewer --async --message-file request.md+vibe agent run --agent release-reviewer --sync --message-file request.md```继续已有 Session:@@ -88,14 +88,15 @@ vibe agent run \placement Scope 的默认配置解析 Agent。- `--same-scope` 把新 Session 放到 caller/source Scope。- `--scope-id <scope-id>` 把新 Session 放到指定已有 Scope。-- `--async` 表示排队后立即返回。-- 不带 `--async` 时,命令等待完成并打印结果。+- Run 默认排队后立即返回。+- `--sync` 表示等待完成并打印结果。+- `--async` 仍作为默认异步行为的兼容别名保留。执行控制:- 如果存在 scope/session,run 使用 scope/session workdir;否则使用服务默认workdir。-- `--wait-timeout <seconds>` 控制同步命令最多等待多久;它不终止 run。默认不设置+- `--wait-timeout <seconds>` 控制 `--sync` 命令最多等待多久;它不终止 run。默认不设置固定等待上限;如果同步 run 执行超过 30 分钟,CLI 应返回 accepted 结果并把run 转为 async 管理。30 分钟是系统保护阈值,不是用户可见的默认 timeout。- `--json` 是稳定的机器可读契约。非 JSON 输出面向人类,可以更简洁。@@ -105,7 +106,7 @@ vibe agent run \兼容窗口:```bash-vibe hook send ... -> vibe agent run --async ...+vibe hook send ... -> vibe agent run ...```规则:@@ -221,7 +222,7 @@ vibe watch remove <watch-id>### One-Off Agent Run 和 One-Off Task 的区别-`vibe agent run --async` 和 `vibe task add --at ...` 都可以只执行一次,但它们+`vibe agent run` 和 `vibe task add --at ...` 都可以只执行一次,但它们对应不同产品需求:- Agent Run:现在执行;不保存 definition;通过 run history 管理。@@ -338,8 +339,8 @@ lark::channel::oc_...| `--create-session-per-run` without scope placement | 不适用 | 拒绝 | 拒绝 | 每次创建新 Session 都需要 Scope。 || `--create-session-per-run` + `task add --at` | 不适用 | 拒绝 | 不适用 | one-shot task 只有一次执行,使用 `--create-session`。 || `--agent` + `--session-id` | backend 一致时允许 | backend 一致时允许 | backend 一致时允许 | `--agent` 只覆盖该次 run/definition,不修改 Session;若 Agent backend 和 Session backend 不同则拒绝。 |+| 默认 async + `--wait-timeout` | 拒绝 | 不适用 | 不适用 | `--wait-timeout` 只控制 `--sync` CLI 等待,不控制 async run 生命周期。 || `--agent` + `--scope-id` | 允许 | 允许 | 允许 | `--agent` 覆盖 Scope 默认 Agent;`--scope-id` 决定 placement。 |-| `--async` + `--wait-timeout` | 拒绝 | 不适用 | 不适用 | `--wait-timeout` 只控制同步 CLI 等待,不控制 async run 生命周期。 |### Delivery Policies@@ -455,7 +456,7 @@ Definition 表的迁移优先级:`agent_runs` 保存每一次实际执行:- 立即执行的 `vibe agent run`;-- 异步的 `vibe agent run --async`;+- 异步的 `vibe agent run`;- scheduled task 触发;- watch 进入终态后的 follow-up;- 未来 webhook invocation。@@ -756,10 +757,9 @@ vibe runs cancel run123## Runtime 和递归策略-`vibe agent run --async` 应始终先创建 `agent_runs` 记录,然后交给 Vibe-runtime 执行。+`vibe agent run` 应始终先创建 `agent_runs` 记录,然后交给 Vibe runtime 执行。-同步 `vibe agent run` 也应该先创建 run 记录,然后二选一:+同步 `vibe agent run --sync` 也应该先创建 run 记录,然后二选一:- 通过本地 runtime service 执行并等待完成;- 只有当 runtime service 不可用且 backend 路径适合在 CLI 进程里安全运行时,diff --git a/docs/plans/agent-run-scope-semantics.md b/docs/plans/agent-run-scope-semantics.mdindex abe0f7d26..b498a7c13 100644--- a/docs/plans/agent-run-scope-semantics.md+++ b/docs/plans/agent-run-scope-semantics.md@@ -36,11 +36,10 @@ Avibe treats it as:- create a new private/background session;- use the caller shell cwd as the new session cwd;- record callback route to the caller session when `AVIBE_SESSION_ID` exists;-- keep the run synchronous unless `--async` is explicitly passed.+- queue the run and return immediately by default.-The async-by-default proposal is intentionally left as a follow-up. It changes-the waiting contract of every existing caller and should land separately with a-focused migration.+Use `--sync` only when the CLI process must wait for the run result. The legacy+`--async` flag remains accepted for older scripts, but it is no longer required.## New Target And Scope Parameters@@ -75,8 +74,8 @@ All `vibe agent run` invocations resolve a callback route:- `--no-callback` records an intentional no-callback policy;- otherwise, `AVIBE_SESSION_ID` becomes the callback route when available.-For async runs, the callback route is used when the run completes. For sync-runs, the route is only recorded for future detach-to-async behavior.+For default async runs, the callback route is used when the run completes. For+sync runs, the route is recorded for future detach-to-async behavior.## Other CLI Defaultsdiff --git a/docs/plans/avibe-turn-lifecycle-fsm.md b/docs/plans/avibe-turn-lifecycle-fsm.mdindex abae2dd69..8d9262fd7 100644--- a/docs/plans/avibe-turn-lifecycle-fsm.md+++ b/docs/plans/avibe-turn-lifecycle-fsm.md@@ -112,7 +112,7 @@ write the dot, in_flight, queue, or lifecycle events. Differences that the FSM m### 1.6 Scheduled / watch / webhook / agent_run entry-`scheduled_tasks._execute_request:1556-1564`: `if platform=="avibe" and session_id and gate: await gate.submit_scheduled(...); return None` else `handle_scheduled_message` (IM, byte-identical). `_build_context` sets `channel_id=session_id`, `agent_session_id`, `turn_source="scheduled"`, `suppress_delivery`, `delivery_override`, `agent_session_target`. Triggers: cron/one-shot (`task_run`/`scheduled`), `hook_send`, watch-waiter (`watch`), `agent_run` (`vibe agent run --async`); `webhook` is defined-but-unwired.+`scheduled_tasks._execute_request:1556-1564`: `if platform=="avibe" and session_id and gate: await gate.submit_scheduled(...); return None` else `handle_scheduled_message` (IM, byte-identical). `_build_context` sets `channel_id=session_id`, `agent_session_id`, `turn_source="scheduled"`, `suppress_delivery`, `delivery_override`, `agent_session_target`. Triggers: cron/one-shot (`task_run`/`scheduled`), `hook_send`, watch-waiter (`watch`), `agent_run` (`vibe agent run` default async); `webhook` is defined-but-unwired.### 1.7 The frontend contract (MUST be preserved verbatim)diff --git a/docs/plans/harness-caller-context.md b/docs/plans/harness-caller-context.mdindex 3470a04fc..05546668a 100644--- a/docs/plans/harness-caller-context.md+++ b/docs/plans/harness-caller-context.md@@ -44,7 +44,7 @@ table.## CLI Semantics-`vibe agent run --async`:+`vibe agent run` (async by default):- explicit `--callback-session-id` wins;- explicit `--no-callback` means intentional no callback and prints trackingdiff --git a/docs/plans/rebrand-avibe.md b/docs/plans/rebrand-avibe.mdindex ae5783c42..f617067cb 100644--- a/docs/plans/rebrand-avibe.md+++ b/docs/plans/rebrand-avibe.md@@ -141,7 +141,7 @@ symlink `~/.vibe_remote → ~/.avibe`. Hardening so it never strands anyone:- C2 — adversarial review of §5a resolver/migration (state paths, first-run races, run-before-live, Windows, regression shared-state) and §5c sequencing.- C3 — mandated pre-merge Codex review (AGENTS.md §5).- **Invocation** (both verified):- - Native/dogfood: `vibe agent run --agent codex --message "<task>" [--async] [--session-id <id>]` (an enabled `codex` Vibe Agent already exists: backend codex, gpt-5.5, effort low; `--async` posts back).+ - Native/dogfood: `vibe agent run --agent codex --message "<task>" [--session-id <id>]` (an enabled `codex` Vibe Agent already exists: backend codex, gpt-5.5, effort low; runs are async by default and post back; add `--sync` only when the terminal must wait).- Direct CLI: `codex exec --json --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --cd <dir> "<prompt>"` (codex-cli 0.130.0). Synchronous JSON, full control of reasoning effort — preferred for tight-loop sub-tasks and meticulous audits (the existing agent runs effort "low").## 7. Testing / validationdiff --git a/skills/background-watch-hook/SKILL.md b/skills/background-watch-hook/SKILL.mdindex 07a3bc97f..7f8df6c6c 100644--- a/skills/background-watch-hook/SKILL.md+++ b/skills/background-watch-hook/SKILL.md@@ -2,7 +2,7 @@name: background-watch-hookslug: background-watch-hookdescription: Use `vibe watch` to run a managed Harness waiter that returns to the same conversation later. Best for reviews, CI, files, logs, and other wait-now-continue-later workflows.-version: 0.7.0+version: 0.8.0---# Background Watch Hook@@ -36,15 +36,13 @@ Prefer `vibe watch` when the wait should be inspectable, pausable, resumable, orUse `vibe watch add` first. Most tasks only need:-1. the target Agent Session ID-2. a short action-oriented message-3. a blocking waiter command+1. a short action-oriented message+2. a blocking waiter commandGeneric shape:```bashvibe watch add \- --session-id "<session-id>" \--message "<what the next Agent Run should do>" \--name "<optional label>" \-- \@@ -62,10 +60,11 @@ Use `--forever` when the same waiter should re-arm after each detected event ins## `vibe watch` Parameters To Remember-- `--session-id`: which Agent Session the follow-up should continue- `--message`: the instruction template for the follow-up Agent Run created from waiter output-- `--prefix`: legacy alias for older watch instructions; prefer `--message` in new watches- `--name`: optional label for later management+- `--session-id`: only when the follow-up should continue a different explicit Agent Session+- `--create-session --same-scope`: create a visible sibling Session for the follow-up instead of continuing this conversation+- `--create-session --scope-id <scopes.id>`: create the follow-up Session in a specific existing scope- `--forever`: re-arm after each detected event- `--timeout`: per-cycle timeout- `--lifetime-timeout`: whole-watch lifetime cap, mainly for forever watches@@ -98,8 +97,7 @@ Delay:```bashvibe watch add \- --session-id "sesk8m4q2p7x" \- --name "Delay callback" \+ --name "Delay follow-up" \--message "The delayed check completed. Continue from the result below." \-- \bash -lc 'sleep 120; echo "Timer finished after 120 seconds."'@@ -109,7 +107,6 @@ File appears:```bashvibe watch add \- --session-id "sesk8m4q2p7x" \--name "Wait for export file" \--message "The export file is ready. Inspect it and continue." \-- \@@ -120,7 +117,6 @@ Log match:```bashvibe watch add \- --session-id "sesk8m4q2p7x" \--name "Watch app log" \--message "The expected log pattern appeared. Inspect the event and continue." \--forever \@@ -132,10 +128,13 @@ vibe watch add \Use the current Avibe context:-- `--session-id` controls which Agent Session Avibe will continue using-- use the current Agent Session ID when the follow-up should continue the same session-- if no usable Agent Session ID is available, confirm the target session first instead of guessing-- `--post-to channel` only when the follow-up should keep the same Agent Session but publish in the parent channel+- Inside an Avibe-injected Agent shell, omitting the target continues this conversation.+- Use `--session-id <id>` only when the follow-up should continue a different existing Agent Session.+- Use `--create-session --same-scope` when follow-ups should run in one visible sibling Session under the same Workbench project or IM scope.+- For `--forever` watches that need a separate visible Session for each event, use `--create-session-per-run --same-scope`.+- Use `--create-session --scope-id <scopes.id>` when follow-ups should run in one Session under a specific existing scope.+- For separate visible Sessions in a specific existing scope, use `--create-session-per-run --scope-id <scopes.id>`.+- If `--cwd` is omitted while creating a Session, Avibe uses the command's current working directory.## Timeout And Lifecycle@@ -173,7 +172,6 @@ One-shot watch:```bashvibe watch add \- --session-id "sesk8m4q2p7x" \--name "Watch PR 151 reviews" \--message "PR #151 has new review activity. Fetch the latest review state, summarize actionable items, and continue handling them if needed." \-- \@@ -187,7 +185,6 @@ Catch up on existing activity first:```bashvibe watch add \- --session-id "sesk8m4q2p7x" \--name "Catch up PR 151 reviews" \--message "PR #151 already has review activity. Fetch the latest review state and continue handling it if needed." \-- \@@ -201,7 +198,6 @@ Stay armed for future activity:```bashvibe watch add \- --session-id "sesk8m4q2p7x" \--name "Monitor PR 151 reviews" \--forever \--timeout 21600 \@@ -227,7 +223,6 @@ New PRs in a repository:```bashvibe watch add \- --session-id "sesk8m4q2p7x" \--name "Watch new PRs" \--message "The repository has new pull requests. Review the new PRs and continue as needed." \-- \@@ -248,7 +243,6 @@ GitHub Actions for a pushed commit:```bashvibe watch add \- --session-id "sesk8m4q2p7x" \--name "Watch CI" \--message "GitHub Actions finished. Inspect the result below and continue with the deployment or fix failures." \-- \diff --git a/skills/use-avibe/SKILL.md b/skills/use-avibe/SKILL.mdindex 472096588..cba38de0a 100644--- a/skills/use-avibe/SKILL.md+++ b/skills/use-avibe/SKILL.md@@ -2,7 +2,7 @@name: use-avibeslug: use-avibedescription: Safely inspect and modify local Avibe configuration, routing, runtime settings, watches, scheduled tasks, Avibe Cloud remote access, and operational state.-version: 0.4.0+version: 0.5.0---# Use Avibe@@ -763,7 +763,7 @@ Do not expose bind codes unless the user explicitly asks for them.Use the harness commands when the user wants an agent to leave the current turn and continue later, repeatedly, or in the background. The mental model is:-- `vibe agent run`: run one concrete Agent job now; add `--async` when it should continue in the background+- `vibe agent run`: run one concrete Agent job now. Runs are async by default; pass `--sync` only when the current CLI must wait for the result.- `vibe task`: save a time trigger that creates Agent Runs later- `vibe watch`: save a condition trigger that waits for a process, file, log, CI, review, or other signal, then creates a follow-up Agent Run- `vibe runs`: inspect and cancel concrete run records@@ -772,40 +772,35 @@ Agents should prefer these managed harness commands over ad-hoc detached shellsPreferred CLI shape:-- one-shot direct run: `vibe agent run --agent '<agent-name>' --message '...'`-- one-shot async run: `vibe agent run --async --session-id '<session-id>' --message '...'`-- fork a Session for an alternate path: `vibe agent run --fork-session '<source-session-id>' --message '...'`-- delegated async run that reports back: `vibe agent run --async --session-id '<target-session-id>' --callback-session-id '<caller-session-id>' --message '...'`-- recurring task: `vibe task add --session-id '<session-id>' --cron '<expr>' --message '...'`-- one-off task: `vibe task add --session-id '<session-id>' --at '<ISO-8601>' --message '...'`+- delegate to another Agent in a private/background Session from an Avibe Agent shell: `vibe agent run --agent '<agent-name>' --message '...'`+- delegate to a visible sibling Session in the same scope from an Avibe Agent shell: `vibe agent run --agent '<agent-name>' --same-scope --message '...'`+- wait for an Agent result in the terminal: `vibe agent run --sync --agent '<agent-name>' --message '...'`+- continue a specific existing Session: `vibe agent run --session-id '<session-id>' --message '...'`+- fork this Session for an alternate path: `vibe agent run --fork-self --message '...'`+- fork another explicit Session for an alternate path: `vibe agent run --fork-session '<source-session-id>' --message '...'`+- recurring task for this conversation: `vibe task add --cron '<expr>' --message '...'`+- one-off task for this conversation: `vibe task add --at '<ISO-8601>' --message '...'`+- task that creates a visible sibling Session: `vibe task add --create-session --same-scope --cron '<expr>' --message '...'`- immediate rerun: `vibe task run <id>`-- managed background watch: `vibe watch add --session-id '<session-id>' --message '...' -- <cmd>` (or `--shell '<cmd>'` to pass a single shell string)+- 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>`- cancel a run: `vibe runs cancel <run-id>`-Delivery controls (apply to `vibe agent run --create-session`, `vibe task add`, and `vibe watch add`):--- `--session-id` controls which Agent Session Avibe continues using-- when you want to keep the current session, use the current Agent Session ID-- if no usable Agent Session ID is available, confirm the target session first instead of guessing-- use `--post-to channel` when the task or watch should keep the same Agent Session but publish to the parent channel-- use `--deliver-key '<key>'` only when delivery must go to a different explicit target than the continued session-- do not combine `--post-to` and `--deliver-key` in the same command-- `--message` and `--message-file` are the current user-message flags for task, watch, and agent-run commands-- `vibe task add` stores the message template and creates Agent Runs when the time trigger fires-- `vibe agent run --async` queues one Agent Run immediately without storing a task definition-- `--fork-session` creates a new Agent Session by forking the source Session's native backend context. Use it when work should branch from an existing context without mutating that source Session.-- fork overrides are intentionally narrow: `--agent`, `--model`, and `--reasoning-effort` can override the forked Session only if the backend stays the same; cross-backend forks are rejected.-- do not combine `--fork-session` with `--session-id`, `--create-session`, `--deliver-key`, or `--post-to`.-- `--callback-session-id` on an async Agent Run sends the final result text back into the caller Session as a follow-up Agent message; it is independent from `--post-to` and `--deliver-key`-- `vibe watch add` uses `--message` as the instruction template for the Agent Run created after the waiter reaches a reportable state--Legacy compatibility:--- `--session-key` is still accepted for old scripts; do not use it in new examples or instructions unless the user explicitly asks for legacy targeting-- `--prompt` / `--prompt-file` are deprecated compatibility inputs. Do not use them in new invocations; use `--message` / `--message-file`.-- `vibe hook send` is deprecated. Do not use it for new one-shot async work; use `vibe agent run --async`.+Targeting and callbacks:++- In an Avibe-injected Agent shell, commands that operate on this conversation default to the current Agent Session. Omit the target when the work should continue here.+- Use `--session-id <id>` only when the command should operate on a different existing Agent Session.+- When `vibe agent run --session-id <id>` targets an existing Session, it sends a new message into that Session. It does not change that Session's cwd, scope, Agent, model, or reasoning settings.+- When `vibe agent run` creates a new Session, the default placement is private/background. Add `--same-scope` for a visible sibling Session in the same Workbench project or IM scope, or `--scope-id <scopes.id>` for a specific existing scope.+- When a task, watch, or new Agent run creates a Session and `--cwd` is omitted, Avibe uses the command's current working directory. Forks keep the source Session cwd by default.+- Async Agent runs return the final result to this conversation by default. Pass `--no-callback` only when you will inspect the run later with `vibe runs`. Pass `--callback-session-id <id>` only when the final result should return to a different Session.+- `--message` and `--message-file` are the user-message flags for task, watch, and agent-run commands.+- `vibe task add` stores the message template and creates Agent Runs when the time trigger fires.+- `vibe watch add` uses `--message` as the instruction template for the Agent Run created after the waiter reaches a reportable state.+- `--fork-self` forks this Session's native backend context. `--fork-session <id>` forks another explicit Session. Forks keep the source Session backend, scope, and cwd by default.+- Fork overrides are intentionally narrow: `--agent`, `--model`, and `--reasoning-effort` can override the forked Session only if the backend stays the same. Do not combine fork flags with existing-session or session-creation flags.Operational guidance:@@ -966,14 +961,14 @@ Scheduled tasks:Agent runs:-- `vibe agent run` — run one Agent job now; add `--async` for one-shot background work+- `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 recordsWatches:- `vibe watch add`, `vibe watch update <id>`, `vibe watch list [--brief]`, `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. The delivery flags shared by harness commands are `--session-id`, `--post-to`, and `--deliver-key`, with command-specific mutual exclusion rules. 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 `--async`; 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`). Do not copy flags between task, watch, and agent-run commands without checking help.+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`). Do not copy flags between task, watch, and agent-run commands without checking help.## Troubleshootingdiff --git a/skills/use-vibe-remote/SKILL.md b/skills/use-vibe-remote/SKILL.mdindex abfe18427..20de58501 100644--- a/skills/use-vibe-remote/SKILL.md+++ b/skills/use-vibe-remote/SKILL.md@@ -2,7 +2,7 @@name: use-vibe-remoteslug: use-vibe-remotedescription: Safely inspect and modify local Avibe configuration, routing, runtime settings, watches, scheduled tasks, Avibe Cloud remote access, and operational state.-version: 0.4.0+version: 0.5.0---# Use Avibe@@ -763,7 +763,7 @@ Do not expose bind codes unless the user explicitly asks for them.Use the harness commands when the user wants an agent to leave the current turn and continue later, repeatedly, or in the background. The mental model is:-- `vibe agent run`: run one concrete Agent job now; add `--async` when it should continue in the background+- `vibe agent run`: run one concrete Agent job now. Runs are async by default; pass `--sync` only when the current CLI must wait for the result.- `vibe task`: save a time trigger that creates Agent Runs later- `vibe watch`: save a condition trigger that waits for a process, file, log, CI, review, or other signal, then creates a follow-up Agent Run- `vibe runs`: inspect and cancel concrete run records@@ -772,38 +772,35 @@ Agents should prefer these managed harness commands over ad-hoc detached shellsPreferred CLI shape:-- one-shot direct run: `vibe agent run --agent '<agent-name>' --message '...'`-- one-shot async run: `vibe agent run --async --session-id '<session-id>' --message '...'`-- fork a Session for an alternate path: `vibe agent run --fork-session '<source-session-id>' --message '...'`-- recurring task: `vibe task add --session-id '<session-id>' --cron '<expr>' --message '...'`-- one-off task: `vibe task add --session-id '<session-id>' --at '<ISO-8601>' --message '...'`+- delegate to another Agent in a private/background Session from an Avibe Agent shell: `vibe agent run --agent '<agent-name>' --message '...'`+- delegate to a visible sibling Session in the same scope from an Avibe Agent shell: `vibe agent run --agent '<agent-name>' --same-scope --message '...'`+- wait for an Agent result in the terminal: `vibe agent run --sync --agent '<agent-name>' --message '...'`+- continue a specific existing Session: `vibe agent run --session-id '<session-id>' --message '...'`+- fork this Session for an alternate path: `vibe agent run --fork-self --message '...'`+- fork another explicit Session for an alternate path: `vibe agent run --fork-session '<source-session-id>' --message '...'`+- recurring task for this conversation: `vibe task add --cron '<expr>' --message '...'`+- one-off task for this conversation: `vibe task add --at '<ISO-8601>' --message '...'`+- task that creates a visible sibling Session: `vibe task add --create-session --same-scope --cron '<expr>' --message '...'`- immediate rerun: `vibe task run <id>`-- managed background watch: `vibe watch add --session-id '<session-id>' --message '...' -- <cmd>` (or `--shell '<cmd>'` to pass a single shell string)+- 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>`- cancel a run: `vibe runs cancel <run-id>`-Delivery controls (apply to `vibe agent run --create-session`, `vibe task add`, and `vibe watch add`):+Targeting and callbacks:-- `--session-id` controls which Agent Session Avibe continues using-- when you want to keep the current session, use the current Agent Session ID-- if no usable Agent Session ID is available, confirm the target session first instead of guessing-- use `--post-to channel` when the task or watch should keep the same Agent Session but publish to the parent channel-- use `--deliver-key '<key>'` only when delivery must go to a different explicit target than the continued session-- do not combine `--post-to` and `--deliver-key` in the same command-- `--message` and `--message-file` are the current user-message flags for task, watch, and agent-run commands-- `vibe task add` stores the message template and creates Agent Runs when the time trigger fires-- `vibe agent run --async` queues one Agent Run immediately without storing a task definition-- `--fork-session` creates a new Agent Session by forking the source Session's native backend context. Use it when work should branch from an existing context without mutating that source Session.-- fork overrides are intentionally narrow: `--agent`, `--model`, and `--reasoning-effort` can override the forked Session only if the backend stays the same; cross-backend forks are rejected.-- do not combine `--fork-session` with `--session-id`, `--create-session`, `--deliver-key`, or `--post-to`.-- `vibe watch add` uses `--message` as the instruction template for the Agent Run created after the waiter reaches a reportable state--Legacy compatibility:--- `--session-key` is still accepted for old scripts; do not use it in new examples or instructions unless the user explicitly asks for legacy targeting-- `--prompt` / `--prompt-file` are deprecated compatibility inputs. Do not use them in new invocations; use `--message` / `--message-file`.-- `vibe hook send` is deprecated. Do not use it for new one-shot async work; use `vibe agent run --async`.+- In an Avibe-injected Agent shell, commands that operate on this conversation default to the current Agent Session. Omit the target when the work should continue here.+- Use `--session-id <id>` only when the command should operate on a different existing Agent Session.+- When `vibe agent run --session-id <id>` targets an existing Session, it sends a new message into that Session. It does not change that Session's cwd, scope, Agent, model, or reasoning settings.+- When `vibe agent run` creates a new Session, the default placement is private/background. Add `--same-scope` for a visible sibling Session in the same Workbench project or IM scope, or `--scope-id <scopes.id>` for a specific existing scope.+- When a task, watch, or new Agent run creates a Session and `--cwd` is omitted, Avibe uses the command's current working directory. Forks keep the source Session cwd by default.+- Async Agent runs return the final result to this conversation by default. Pass `--no-callback` only when you will inspect the run later with `vibe runs`. Pass `--callback-session-id <id>` only when the final result should return to a different Session.+- `--message` and `--message-file` are the user-message flags for task, watch, and agent-run commands.+- `vibe task add` stores the message template and creates Agent Runs when the time trigger fires.+- `vibe watch add` uses `--message` as the instruction template for the Agent Run created after the waiter reaches a reportable state.+- `--fork-self` forks this Session's native backend context. `--fork-session <id>` forks another explicit Session. Forks keep the source Session backend, scope, and cwd by default.+- Fork overrides are intentionally narrow: `--agent`, `--model`, and `--reasoning-effort` can override the forked Session only if the backend stays the same. Do not combine fork flags with existing-session or session-creation flags.Operational guidance:@@ -964,14 +961,14 @@ Scheduled tasks:Agent runs:-- `vibe agent run` — run one Agent job now; add `--async` for one-shot background work+- `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 recordsWatches:- `vibe watch add`, `vibe watch update <id>`, `vibe watch list [--brief]`, `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. The delivery flags shared by harness commands are `--session-id`, `--post-to`, and `--deliver-key`, with command-specific mutual exclusion rules. 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 `--async`; 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`). Do not copy flags between task, watch, and agent-run commands without checking help.+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`). Do not copy flags between task, watch, and agent-run commands without checking help.## Troubleshootingdiff --git a/tests/test_cli_agent_run_schema.py b/tests/test_cli_agent_run_schema.pyindex 21d5e71cf..2cef02dea 100644--- a/tests/test_cli_agent_run_schema.py+++ b/tests/test_cli_agent_run_schema.py@@ -77,8 +77,8 @@ _EXPECTED_RUN_KEYS_QUEUED = {}-def test_agent_run_async_envelope_schema(tmp_path: Path, capsys) -> None:- """Locks the top-level keys + nested ``run`` keys for the async path+def test_agent_run_default_async_envelope_schema(tmp_path: Path, capsys) -> None:+ """Locks the top-level keys + nested ``run`` keys for the default async path(the synchronous path adds the resolved result fields after``_wait_for_run_result``, so they're tested via existing wait-flowcoverage).@@ -88,7 +88,7 @@ def test_agent_run_async_envelope_schema(tmp_path: Path, capsys) -> None:agent_store = cli.VibeAgentStore(db_path)agent_store.create(name="worker", backend="codex")request_store = cli.TaskExecutionStore(tmp_path / "task_requests")- args = _parse_agent_run(["--agent", "worker", "--async", "--no-callback", "--message", "hi"])+ args = _parse_agent_run(["--agent", "worker", "--no-callback", "--message", "hi"])with (patch("vibe.cli._agent_store", return_value=agent_store),@@ -128,6 +128,27 @@ def test_agent_run_async_envelope_schema(tmp_path: Path, capsys) -> None:assert run["parent_run_id"] is None+def test_agent_run_explicit_async_flag_remains_compatible(tmp_path: Path, capsys) -> None:+ db_path = tmp_path / "state" / "vibe.sqlite"+ agent_store = cli.VibeAgentStore(db_path)+ agent_store.create(name="worker", backend="codex")+ request_store = cli.TaskExecutionStore(tmp_path / "task_requests")+ args = _parse_agent_run(["--agent", "worker", "--async", "--no-callback", "--message", "hi"])++ with (+ patch("vibe.cli._agent_store", return_value=agent_store),+ patch("vibe.cli._task_request_store", return_value=request_store),+ patch("vibe.cli.paths.get_sqlite_state_path", return_value=db_path),+ patch("vibe.cli._primary_platform", return_value="slack"),+ ):+ result = cli.cmd_agent_run(args)++ assert result == 0+ payload = json.loads(capsys.readouterr().out)+ assert payload["async"] is True+ assert payload["run"]["status"] == "queued"++def test_agent_run_async_accepts_callback_session_id(tmp_path: Path, capsys) -> None:from core.services import sessions as sessions_servicefrom storage.db import create_sqlite_engine@@ -179,7 +200,6 @@ def test_agent_run_async_accepts_callback_session_id(tmp_path: Path, capsys) ->["--agent","worker",- "--async","--callback-session-id",callback_session["id"],"--message",@@ -217,7 +237,7 @@ def test_agent_run_async_requires_callback_or_no_callback_without_caller(tmp_patagent_store = cli.VibeAgentStore(db_path)agent_store.create(name="worker", backend="codex")request_store = cli.TaskExecutionStore(tmp_path / "task_requests")- args = _parse_agent_run(["--agent", "worker", "--async", "--message", "hi"])+ args = _parse_agent_run(["--agent", "worker", "--message", "hi"])with (patch("vibe.cli._agent_store", return_value=agent_store),@@ -287,7 +307,7 @@ def test_agent_run_async_defaults_callback_from_caller_env(tmp_path: Path, capsyagent_store = cli.VibeAgentStore(db_path)agent_store.create(name="worker", backend="codex")request_store = cli.TaskExecutionStore(tmp_path / "task_requests")- args = _parse_agent_run(["--agent", "worker", "--async", "--message", "hi"])+ args = _parse_agent_run(["--agent", "worker", "--message", "hi"])with (patch.dict(@@ -379,7 +399,7 @@ def test_agent_run_async_self_target_defaults_to_no_callback(agent_store = cli.VibeAgentStore(db_path)agent_store.create(name="caller", backend="codex")request_store = cli.TaskExecutionStore(tmp_path / "task_requests")- args = _parse_agent_run(["--session-id", caller_session["id"], "--async", "--message", "hi"])+ args = _parse_agent_run(["--session-id", caller_session["id"], "--message", "hi"])with (patch.dict(@@ -456,7 +476,7 @@ def test_agent_run_sync_self_target_detach_defaults_to_no_callback(agent_store = cli.VibeAgentStore(db_path)agent_store.create(name="caller", backend="codex")request_store = cli.TaskExecutionStore(tmp_path / "task_requests")- args = _parse_agent_run(["--session-id", caller_session["id"], "--message", "hi"])+ args = _parse_agent_run(["--session-id", caller_session["id"], "--sync", "--message", "hi"])with (patch.dict(@@ -541,7 +561,7 @@ def test_agent_run_callback_session_records_sync_route(tmp_path: Path, capsys) -agent_store = cli.VibeAgentStore(db_path)agent_store.create(name="worker", backend="codex")request_store = cli.TaskExecutionStore(tmp_path / "task_requests")- args = _parse_agent_run(["--agent", "worker", "--callback-session-id", callback_session["id"], "--message", "hi"])+ args = _parse_agent_run(["--agent", "worker", "--sync", "--callback-session-id", callback_session["id"], "--message", "hi"])with (patch("vibe.cli._agent_store", return_value=agent_store),@@ -562,6 +582,64 @@ def test_agent_run_callback_session_records_sync_route(tmp_path: Path, capsys) -assert stored["callback_status"] is None+def test_agent_run_sync_waits_for_run_result(tmp_path: Path, capsys) -> None:+ db_path = tmp_path / "state" / "vibe.sqlite"+ agent_store = cli.VibeAgentStore(db_path)+ agent_store.create(name="worker", backend="codex")+ request_store = cli.TaskExecutionStore(tmp_path / "task_requests")+ args = _parse_agent_run(["--agent", "worker", "--sync", "--no-callback", "--message", "hi"])++ wait_calls: list[tuple[str, float | None]] = []++ def _wait_for_result(_store, run_id: str, *, wait_timeout: float | None) -> dict:+ wait_calls.append((run_id, wait_timeout))+ return {"id": "done", "status": "succeeded"}++ with (+ patch("vibe.cli._agent_store", return_value=agent_store),+ patch("vibe.cli._task_request_store", return_value=request_store),+ patch("vibe.cli.paths.get_sqlite_state_path", return_value=db_path),+ patch("vibe.cli._primary_platform", return_value="slack"),+ patch("vibe.cli._wait_for_run_result", side_effect=_wait_for_result),+ ):+ result = cli.cmd_agent_run(args)++ assert result == 0+ payload = json.loads(capsys.readouterr().out)+ assert payload["async"] is False+ assert payload["run"] == {"id": "done", "status": "succeeded"}+ assert wait_calls == [(payload["run_id"], None)]+++def test_agent_run_sync_wait_timeout_is_passed_to_waiter(tmp_path: Path, capsys) -> None:+ db_path = tmp_path / "state" / "vibe.sqlite"+ agent_store = cli.VibeAgentStore(db_path)+ agent_store.create(name="worker", backend="codex")+ request_store = cli.TaskExecutionStore(tmp_path / "task_requests")+ args = _parse_agent_run(+ ["--agent", "worker", "--sync", "--wait-timeout", "2.5", "--no-callback", "--message", "hi"]+ )+ wait_timeouts: list[float | None] = []++ def _wait_for_result(_store, _run_id: str, *, wait_timeout: float | None) -> dict:+ wait_timeouts.append(wait_timeout)+ return {"id": "done", "status": "succeeded"}++ with (+ patch("vibe.cli._agent_store", return_value=agent_store),+ patch("vibe.cli._task_request_store", return_value=request_store),+ patch("vibe.cli.paths.get_sqlite_state_path", return_value=db_path),+ patch("vibe.cli._primary_platform", return_value="slack"),+ patch("vibe.cli._wait_for_run_result", side_effect=_wait_for_result),+ ):+ result = cli.cmd_agent_run(args)++ assert result == 0+ payload = json.loads(capsys.readouterr().out)+ assert payload["async"] is False+ assert wait_timeouts == [2.5]++def test_agent_run_callback_session_records_sync_route_in_sqlite_store(tmp_path: Path, capsys) -> None:from core.services import sessions as sessions_servicefrom sqlalchemy import select@@ -610,7 +688,7 @@ def test_agent_run_callback_session_records_sync_route_in_sqlite_store(tmp_path:)args = _parse_agent_run(- ["--agent", "worker", "--callback-session-id", callback_session["id"], "--message", "hi"]+ ["--agent", "worker", "--sync", "--callback-session-id", callback_session["id"], "--message", "hi"])with (@@ -683,7 +761,7 @@ def test_agent_run_sync_detach_marks_callback_pending(tmp_path: Path, capsys) ->)args = _parse_agent_run(- ["--agent", "worker", "--callback-session-id", callback_session["id"], "--message", "hi"]+ ["--agent", "worker", "--sync", "--callback-session-id", callback_session["id"], "--message", "hi"])with (diff --git a/tests/test_cli_task_command.py b/tests/test_cli_task_command.pyindex 4dc04ada2..bd6dd279f 100644--- a/tests/test_cli_task_command.py+++ b/tests/test_cli_task_command.py@@ -216,12 +216,12 @@ def test_hook_send_help_describes_runtime_effects(capsys) -> None:assert exc.value.code == 0captured = capsys.readouterr()assert "`vibe hook send` is a compatibility entrypoint." in captured.out- assert "New automation should use `vibe agent run --async`." in captured.out+ assert "New automation should use `vibe agent run`." in captured.outassert "`vibe hook send` queues one deprecated asynchronous compatibility turn" in captured.outassert "--post-to" not in captured.outassert "`--message` and `--message-file` provide the one-shot async user message that will be queued immediately." in captured.outassert "--session-id" in captured.out- assert "vibe agent run --async --session-id sesk8m4q2p7x --no-callback --message" in captured.out+ assert "vibe agent run --session-id sesk8m4q2p7x --no-callback --message" in captured.outdef test_task_list_help_mentions_completed_one_shots_hidden_by_default(capsys) -> None:@@ -264,7 +264,7 @@ def test_hook_send_help_includes_examples_and_threadless_guidance(capsys) -> Nonassert "--post-to" not in captured.outassert "--deliver-key" not in captured.outassert "--session-id" in captured.out- assert "vibe agent run --async --session-id sesk8m4q2p7x --no-callback" in captured.out+ assert "vibe agent run --session-id sesk8m4q2p7x --no-callback" in captured.outdef test_agent_run_help_includes_fork_session_guidance(capsys) -> None:@@ -277,21 +277,28 @@ def test_agent_run_help_includes_fork_session_guidance(capsys) -> None:captured = capsys.readouterr()assert "--fork-session FORK_SESSION" in captured.outassert "--fork-self" in captured.out+ assert "--sync" in captured.outassert "--same-scope" in captured.outassert "--scope-id" in captured.outassert "--deliver-key" not in captured.out+ assert "Avibe Agent shell examples:" in captured.out+ assert "Normal terminal examples:" in captured.outassert "--fork-self forks this current Session." in captured.outassert "Forks keep the same backend, scope, and cwd as the source Session." in captured.out- assert "vibe agent run --async --fork-self --message" in captured.out+ assert "vibe agent run --fork-self --message" in captured.out+ assert "Agent runs are async by default. From an Avibe Agent shell, they return their final result to this conversation by default." in captured.outassert "vibe agent run --agent release-reviewer --message 'Review the latest deployment result.'" in captured.outassert ("vibe agent run --agent release-reviewer --same-scope --message 'Review this project in a visible sibling Session.'"in captured.out)- assert "vibe agent run --agent release-reviewer --no-callback --message" not in captured.out+ assert (+ "vibe agent run --agent release-reviewer --no-callback --message 'Review the latest deployment result.'"+ not in captured.out+ )assert "vibe agent run --agent release-reviewer --same-scope --no-callback --message" not in captured.out- assert "From an Avibe Agent shell, async runs return their final result to this conversation by default." in captured.outassert "From a normal terminal, pass --callback-session-id or --no-callback for async runs." in captured.out+ assert "Review the latest CI result and print it here." in captured.outassert "Review the latest CI result and report back." in captured.outassert "--callback-session-id sescaller456 --message 'Review the latest CI result and report back.'" in captured.outassert "--no-callback --message 'Review the latest CI result and report back.'" not in captured.out@@ -299,6 +306,50 @@ def test_agent_run_help_includes_fork_session_guidance(capsys) -> None:assert "--create-session-per-run" not in captured.out+def test_agent_run_rejects_async_and_sync_together(capsys) -> None:+ parser = cli.build_parser()++ with pytest.raises(SystemExit) as exc:+ parser.parse_args(["agent", "run", "--async", "--sync", "--message", "hello"])++ assert exc.value.code == 2+ payload = json.loads(capsys.readouterr().err)+ assert payload["code"] == "invalid_arguments"+ assert "not allowed with argument --async" in payload["error"]+++def test_agent_run_runtime_rejects_async_and_sync_together() -> None:+ args = SimpleNamespace(+ agent="worker",+ session_id=None,+ fork_session=None,+ fork_self=False,+ create_session=False,+ create_session_per_run=False,+ same_scope=False,+ scope_id=None,+ deliver_key=None,+ model=None,+ reasoning_effort=None,+ cwd=None,+ post_to=None,+ callback_session_id=None,+ no_callback=True,+ async_run=True,+ sync_run=True,+ wait_timeout=None,+ message="hello",+ message_file=None,+ prompt=None,+ prompt_file=None,+ )++ result, payload = _capture_stderr_json(cli.cmd_agent_run, args)++ assert result == 1+ assert payload["code"] == "conflicting_wait_policy"++def test_task_add_parse_error_is_structured_json(capsys) -> None:parser = cli.build_parser()@@ -1300,6 +1351,22 @@ def test_hook_send_rejects_invalid_session_key_with_hint() -> None:assert payload["help_command"] == "vibe hook send --help"+def test_hook_send_deprecation_warning_names_callback_policy(tmp_path: Path, capsys) -> None:+ args = _parse_hook_send(["--session-key", "slack::channel::C123", "--message", "hello"])++ with (+ patch("vibe.cli._ensure_config", return_value=_configured_v2({"slack"})),+ patch("vibe.cli._task_request_store", return_value=cli.TaskExecutionStore(tmp_path / "task_requests")),+ ):+ result = cli.cmd_hook_send(args)++ assert result == 0+ payload = json.loads(capsys.readouterr().out)+ assert "vibe hook send is deprecated" in payload["deprecation_warning"]+ assert "--no-callback" in payload["deprecation_warning"]+ assert "--callback-session-id <session-id>" in payload["deprecation_warning"]++def test_hook_send_rejects_conflicting_delivery_target_flags(capsys) -> None:parser = cli.build_parser()@@ -1703,7 +1770,7 @@ def test_agent_run_rejects_cross_backend_agent_for_existing_session(tmp_path: Pa)finally:service.close()- args = _parse_agent_run(["--agent", "codex-worker", "--session-id", session_id, "--message", "hello"])+ args = _parse_agent_run(["--agent", "codex-worker", "--sync", "--session-id", session_id, "--message", "hello"])with (patch("vibe.cli._agent_store", return_value=agent_store),@@ -1776,7 +1843,7 @@ def test_agent_run_rejects_different_same_backend_agent_for_existing_session(tmp)finally:service.close()- args = _parse_agent_run(["--agent", "other-worker", "--session-id", session_id, "--message", "hello"])+ args = _parse_agent_run(["--agent", "other-worker", "--sync", "--session-id", session_id, "--message", "hello"])with (patch("vibe.cli._agent_store", return_value=agent_store),@@ -1909,13 +1976,14 @@ def test_agent_run_existing_session_uses_session_agent_when_agent_omitted(tmp_paassert queued["agent_name"] == "worker"-def test_agent_run_rejects_async_wait_timeout_combo() -> None:- args = _parse_agent_run(["--agent", "worker", "--async", "--wait-timeout", "5", "--message", "hello"])+def test_agent_run_rejects_default_async_wait_timeout_combo() -> None:+ args = _parse_agent_run(["--agent", "worker", "--wait-timeout", "5", "--message", "hello"])result, payload = _capture_stderr_json(cli.cmd_agent_run, args)assert result == 1assert payload["code"] == "conflicting_wait_policy"+ assert "--sync" in payload["hint"]def test_agent_create_accepts_effort_alias(tmp_path: Path, capsys) -> None:diff --git a/tests/test_harness_skill_guidance.py b/tests/test_harness_skill_guidance.pynew file mode 100644index 000000000..781fbcc0f--- /dev/null+++ b/tests/test_harness_skill_guidance.py@@ -0,0 +1,66 @@+from __future__ import annotations++from pathlib import Path+++ROOT = Path(__file__).resolve().parents[1]+++def _read(path: str) -> str:+ return (ROOT / path).read_text()+++def test_avibe_skills_teach_current_harness_defaults() -> None:+ for path in ("skills/use-avibe/SKILL.md", "skills/use-vibe-remote/SKILL.md"):+ body = _read(path)++ assert "Runs are async by default" in body+ assert "pass `--sync` only when" in body+ assert "Omit the target when the work should continue here." in body+ assert "vibe agent run --agent '<agent-name>' --message '...'" in body+ assert "from an Avibe Agent shell" in body+ assert "vibe task add --cron '<expr>' --message '...'" in body+ assert "vibe watch add --message '...' -- <cmd>" in body+ assert "vibe agent run --agent '<agent-name>' --same-scope --message '...'" in body+ assert "Avibe uses the command's current working directory" in body+ assert "Forks keep the source Session cwd by default" in body+ assert "follows the caller or source Session cwd" not in body+++def test_avibe_skills_do_not_reintroduce_legacy_harness_guidance() -> None:+ disallowed = (+ "--deliver-key",+ "`--prefix`",+ "vibe hook send",+ "--prompt`",+ "one-shot async run",+ "vibe agent run --async",+ "Delivery controls",+ "Legacy compatibility",+ "`vibe agent run` takes `--async`",+ "current Agent Session ID",+ )++ for path in (+ "skills/use-avibe/SKILL.md",+ "skills/use-vibe-remote/SKILL.md",+ "skills/background-watch-hook/SKILL.md",+ ):+ body = _read(path)+ for text in disallowed:+ assert text not in body, f"{path} still contains {text!r}"+++def test_background_watch_skill_defaults_to_current_session() -> None:+ body = _read("skills/background-watch-hook/SKILL.md")++ assert ' --message "<what the next Agent Run should do>"' in body+ assert "Inside an Avibe-injected Agent shell, omitting the target continues this conversation." in body+ assert "Use `--session-id <id>` only when" in body+ assert "Use `--create-session --same-scope` when follow-ups should run in one visible sibling Session" in body+ assert "use `--create-session-per-run --same-scope`" in body+ assert "use `--create-session-per-run --scope-id <scopes.id>`" in body+ assert "Avibe uses the command's current working directory" in body+ assert "each follow-up should run in a visible sibling Session" not in body+ assert ' --session-id "sesk8m4q2p7x"' not in body+ assert "`--prefix`" not in bodydiff --git a/tests/test_reply_enhancer_platform.py b/tests/test_reply_enhancer_platform.pyindex 250411868..90f20dcc5 100644--- a/tests/test_reply_enhancer_platform.py+++ b/tests/test_reply_enhancer_platform.py@@ -343,7 +343,8 @@ class ReplyEnhancerPlatformTests(unittest.IsolatedAsyncioTestCase):self.assertIn("`vibe watch add` creates a managed monitor", prompt)self.assertIn("product signals, business events, files, logs, CI/reviews/deploys", prompt)self.assertIn("Use `vibe agent run --agent <agent-name> --message ...` when one Agent delegates work", prompt)- self.assertIn("From this Avibe Agent shell, async runs return their final result to this conversation by default", prompt)+ self.assertIn("returns immediately, and from this Avibe Agent shell sends the final result back to this conversation", prompt)+ self.assertIn("Pass `--sync` only when the current process must wait for the result", prompt)self.assertIn("Add `--same-scope` when the new Session should live under the same Workbench project or IM scope", prompt)self.assertIn("Use `vibe agent run --fork-self --message ...` when work should branch from this current Session", prompt)self.assertIn("Forks keep the source Session backend, scope, and cwd by default", prompt)@@ -375,8 +376,8 @@ class ReplyEnhancerPlatformTests(unittest.IsolatedAsyncioTestCase):self.assertIn("Async callbacks return to this conversation by default", prompt)self.assertNotIn("Reuse an existing Session only with Agents whose `Backend` matches", prompt)self.assertIn("With `--fork-self` or `--fork-session`, pass `--agent`, `--model`, or `--reasoning-effort` only as forked-Session overrides", prompt)- self.assertIn("`--async` changes waiting behavior, not session identity", prompt)- self.assertIn("inspected later with `vibe runs`", prompt)+ self.assertIn("`--sync` changes waiting behavior, not session identity", prompt)+ self.assertIn("synchronous runs wait for the result and are still recorded in `vibe runs`", prompt)self.assertNotIn("--create-session-per-run", prompt)self.assertIn("Create or update Agents only when it captures a reusable role", prompt)self.assertIn("## Memory and Project Context", prompt)diff --git a/vibe/cli.py b/vibe/cli.pyindex 0d2c04457..f17f97c54 100644--- a/vibe/cli.py+++ b/vibe/cli.py@@ -324,23 +324,23 @@ def _hook_send_examples_text() -> str:"""\Deprecated:`vibe hook send` is a compatibility entrypoint.- New automation should use `vibe agent run --async`.+ New automation should use `vibe agent run`.Session target:Use --session-id with the target Agent Session ID, for example sesk8m4q2p7x.Guidance:- If this is your first time creating an async one-shot run, use `vibe agent run --async --help`.+ If this is your first time creating an async one-shot run, use `vibe agent run --help`.`vibe hook send` queues one deprecated asynchronous compatibility turn without persisting a scheduled task.`--session-id` chooses which Agent Session Avibe will continue using for that one async turn.Keep the current session id when the hook should continue in the same session.If no session id is available, trigger this from an active Avibe conversation instead of guessing.- For new async one-shot work, prefer `vibe agent run --async`.+ For new async one-shot work, prefer `vibe agent run`.`--message` and `--message-file` provide the one-shot async user message that will be queued immediately.Examples:- vibe agent run --async --session-id sesk8m4q2p7x --no-callback --message 'The export finished. Share the summary.'- vibe agent run --async --session-id sesk8m4q2p7x --no-callback --message 'Run the benchmark; I will inspect the run later.'+ vibe agent run --session-id sesk8m4q2p7x --no-callback --message 'The export finished. Share the summary.'+ vibe agent run --session-id sesk8m4q2p7x --no-callback --message 'Run the benchmark; I will inspect the run later.'""")@@ -643,10 +643,11 @@ def _agent_run_examples_text() -> str:--cwd only applies to new Sessions; existing Sessions keep their own cwd.Callback:- From an Avibe Agent shell, async runs return their final result to this conversation by default.+ Agent runs are async by default. From an Avibe Agent shell, they return their final result to this conversation by default.From a normal terminal, pass --callback-session-id or --no-callback for async runs.Pass --no-callback only when you intentionally want no automatic follow-up.Pass --callback-session-id only when the final result should return somewhere else.+ Pass --sync when the CLI should wait for the run result in the terminal.Forking:--fork-self forks this current Session.@@ -655,12 +656,17 @@ def _agent_run_examples_text() -> str:--agent, --model, and --reasoning-effort may override the forked Session's Agent/model/effort.Do not combine fork flags with --session-id or --create-session.- Examples:+ Avibe Agent shell examples:vibe agent run --agent release-reviewer --message 'Review the latest deployment result.'vibe agent run --agent release-reviewer --same-scope --message 'Review this project in a visible sibling Session.'- vibe agent run --async --agent release-reviewer --callback-session-id sescaller456 --message 'Review the latest CI result and report back.'- vibe agent run --async --agent release-reviewer --no-callback --message 'Run a background experiment; I will inspect the run later.'- vibe agent run --async --fork-self --message 'Explore this alternate fix from the current context.'++ Normal terminal examples:+ vibe agent run --sync --agent release-reviewer --message 'Review the latest CI result and print it here.'+ vibe agent run --agent release-reviewer --callback-session-id sescaller456 --message 'Review the latest CI result and report back.'+ vibe agent run --agent release-reviewer --no-callback --message 'Run a background experiment; I will inspect the run later.'++ Fork examples:+ vibe agent run --fork-self --message 'Explore this alternate fix from the current context.'vibe agent run --fork-session sesk8m4q2p7x --agent reviewer --model gpt-5.4 --reasoning-effort high --message 'Review the forked context.'""")@@ -2640,7 +2646,11 @@ def cmd_hook_send(args):session_key=session_key,post_to=args.post_to,deliver_key=args.deliver_key,- deprecation_warning="vibe hook send is deprecated; use vibe agent run --async instead.",+ deprecation_warning=(+ "vibe hook send is deprecated; use `vibe agent run --session-id <session-id> "+ "--no-callback --message ...` for the same fire-and-forget behavior, or pass "+ "`--callback-session-id <session-id>` when the async run should report back."+ ),run={"id": request.id,"status": "queued",@@ -3029,11 +3039,18 @@ def _validate_run_session_policy(args, *, help_command: str) -> str:scope_id = (getattr(args, "scope_id", None) or "").strip()deliver_key = (getattr(args, "deliver_key", None) or "").strip()agent_name = (getattr(args, "agent", None) or "").strip()- if bool(getattr(args, "async_run", False)) and getattr(args, "wait_timeout", None) is not None:+ if bool(getattr(args, "async_run", False)) and bool(getattr(args, "sync_run", False)):+ raise TaskCliError(+ "use either --async or --sync, not both",+ code="conflicting_wait_policy",+ hint="Agent runs are async by default. Pass --sync only when the CLI should wait.",+ help_command=help_command,+ )+ if _agent_run_is_async(args) and getattr(args, "wait_timeout", None) is not None:raise TaskCliError(- "use --async or --wait-timeout, not both",+ "use --sync with --wait-timeout",code="conflicting_wait_policy",- hint="--async returns immediately. Remove --wait-timeout, or run synchronously without --async.",+ hint="Agent runs are async by default. Pass --sync when the CLI should wait, or remove --wait-timeout.",help_command=help_command,)if (getattr(args, "callback_session_id", None) or "").strip() and bool(getattr(args, "no_callback", False)):@@ -3390,10 +3407,14 @@ def _agent_run_source_from_caller(caller_context) -> tuple[str, Optional[str], Oreturn "agent", caller_context.session_id, caller_context.run_id, metadata+def _agent_run_is_async(args) -> bool:+ return not bool(getattr(args, "sync_run", False))++def _resolve_callback_session_id(args, caller_context, *, target_session_id: Optional[str] = None):explicit_callback = (getattr(args, "callback_session_id", None) or "").strip() or Noneno_callback = bool(getattr(args, "no_callback", False))- is_async = bool(getattr(args, "async_run", False))+ is_async = _agent_run_is_async(args)if explicit_callback:return explicit_callback, {"code": "callback_explicit",@@ -3595,6 +3616,7 @@ def _reserve_definition_session(def cmd_agent_run(args):try:caller_context = caller_context_from_env()+ run_async = _agent_run_is_async(args)message = _resolve_message_input(args,help_command="vibe agent run --help",@@ -3736,7 +3758,7 @@ def cmd_agent_run(args):source_actor=source_actor,parent_run_id=parent_run_id,callback_session_id=callback_session_id,- callback_active=bool(args.async_run),+ callback_active=run_async,metadata=provenance_metadata or None,)resolved_scope_id = _scope_id_payload_from_session(session_id)@@ -3751,7 +3773,7 @@ def cmd_agent_run(args):"scope_id": resolved_scope_id,"deliver_key": legacy_deliver_key,"callback_session_id": callback_session_id,- "async": bool(args.async_run),+ "async": run_async,"caller_context": caller_context.to_metadata() if caller_context else None,"callback_notice": callback_notice,"run": {@@ -3771,7 +3793,7 @@ def cmd_agent_run(args):payload["forked_from_session_id"] = fork_result.fork.source_session_idif fork_result:payload["run"]["forked_from_session_id"] = fork_result.fork.source_session_id- if not args.async_run:+ if not run_async:run_payload = _wait_for_run_result(request_store, request.id, wait_timeout=args.wait_timeout)if callback_session_id and _sync_run_detached(run_payload):request_store.mark_callback_pending(request.id)@@ -8652,7 +8674,7 @@ def build_parser():agent_run_parser = agent_subparsers.add_parser("run",help="Run an Avibe Agent",- description="Run an Avibe Agent turn. Use --async to queue it as a background run.",+ description="Run an Avibe Agent turn. Runs are async by default; use --sync to wait for the result.",epilog=_agent_run_examples_text(),formatter_class=argparse.RawDescriptionHelpFormatter,error_help_command="vibe agent run --help",@@ -8682,7 +8704,14 @@ def build_parser():action="store_true",help="For async runs, intentionally skip automatic callback delivery and inspect the run later.",)- agent_run_parser.add_argument("--async", dest="async_run", action="store_true", help="Queue the run and return immediately")+ agent_wait_group = agent_run_parser.add_mutually_exclusive_group()+ agent_wait_group.add_argument(+ "--async",+ dest="async_run",+ action="store_true",+ help="Queue the run and return immediately (default; kept for compatibility)",+ )+ agent_wait_group.add_argument("--sync", dest="sync_run", action="store_true", help="Wait for the run result before exiting")agent_run_parser.add_argument("--wait-timeout", type=float, help="Maximum seconds the CLI waits for a synchronous run result")agent_message_group = agent_run_parser.add_mutually_exclusive_group(required=True)agent_message_group.add_argument("--message")@@ -9366,21 +9395,21 @@ def build_parser():hook_parser = subparsers.add_parser("hook",help="Deprecated compatibility one-shot async hooks",- description="Deprecated compatibility entrypoint. Use 'vibe agent run --async' for new one-shot asynchronous turns.",+ description="Deprecated compatibility entrypoint. Use 'vibe agent run' for new one-shot asynchronous turns.",formatter_class=argparse.RawDescriptionHelpFormatter,error_help_command="vibe hook --help",- error_hint="Use 'vibe agent run --async --help' for the current async Agent Run command shape.",+ error_hint="Use 'vibe agent run --help' for the current async Agent Run command shape.",)hook_subparsers = hook_parser.add_subparsers(dest="hook_command", metavar="{send}")hook_subparsers.required = Truehook_send_parser = hook_subparsers.add_parser("send",help="Deprecated compatibility async send",- description="Deprecated compatibility entrypoint. Use 'vibe agent run --async' for new one-shot asynchronous Agent Runs.",+ description="Deprecated compatibility entrypoint. Use 'vibe agent run' for new one-shot asynchronous Agent Runs.",epilog=_hook_send_examples_text(),formatter_class=argparse.RawDescriptionHelpFormatter,error_help_command="vibe hook send --help",- error_hint="Use 'vibe agent run --async' for new async Agent Runs.",+ error_hint="Use 'vibe agent run' for new async Agent Runs.",)hook_send_parser.add_argument("--session-id",