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:
@@ -152,6 +152,7 @@ textarea.tinput { height: auto; min-height: 60px; padding: 6px 10px; resize: ver
|
||||
.sm-opt.off:hover { background: none; }
|
||||
.sm-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
|
||||
.sm-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.sm-label > svg { vertical-align: -2px; margin-right: 5px; }
|
||||
.sm-hint { font-size: var(--fs-s); color: var(--muted); white-space: normal; line-height: 1.4; }
|
||||
.sm-check { flex: none; width: 14px; display: inline-flex; color: var(--accent); }
|
||||
.sm-opt[aria-selected="true"] .sm-label { font-weight: 500; }
|
||||
|
||||
@@ -268,3 +268,32 @@ a.ac-local { cursor: pointer; }
|
||||
display: block; margin: 2px 0 6px; padding-left: 8px; border-left: 2px solid color-mix(in oklab, var(--fg) 30%, transparent);
|
||||
color: var(--muted); font-size: var(--chat-fs-s); max-height: 7.5em; overflow: hidden;
|
||||
}
|
||||
|
||||
/* 1.3 全部自动同意 (#727 review): the daemon's own approvals, one foldable row per run of tool calls, in the same flat
|
||||
one-line style as the tool rows (icon slot · text · right-edge meta; clip, never wrap). Only the shield is amber. */
|
||||
.apv { margin: 0 0 8px; min-width: 0; }
|
||||
.apv-head {
|
||||
display: flex; align-items: center; gap: 8px; width: 100%; min-height: 26px; padding: 0 6px; overflow: hidden; border-radius: var(--r-s);
|
||||
color: var(--muted); font-size: var(--chat-fs-s); text-align: left; white-space: nowrap;
|
||||
}
|
||||
.apv-head:hover, .apv.open > .apv-head { color: var(--fg); background: var(--surface-hover); }
|
||||
.apv-head .caret { flex: none; color: var(--meta); transition: transform var(--dur-1); }
|
||||
.apv-head .caret.open { transform: rotate(90deg); }
|
||||
.apv-ic { width: 14px; flex: none; display: inline-flex; justify-content: center; color: var(--auto-fg, var(--warn)); }
|
||||
.apv-n { flex: none; }
|
||||
.apv-peek { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--meta); font-family: var(--font-mono); font-size: var(--chat-code-fs); }
|
||||
.apv-peek::before { content: "·"; margin-right: 8px; font-family: var(--font-ui); }
|
||||
.apv-list { margin: 2px 0 0 13px; padding-left: 6px; border-left: 1px solid var(--line); }
|
||||
.apv-row {
|
||||
display: flex; align-items: center; gap: 8px; min-height: 26px; padding: 0 6px; min-width: 0; overflow: hidden; white-space: nowrap;
|
||||
border-radius: var(--r-s); color: var(--muted); font-size: var(--chat-fs-s);
|
||||
}
|
||||
.apv-row:hover { background: var(--surface-hover); color: var(--fg); }
|
||||
.apv-cmd, .apv-path, .apv-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.apv-cmd, .apv-path { font-family: var(--font-mono); font-size: var(--chat-code-fs); }
|
||||
.apv-meta { flex: none; margin-left: auto; color: var(--meta); font-size: var(--fs-xs); }
|
||||
/* 1.3 upgrade notice (#727 review 3): told once that 全部自动同意 now really applies to Cursor / OpenCode / dsh */
|
||||
.nt-auto {
|
||||
text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); line-height: 1.6; color: var(--text);
|
||||
}
|
||||
.nt-auto-h { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
|
||||
|
||||
@@ -8,11 +8,29 @@
|
||||
}
|
||||
.cp-card:focus-within { border-color: var(--cp-focus); box-shadow: 0 0 0 3px var(--cp-ring), 0 1px 2px rgb(0 0 0 / .04); }
|
||||
.cp-card.waiting { border-color: color-mix(in oklab, var(--warn) 45%, var(--bg)); }
|
||||
.cp-card.danger { border-color: color-mix(in oklab, var(--danger) 40%, var(--bg)); }
|
||||
.cp-danger {
|
||||
max-width: var(--col); margin: 0 auto 6px; display: flex; align-items: center; gap: 6px;
|
||||
color: var(--danger); font-size: var(--fs-s); padding: 0 2px;
|
||||
/* 1.3 全部自动同意 (#727 review 1): a persistent one-line strip above the card (Nolan: one slim line is enough) for as long as the conversation is in it, plus a
|
||||
warning-tinted card border and chip. The one exception to the grayscale accent: the semantic warning colour, darker in
|
||||
light mode so small text stays readable (≥4.5:1 on the page background), lighter in dark mode. */
|
||||
:root { --auto-fg: #b45309; --auto-bg: color-mix(in oklab, #f59e0b 10%, var(--bg)); --auto-line: color-mix(in oklab, #d97706 40%, var(--bg)); }
|
||||
:root[data-theme="dark"] { --auto-fg: #fbbf24; --auto-bg: color-mix(in oklab, #f59e0b 13%, var(--bg)); --auto-line: color-mix(in oklab, #f59e0b 42%, var(--bg)); }
|
||||
.cp-auto-on {
|
||||
max-width: var(--col); margin: 0 auto 4px; display: flex; align-items: center; gap: 6px; min-width: 0;
|
||||
height: 22px; padding: 0 4px; white-space: nowrap; overflow: hidden;
|
||||
color: var(--muted); font-size: var(--fs-s); line-height: 22px;
|
||||
}
|
||||
.cp-auto-ic { flex: none; display: inline-flex; color: var(--auto-fg); }
|
||||
.cp-auto-t { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; cursor: help; border-radius: var(--r-s); }
|
||||
.cp-auto-t:focus-visible { outline: 2px solid var(--auto-line); outline-offset: 1px; }
|
||||
.cp-auto-t b { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--auto-fg); font-weight: 600; }
|
||||
.cp-auto-on .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
|
||||
.cp-auto-back {
|
||||
flex: none; margin-left: auto; padding: 0 2px; border: 0; background: none; white-space: nowrap;
|
||||
color: var(--fg); font-size: var(--fs-s); text-decoration: underline; text-underline-offset: 2px;
|
||||
text-decoration-color: color-mix(in oklab, var(--fg) 35%, transparent); cursor: pointer;
|
||||
}
|
||||
.cp-auto-back:hover { text-decoration-color: currentColor; }
|
||||
.cp-card.auto-on { border-color: var(--auto-line); }
|
||||
.cp-card.auto-on:focus-within { border-color: var(--auto-fg); }
|
||||
.cp-hint { max-width: var(--col); margin: 6px auto 0; font-size: var(--fs-xs); color: var(--meta); text-align: center; }
|
||||
.att-note { padding: 6px 10px 0; color: var(--muted); font-size: var(--fs-s); }
|
||||
.cp-ta-wrap { position: relative; }
|
||||
@@ -82,6 +100,12 @@
|
||||
}
|
||||
.tasks-pill:hover { color: var(--fg); background: var(--surface-hover); }
|
||||
.tasks-pill svg { flex: none; color: var(--meta); }
|
||||
/* 1.3 全部自动同意: Cursor's shield idea, a filled chip with a shield-check, in the warning colour (#727 review 1) */
|
||||
.ipill.auto, .cp-bar .ipill.auto { color: var(--auto-fg); background: var(--auto-bg); border-color: var(--auto-line); font-weight: 600; }
|
||||
.ipill.auto:hover, .ipill.auto[aria-expanded="true"], .cp-bar .ipill.auto:hover, .cp-bar .ipill.auto[aria-expanded="true"] { background: color-mix(in oklab, var(--auto-fg) 16%, var(--bg)); }
|
||||
.ipill.auto svg { color: var(--auto-fg); }
|
||||
.mi.warn .sm-label { color: var(--auto-fg); }
|
||||
.ipill.static { cursor: default; }
|
||||
.mode-menu { max-width: 300px; }
|
||||
.cp-div { width: 1px; height: 14px; background: var(--line); margin: 0 4px; flex: none; }
|
||||
.cp-bar > .ibtn { flex: none; }
|
||||
|
||||
Reference in New Issue
Block a user