Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

New harnesses approve on their own by default

dee919496eaa84a
diff --git a/cli/src/backendSocket.spec.ts b/cli/src/backendSocket.spec.ts
index 20325ba78..b73b95db8 100644
--- a/cli/src/backendSocket.spec.ts
+++ b/cli/src/backendSocket.spec.ts
@@ -738,6 +738,37 @@ describe('BackendSocket outbound queue', () => {
await socket.stop()
})
+ it('creates with approvals bypassed unless the client turns that off', async () => {
+ const socket = new BackendSocket('token')
+ const frames: Array<Record<string, unknown>> = []
+ socket.registerLocalClient('local:bypass', {
+ sendFrame: (frame) => { frames.push(frame); return true }, sendBinary: () => true,
+ })
+ const pending = (agentId: string): RegisteredSession => ({
+ schemaVersion: 2, active: true, launch: { state: 'starting' },
+ agentId, sessionId: '', boundAt: null, engine: 'claude',
+ transcriptPath: null, projectDir: 'work', cwd: '/tmp/work',
+ runtimes: [{ backend: 'tmux', paneId: '%9' }], primaryRuntimeKey: 'tmux/%9', tmuxPane: '%9',
+ source: null, title: null, model: null, cliVersion: null, processIdentity: null,
+ registeredAt: 1, updatedAt: 1, lastHookAt: 1, lastTranscriptAt: 1,
+ })
+ const create = vi.fn(async (input: { bypassPermission: boolean }) => ({ ok: true as const, session: pending(`b-${create.mock.calls.length}`) }))
+ socket.onCreateAgent = create
+ const ask = (requestId: string, extra: Record<string, unknown>) => socket.handleLocalFrame('local:bypass', {
+ type: 'agent_create', payload: { requestId, engine: 'claude', cwd: '/tmp/work', ...extra },
+ })
+ try {
+ ask('unsaid', {})
+ ask('on', { bypassPermission: true })
+ ask('off', { bypassPermission: false })
+ await vi.waitFor(() => expect(create).toHaveBeenCalledTimes(3))
+ expect(create.mock.calls.map(([input]) => input.bypassPermission)).toEqual([true, true, false])
+ } finally {
+ await socket.unregisterLocalClient('local:bypass')
+ await socket.stop()
+ }
+ })
+
it('recovers a delayed creation on the same connection without starting another agent', async () => {
const socket = new BackendSocket('token')
const frames: Array<Record<string, unknown>> = []
diff --git a/cli/src/backendSocket.ts b/cli/src/backendSocket.ts
index f76ba4b8b..1f0b21171 100644
--- a/cli/src/backendSocket.ts
+++ b/cli/src/backendSocket.ts
@@ -1826,7 +1826,8 @@ export class BackendSocket {
const input = {
engine,
cwd: typeof cwd === 'string' ? cwd : '',
- bypassPermission: payload.bypassPermission === true,
+ // On unless a client says otherwise: a harness works without stopping to ask for each command.
+ bypassPermission: payload.bypassPermission !== false,
grid: grid.state === 'ok' ? grid.override : null,
codexHome,
dsh,
diff --git a/desktop/lib/state/app_state.dart b/desktop/lib/state/app_state.dart
index 2173c16c0..1269e0474 100644
--- a/desktop/lib/state/app_state.dart
+++ b/desktop/lib/state/app_state.dart
@@ -4724,7 +4724,7 @@ class AppNotifier extends ChangeNotifier {
required String engine,
required String folder,
ProjectFolderRequest? projectFolder,
- bool bypassPermission = false,
+ bool bypassPermission = true,
String? codexHome,
String? dsh,
String? prompt,
diff --git a/desktop/lib/widgets/new_agent_dialog.dart b/desktop/lib/widgets/new_agent_dialog.dart
index 6347be08e..6eaca67bf 100644
--- a/desktop/lib/widgets/new_agent_dialog.dart
+++ b/desktop/lib/widgets/new_agent_dialog.dart
@@ -139,7 +139,9 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
late String? _folder = widget.initialFolder;
LocalCodexProfile? _codexProfile;
bool _codexProfilesBusy = true;
- bool _bypassPermission = false;
+ /// On unless the person turns it off: a new harness works without stopping to ask for each
+ /// command — Claude Code's manual mode was what every harness opened in before.
+ bool _bypassPermission = true;
/// Whether the fold is open. Closed on every open of the dialog, deliberately:
/// it is shut for the case it exists to serve, and a drawer that remembers
@@ -942,12 +944,9 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
_codexProfile = null;
_codexProfilesBusy = true;
}
+ // The choice is kept across agents; one with no flag simply shows none (and sends
+ // false, see _submit), so coming back to Claude Code finds it as it was left.
_error = null;
- if (!kEngineBypassPermissionFlag.containsKey(
- _baseEngine(value),
- )) {
- _bypassPermission = false;
- }
});
if (isHarnessId(value)) unawaited(_probeHarnesses());
},
diff --git a/desktop/test/agent_events_test.dart b/desktop/test/agent_events_test.dart
index 752e07a49..a8d34bd4e 100644
--- a/desktop/test/agent_events_test.dart
+++ b/desktop/test/agent_events_test.dart
@@ -184,9 +184,10 @@ void main() {
testWidgets('carries the engine and the bypass flag', (tester) async {
await create(tester);
+ // Auto-approve is on unless the person turns it off.
expect(tracked.paramsOf('agent_created'), {
'engine': 'claude',
- 'bypass_permission': false,
+ 'bypass_permission': true,
});
});
diff --git a/desktop/test/first_workspace_test.dart b/desktop/test/first_workspace_test.dart
index 743488b23..b528cfb9b 100644
--- a/desktop/test/first_workspace_test.dart
+++ b/desktop/test/first_workspace_test.dart
@@ -730,7 +730,7 @@ void main() {
machine: 'm',
engine: 'codex',
folder: '/work/my-project',
- bypass: false,
+ bypass: true,
),
]);
expect(find.byType(TerminalView), findsOneWidget);
diff --git a/desktop/test/new_agent_dsh_test.dart b/desktop/test/new_agent_dsh_test.dart
index 0b9071cfd..2845dd00f 100644
--- a/desktop/test/new_agent_dsh_test.dart
+++ b/desktop/test/new_agent_dsh_test.dart
@@ -252,7 +252,7 @@ void main() {
'engine': 'claude',
'dsh': 'autonomous/autonomous-circuit',
'folder': '',
- 'bypass': false,
+ 'bypass': true,
});
expect(tester.takeException(), isNull);
},
diff --git a/desktop/test/new_agent_engine_check_test.dart b/desktop/test/new_agent_engine_check_test.dart
index 74dd1187a..99fdc3046 100644
--- a/desktop/test/new_agent_engine_check_test.dart
+++ b/desktop/test/new_agent_engine_check_test.dart
@@ -200,7 +200,8 @@ void main() {
'machine': 'machine-1',
'engine': 'codex',
'folder': pickedFolder,
- 'bypass': true,
+ // On by default; the click above turned it off, and the retry kept that choice.
+ 'bypass': false,
});
expect(tester.takeException(), isNull);
});