Skip to content

Commit be40935

Browse files
committed
test: select workspace mode for worker wire permission proof
Worktree creation intentionally inherits configured policy. Select the existing workspace mode in the fixture, verify persisted mode and absent markers, and retain the complete denial, reconciliation, load and restart assertions. Preserve current main Gateway cleanup.
1 parent ddf5b5a commit be40935

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎test/e2e/qa-lab/runtime/node-worker-launch-wire.e2e.test.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,16 @@ describe("node worker launch wire", () => {
151151
key: SESSION_KEY,
152152
agentId: "qa",
153153
worktree: true,
154+
// Worktree creation alone inherits tool policy; this probe needs explicit containment.
155+
permissionMode: "workspace",
154156
worktreeName: "node-worker-launch-wire",
155157
worktreeBaseRef: "main",
156158
cwd: published.source,
157159
});
158160
const created = (await gateway.call("sessions.describe", { key: SESSION_KEY })) as {
159-
session?: { execCwd?: string; spawnedCwd?: string };
161+
session?: { execCwd?: string; spawnedCwd?: string; permissionMode?: string };
160162
};
163+
expect(created.session?.permissionMode).toBe("workspace");
161164
const localWorkspaceDir = created.session?.execCwd ?? created.session?.spawnedCwd;
162165
expect(localWorkspaceDir).toBeTruthy();
163166
await fs.writeFile(
@@ -261,6 +264,15 @@ describe("node worker launch wire", () => {
261264
"device result\n",
262265
);
263266

267+
for (const marker of [
268+
"worker-permission-in-root.txt",
269+
"../worker-permission-outside.txt",
270+
"worker-exec-escaped.txt",
271+
]) {
272+
await expect(fs.access(path.resolve(remoteWorkspaceDir, marker))).rejects.toMatchObject({
273+
code: "ENOENT",
274+
});
275+
}
264276
const permissionRunId = `node-worker-permission-${Date.now()}`;
265277
await expect(
266278
operator.request<{ runId?: string; status?: string }>("chat.send", {

0 commit comments

Comments
 (0)