agent-console 1.3.1: 全部自动同意 (Auto-approve all), split out of #727 (#747)

Auto-approve all (全部自动同意) ships in agent-console 1.3.1, split out of #727 (qingnian108).

The mode is off by default. In it, Codex runs with its sandbox off and Claude Code skips its checks. Cursor, OpenCode and dsh requests are answered allow-once by the console, never allow_always or acceptForSession. Each auto answer is saved with `auto: true` before the Agent goes on, and a banner shows while the mode is on. Plan confirmations and questions still ask. A 1.2 默认 of 全部放行 is not silently upgraded to real auto-approve. Pi keeps the `default` mode id ("Pi never asks"), so switching Agents before the first message never carries auto-approve into an Agent the user didn't pick.

Reviewed at 7e55c87ca merged onto main 20b89389:
- Linux (WSL2 Ubuntu 24.04): root `bun test packages/agent-console` 6/6; `bun scripts/check.mjs` OK; `npm run check` OK; vitest 461 passed / 17 skipped; `verify:build` 5/5 identical.
- Windows 11 (Edge): `e2e:v1` 29/29.
- Linux e2e stops at scenario 5 (steer timeout). It does the same on main 1.3.0, so it was filed as #753.
- Broken by hand:
  - Pi's modeMap back to bypassPermissions: 2 tests red.
  - The keeps line shown for every Agent: 1 test red.
  - Pi's label branch removed: 1 test red.
- An earlier round at 049449612 on macOS checked the daemon behaviour with probes. This version is published from the dist branch; the package isn't on npm.
This commit is contained in:
qingnian108
2026-11-05 14:02:29 +08:00
committed by GitHub
parent 20b893893f
commit 2c4e76dbba
38 changed files with 1378 additions and 136 deletions
@@ -17,8 +17,8 @@ export type TimelineEvent =
| { seq: number; ts: number; threadId: string; turnId?: string; type: "tool_call"; itemId: string; kind: ToolKind; title: string; status: "running" | "ok" | "failed"; input?: unknown; detail?: unknown; output?: string; exitCode?: number; durationMs?: number }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "plan"; itemId: string; markdown: string; entries?: { step: string; status: string }[] }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "todo"; items: { text: string; status: string }[] }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "permission_request"; requestId: string; title: string; kind: string; detail?: unknown; options: { id: string; label: string; kind: string }[] }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "permission_resolved"; requestId: string; optionId?: string; cancelled?: boolean }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "permission_request"; requestId: string; title: string; kind: string; detail?: unknown; options: { id: string; label: string; kind: string }[]; auto?: boolean }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "permission_resolved"; requestId: string; optionId?: string; cancelled?: boolean; auto?: boolean }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "question"; requestId: string; questions: unknown[] }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "question_answered"; requestId: string; answers: Record<string, string> }
| { seq: number; ts: number; threadId: string; turnId?: string; type: "usage"; inputTokens: number; outputTokens: number; cacheReadTokens: number; costUsd: number; contextWindow?: number }
@@ -37,8 +37,8 @@ export type ProviderEvent =
| { type: "tool_call"; itemId: string; kind: string; title: string; status: "running" | "ok" | "failed"; input?: unknown; detail?: unknown; output?: string; exitCode?: number; durationMs?: number }
| { type: "plan"; itemId: string; markdown: string; entries?: { step: string; status: string }[] }
| { type: "todo"; items: { text: string; status: string }[] }
| { type: "permission_request"; requestId: string; title: string; kind: string; detail?: unknown; options: { id: string; label: string; kind: string }[] }
| { type: "permission_resolved"; requestId: string; optionId?: string; cancelled?: boolean }
| { type: "permission_request"; requestId: string; title: string; kind: string; detail?: unknown; options: { id: string; label: string; kind: string }[]; auto?: boolean }
| { type: "permission_resolved"; requestId: string; optionId?: string; cancelled?: boolean; auto?: boolean }
| { type: "question"; requestId: string; questions: unknown[] }
| { type: "question_answered"; requestId: string; answers: Record<string, string> }
| { type: "usage"; inputTokens: number; outputTokens: number; cacheReadTokens: number; costUsd: number; contextWindow?: number }