@pulsehub/runner 0.1.8 → 0.1.10
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 +1 -1
- package/src/process.js +2 -2
- package/test/process.test.js +9 -2
package/package.json
CHANGED
package/src/process.js
CHANGED
|
@@ -57,7 +57,7 @@ export async function executable(name) { try { return (await command(resolveExec
|
|
|
57
57
|
|
|
58
58
|
export function agentPermissionArgs(kind, mode) {
|
|
59
59
|
if (mode === 'review') {
|
|
60
|
-
if (kind === 'codex') return ['--sandbox', 'read-only'
|
|
60
|
+
if (kind === 'codex') return ['--sandbox', 'read-only'];
|
|
61
61
|
if (kind === 'claude') return ['--permission-mode', 'plan'];
|
|
62
62
|
}
|
|
63
63
|
if (kind === 'codex') return ['--approve-for-me'];
|
|
@@ -85,7 +85,7 @@ async function mcpConfig(dir, credential, endpoint) {
|
|
|
85
85
|
export function providerInvocation(kind, worktree, additionalDirs, config, mcp, prompt, mode = 'task') {
|
|
86
86
|
if (kind === 'codex') return {
|
|
87
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],
|
|
88
|
+
args: ['exec', '--ephemeral', ...agentPermissionArgs(kind, mode), ...(mode === 'review' ? ['--skip-git-repo-check'] : []), '--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
89
|
};
|
|
90
90
|
if (kind === 'claude') return {
|
|
91
91
|
executable: resolveExecutable('claude'),
|
package/test/process.test.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
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
|
-
assert.deepEqual(agentPermissionArgs('codex', 'review'), ['--sandbox', 'read-only'
|
|
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('--ask-for-approval'));
|
|
15
|
+
});
|
|
16
|
+
|
|
10
17
|
test('development jobs retain their configured write permissions', () => {
|
|
11
18
|
assert.deepEqual(agentPermissionArgs('codex', 'task'), ['--approve-for-me']);
|
|
12
19
|
assert.deepEqual(agentPermissionArgs('claude', 'task'), ['--permission-mode', 'bypassPermissions', '--dangerously-skip-permissions']);
|