Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

test: the policy token stays for the new engine's plugin

ogsamratfe56be089fed
diff --git a/apps/server/src/opencode-plugins/managed-policy.test.ts b/apps/server/src/opencode-plugins/managed-policy.test.ts
index f4902694..3327e2b6 100644
--- a/apps/server/src/opencode-plugins/managed-policy.test.ts
+++ b/apps/server/src/opencode-plugins/managed-policy.test.ts
@@ -321,8 +321,8 @@ describe("managed-policy engine plugin: git workflows", () => {
shell: { hook: async (name, callback) => { hooks[`shell.${name}`] = callback as never; } },
session: { hook: async (name, callback) => { hooks[`session.${name}`] = callback as never; } },
});
- // Its shells copy process.env with no hook to empty a variable: the policy token is held by the plugin instead.
- expect(process.env.OMNIRUSH_POLICY_TOKEN).toBeUndefined();
+ // The 2.x engine sets the plugin up again per folder: the token stays readable (shells get it blanked by omnirush-session-next).
+ expect(process.env.OMNIRUSH_POLICY_TOKEN).toBe("policy-token");
const input: Record<string, unknown> = { command: "git commit -m x && rm -rf build" };
await hooks["tool.execute.before"]({ tool: "bash", input, callID: "call_8" } as never);
expect(input.command).toBe(`git commit -m x && ${DESTRUCTIVE_MARKER} rm -rf build`);