@pulsehub/runner 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsehub/runner",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Local, credential-safe Pulse Runner",
5
5
  "repository": {
6
6
  "type": "git",
package/src/process.js CHANGED
@@ -83,10 +83,15 @@ async function mcpConfig(dir, credential, endpoint) {
83
83
  }
84
84
 
85
85
  export function providerInvocation(kind, worktree, additionalDirs, config, mcp, prompt, mode = 'task') {
86
- if (kind === 'codex') return {
87
- executable: resolveExecutable('codex'),
88
- args: ['exec', '--ephemeral', ...agentPermissionArgs(kind, mode), '--cd', worktree, ...additionalDirs, '-c', `mcp_servers.pulse.url=${JSON.stringify(mcpEndpoint(config.endpoint))}`, '-c', 'mcp_servers.pulse.env_http_headers={Authorization="PULSE_RUNNER_MCP_CREDENTIAL"}', prompt],
89
- };
86
+ if (kind === 'codex') {
87
+ const reviewArgs = mode === 'review'
88
+ ? ['--skip-git-repo-check', '-c', 'mcp_servers.pulse.default_tools_approval_mode="approve"']
89
+ : [];
90
+ return {
91
+ executable: resolveExecutable('codex'),
92
+ args: ['exec', '--ephemeral', ...agentPermissionArgs(kind, mode), ...reviewArgs, '--cd', worktree, ...additionalDirs, '-c', `mcp_servers.pulse.url=${JSON.stringify(mcpEndpoint(config.endpoint))}`, '-c', 'mcp_servers.pulse.env_http_headers={Authorization="PULSE_RUNNER_MCP_CREDENTIAL"}', prompt],
93
+ };
94
+ }
90
95
  if (kind === 'claude') return {
91
96
  executable: resolveExecutable('claude'),
92
97
  args: ['--print', '--no-session-persistence', ...agentPermissionArgs(kind, mode), ...additionalDirs, '--strict-mcp-config', '--mcp-config', mcp, prompt],
@@ -1,12 +1,25 @@
1
1
  import test from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
- import { agentPermissionArgs, mcpEndpoint } from '../src/process.js';
3
+ import { agentPermissionArgs, mcpEndpoint, providerInvocation } from '../src/process.js';
4
4
 
5
5
  test('QA Runner sessions use read-only filesystem permissions', () => {
6
6
  assert.deepEqual(agentPermissionArgs('codex', 'review'), ['--sandbox', 'read-only']);
7
7
  assert.deepEqual(agentPermissionArgs('claude', 'review'), ['--permission-mode', 'plan']);
8
8
  });
9
9
 
10
+ test('Codex QA starts outside the snapshots without trusting the repository or widening sandbox access', () => {
11
+ const invocation = providerInvocation('codex', '/tmp/pulse-review', ['/tmp/snapshot'], { endpoint: 'https://example.cloudfunctions.net/pulseRunnerPoll' }, '/tmp/pulse-mcp.json', 'Review', 'review');
12
+ assert(invocation.args.includes('--skip-git-repo-check'));
13
+ assert.deepEqual(agentPermissionArgs('codex', 'review'), ['--sandbox', 'read-only']);
14
+ assert(invocation.args.includes('mcp_servers.pulse.default_tools_approval_mode="approve"'));
15
+ assert(!invocation.args.includes('--ask-for-approval'));
16
+ });
17
+
18
+ test('Codex development jobs do not auto-approve MCP tools', () => {
19
+ const invocation = providerInvocation('codex', '/tmp/pulse-task', [], { endpoint: 'https://example.cloudfunctions.net' }, '/tmp/pulse-mcp.json', 'Task', 'task');
20
+ assert(!invocation.args.some((arg) => arg.includes('default_tools_approval_mode')));
21
+ });
22
+
10
23
  test('development jobs retain their configured write permissions', () => {
11
24
  assert.deepEqual(agentPermissionArgs('codex', 'task'), ['--approve-for-me']);
12
25
  assert.deepEqual(agentPermissionArgs('claude', 'task'), ['--permission-mode', 'bypassPermissions', '--dangerously-skip-permissions']);