diff --git a/.postal/config.toml b/.postal/config.toml
index e852a47..b480109 100644
--- a/.postal/config.toml
+++ b/.postal/config.toml
@@ -17,7 +17,7 @@ debug = false
# command='python3 ./scripts/test_tool.py'
[model]
-name = "baidu/ernie-5.5-flash-preview:free"
+name = "deepseek/deepseek-v4.1-flash-1017"
temperature = 1.0
context_window = 256000
diff --git a/docs/cli.md b/docs/cli.md
index d5f479c..59acf2f 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -69,7 +69,7 @@ These go before the command, or on their own with the bare `postal`.
`postal` opens a full-screen Ink interface with a centered cloud logo and prompt bar. The bar moves below the conversation after the first message. Its input grows to five visible text rows, then scrolls. Tools show compact previews. Reasoning shows the latest four wrapped rows while running; expand it to read the full live text. Agent activity opens in an overlay.
-The prompt bar's `+` menu adds workspace text/code file references, requests web search for the next prompt, or opens slash commands. File and web chips can be removed before sending. The model picker accepts a model ID and lists models used during the session; the effort picker uses the supported reasoning levels. The arrow sends the prompt and becomes a stop button while Postal is working. Use `Tab` to reach these controls or click them. Settings changes preserve the current draft.
+The prompt bar's model picker accepts a model ID and lists models used during the session; the effort picker uses the supported reasoning levels; the approval picker switches between the six policies. Slash commands remain available with `/` or `Ctrl+P`. The arrow sends the prompt and becomes a stop button while Postal is working. Use `Tab` to reach these controls or click them. Settings changes preserve the current draft.
| Key | Action |
| --- | --- |
diff --git a/tests/test_ui_bridge.py b/tests/test_ui_bridge.py
index 803d4b4..85cda2c 100644
--- a/tests/test_ui_bridge.py
+++ b/tests/test_ui_bridge.py
@@ -11,7 +11,7 @@
from client.llm_client import LLMClient
from client.response import StreamEvent, StreamEventType, TextDelta, ToolCall
-from config.config import Config
+from config.config import ApprovalPolicy, Config
from ui.bridge import BridgeSession
@@ -68,6 +68,16 @@ async def test_streaming_settings_and_clear_stay_in_python(self):
self.assertEqual(session.agent.session.turns, 0)
self.assertIn({"type": "transcript", "messages": []}, messages)
+ async def test_approval_mode_changes_the_live_policy(self):
+ async with self.session() as (session, messages):
+ with self.assertRaises(ValueError):
+ await session.dispatch("approval", {"mode": "sideways"})
+ self.assertEqual(session.config.approval, ApprovalPolicy.ON_REQUEST)
+ await session.dispatch("approval", {"mode": "yolo"})
+ self.assertEqual(session.config.approval, ApprovalPolicy.YOLO)
+ self.assertEqual(session.agent.session.approval_manager.approval_policy, ApprovalPolicy.YOLO)
+ self.assertEqual(session.settings()["approval"], "yolo")
+
async def test_approval_is_explicit_and_correlated(self):
for approve in (True, False):
with self.subTest(approve=approve):
diff --git a/ui/bridge.py b/ui/bridge.py
index eaec83b..82da73d 100644
--- a/ui/bridge.py
+++ b/ui/bridge.py
@@ -15,7 +15,7 @@
from rich.console import Console
from agent.agent import Agent
-from config.config import Config
+from config.config import ApprovalPolicy, Config
from tools.base import ToolConfirmation
from ui.components.logo import POSTAL_BLOB, POSTAL_VERSION
from ui.repl.commands import SlashCommands
@@ -190,6 +190,12 @@ async def dispatch(self, method: str, params: dict) -> dict:
effort = "on"
await self.command(f"/thinking {effort}", quiet=True)
return self.settings()
+ if method == "approval":
+ mode = params.get("mode")
+ if mode not in {policy.value for policy in ApprovalPolicy}:
+ raise ValueError("Unsupported approval mode.")
+ await self.command(f"/approval {mode}", quiet=True)
+ return self.settings()
if method == "submit":
text = params.get("text", "")
if not isinstance(text, str) or not text.strip():
diff --git a/ui/components/__init__.py b/ui/components/__init__.py
index 2802af3..01e1298 100644
--- a/ui/components/__init__.py
+++ b/ui/components/__init__.py
@@ -13,7 +13,7 @@
from ui.components.memory import render_memory
from ui.components.plan import render_plan
from ui.components.permission_prompt import permission_choices, permission_prompt
-from ui.components.shimmer import shimmer, shimmer_tool_label, shimmers
+from ui.components.shimmer import shimmer, shimmer_tool_label
from ui.components.spinner import SPINNER_INTERVAL, Spinner
from ui.components.status_bar import status_bar
from ui.components.tool_progress import tool_progress_panel
@@ -66,7 +66,6 @@
'render_transcript',
'shimmer',
'shimmer_tool_label',
- 'shimmers',
'status_bar',
'permission_choices',
'permission_prompt',
diff --git a/ui/components/shimmer.py b/ui/components/shimmer.py
index e6fb004..0639fed 100644
--- a/ui/components/shimmer.py
+++ b/ui/components/shimmer.py
@@ -9,12 +9,6 @@
SHIMMER_SPEED = 0.4
SHIMMER_GAP = 10
-SHIMMERING_KINDS = frozenset({"subagent"})
-
-
-def shimmers(tool_kind: str | None) -> bool:
- return (tool_kind or "") in SHIMMERING_KINDS
-
def shimmer(label: str, frame: int) -> Text:
head = (frame * SHIMMER_SPEED) % (len(label) + SHIMMER_GAP)
diff --git a/ui/components/tool_progress.py b/ui/components/tool_progress.py
index a383a3b..070060f 100644
--- a/ui/components/tool_progress.py
+++ b/ui/components/tool_progress.py
@@ -3,7 +3,7 @@
from rich.panel import Panel
from rich.text import Text
-from ui.components.shimmer import shimmer_tool_label, shimmers
+from ui.components.shimmer import shimmer_tool_label
def tool_progress_panel(
@@ -19,10 +19,7 @@ def tool_progress_panel(
"""Render the compact live panel shown while a tool is running."""
line = Text.assemble((f"{spinner} ", "tool"))
- if shimmers(tool_kind):
- line.append_text(shimmer_tool_label(name, frame))
- else:
- line.append(name, style="highlight")
+ line.append_text(shimmer_tool_label(name, frame))
if headline:
line.append(" ")
line.append(headline, style="subtitle")
diff --git a/ui/terminal/src/App.tsx b/ui/terminal/src/App.tsx
index 358536f..70d0145 100644
--- a/ui/terminal/src/App.tsx
+++ b/ui/terminal/src/App.tsx
@@ -16,7 +16,7 @@ import {TOOL_COMPACT_DELAY, type DetailKey} from './toolPresentation.js';
import {expandTools, toggleDetail} from './toolNavigation.js';
import {useConversationScroll} from './scroll.js';
-type MenuKind = 'context' | 'model' | 'effort' | 'file' | 'commands' | 'agents';
+type MenuKind = 'model' | 'effort' | 'approval' | 'file' | 'commands' | 'agents';
interface OpenMenu {kind: MenuKind; input: Draft; index: number; error?: string; scroll: number}
export function layout(columns: number, rows: number, home: boolean, draft: Draft, sources: boolean) {
const width = Math.max(26, Math.min(home ? 70 : 96, columns - 4));
@@ -167,21 +167,23 @@ export function PostalApp({backend, size}: {backend: Transport; size?: {columns:
};
const action = (target: Focus) => {
setFocus(target);
- if (target === 'send') void submit();
- else if (target !== 'input' && state.ready && !state.busy && !sending) openMenu(target === 'add' ? 'context' : target);
+ if (target !== 'input' && state.ready && !state.busy && !sending) openMenu(target);
};
const agents = Object.values(state.agents);
const choices: Choice[] = useMemo(() => {
if (!menu) return [];
const query = menu.input.text.toLowerCase();
switch (menu.kind) {
- case 'context': return [
- ...(state.capabilities.read ? [{key: 'file', label: 'Add a file', detail: 'Text and code from this workspace'}] : []),
- ...(state.capabilities.search ? [{key: 'web', label: web ? 'Remove web search' : 'Web search', detail: 'Use live sources for this prompt'}] : []),
- {key: 'commands', label: 'Commands', detail: 'Browse slash commands'},
- ];
case 'effort': return ['auto', 'minimal', 'low', 'medium', 'high', 'none'].map(value => ({key: value,
label: value === 'none' ? 'Off' : value[0]!.toUpperCase() + value.slice(1), detail: value === 'auto' ? 'Let the model decide' : ''}));
+ case 'approval': return [
+ {key: 'on_request', label: 'Ask', detail: 'Confirm every mutating tool'},
+ {key: 'on_fail', label: 'On fail', detail: 'Run freely, ask only after a failure'},
+ {key: 'auto', label: 'Auto', detail: 'Run everything except dangerous commands'},
+ {key: 'auto_edit', label: 'Auto-edit', detail: 'Edit freely, confirm bash commands'},
+ {key: 'never', label: 'Read-only', detail: 'Reject anything that is not known safe'},
+ {key: 'yolo', label: 'Yolo', detail: 'Approve everything, including dangerous commands'},
+ ].filter(choice => choice.label.toLowerCase().startsWith(query));
case 'model': {
const values = [...new Set([menu.input.text.trim(), ...state.recentModels.toReversed()])].filter(Boolean);
return values.filter(value => value.toLowerCase().includes(query)).map(value => ({key: value, label: value,
@@ -191,21 +193,20 @@ export function PostalApp({backend, size}: {backend: Transport; size?: {columns:
case 'agents': return agents.map(agent => ({key: agent.agent_id, label: `${' '.repeat(agent.depth)}${agent.name} · ${agent.status}`}));
default: return [];
}
- }, [menu, state.capabilities, state.commands, state.recentModels, state.settings.model, state.agents, web]);
+ }, [menu, state.commands, state.recentModels, state.settings.model, state.agents]);
const selected = Math.max(0, Math.min(menu?.index ?? 0, choices.length - 1));
const closeMenu = () => { setMenu(undefined); setFocus('input'); };
const choose = async (choice?: Choice) => {
if (!menu || choice?.disabled) return;
try {
- if (menu.kind === 'context') {
- if (choice?.key === 'web') { setWeb(current => !current); closeMenu(); }
- else if (choice) openMenu(choice.key as MenuKind);
- } else if (menu.kind === 'commands' && choice) {
+ if (menu.kind === 'commands' && choice) {
const text = `/${choice.key} `; setDraft({text, cursor: text.length}); closeMenu();
} else if (menu.kind === 'model' && choice) {
await backend.request('model', {model: choice.key}); closeMenu();
} else if (menu.kind === 'effort' && choice) {
await backend.request('effort', {effort: choice.key}); closeMenu();
+ } else if (menu.kind === 'approval' && choice) {
+ await backend.request('approval', {mode: choice.key}); closeMenu();
} else if (menu.kind === 'file') {
const result = await backend.request<{path: string}>('file', {path: menu.input.text});
setFiles(current => [...new Set([...current, result.path])]); closeMenu();
@@ -263,9 +264,9 @@ export function PostalApp({backend, size}: {backend: Transport; size?: {columns:
setHistoryIndex(next);
const text = history[next]; setDraft(text === undefined ? savedDraft.current : {text, cursor: text.length}); return;
}
- if (key.tab) { setFocus(focusOrder[(focusOrder.indexOf(focus) + (key.shift ? 4 : 1)) % focusOrder.length]!); return; }
+ if (key.tab) { setFocus(focusOrder[(focusOrder.indexOf(focus) + (key.shift ? focusOrder.length - 1 : 1)) % focusOrder.length]!); return; }
if ((key.return && (key.shift || key.meta)) || (key.ctrl && input === 'j') || input === '\n') { setDraft(current => insert(current, '\n')); setFocus('input'); return; }
- if (key.return) { if (focus === 'input' || focus === 'send') void submit(); else action(focus); return; }
+ if (key.return) { if (focus === 'input') void submit(); else action(focus); return; }
if (focus === 'input') {
if (input === '/' && !draft.text) { openMenu('commands'); return; }
setDraft(current => edit(current, input, key, dimensions.width - 6));
@@ -294,7 +295,7 @@ export function PostalApp({backend, size}: {backend: Transport; size?: {columns: