feat(omp): add write approval mode (#2228)

Expose OMP write approval mode in the provider manifest and launch configuration.
This commit is contained in:
Slava Goltser
2026-07-22 16:09:45 -04:00
committed by GitHub
parent 894fa8516e
commit 30b871e8d2
4 changed files with 26 additions and 0 deletions

View File

@@ -151,6 +151,13 @@ export const OMP_MODES: AgentProviderModeDefinition[] = [
colorTier: "dangerous",
isUnattended: true,
},
{
id: "write",
label: "Write Approval",
description: "Launches OMP with write approval mode — reads are free, writes require approval.",
icon: "ShieldAlert",
colorTier: "moderate",
},
{
id: "ask",
label: "Always Ask",

View File

@@ -74,6 +74,18 @@ describe("OMP agent client and session", () => {
expect(omp.launchConfiguration().argv).toEqual(expect.arrayContaining(["--thinking", "max"]));
});
test("launches with write approval mode", async () => {
const omp = new OmpHarness();
await omp.start({ modeId: "write" });
expect(omp.launchConfiguration()).toEqual({
cwd: "/tmp/paseo-omp-agent-test",
protocolMode: "rpc-ui",
modeId: "write",
argv: ["omp", "--mode", "rpc-ui", "--approval-mode", "write", "--thinking", "medium"],
});
});
test("streams a prompt through completion", async () => {
const omp = new OmpHarness();
await omp.start();
@@ -282,6 +294,7 @@ describe("OMP agent client and session", () => {
await expect(omp.availableModes()).resolves.toEqual([
expect.objectContaining({ id: "full" }),
expect.objectContaining({ id: "write" }),
expect.objectContaining({ id: "ask" }),
]);
await expect(omp.commands()).resolves.toEqual(

View File

@@ -39,6 +39,11 @@ export function resolveOmpLaunchMode(
switch (modeId ?? DEFAULT_OMP_MODE_ID) {
case "full":
return { modeId: "full", extraArgs: ["--approval-mode", "yolo", ...modelRoleArgs] };
case "write":
return {
modeId: "write",
extraArgs: ["--approval-mode", "write", ...modelRoleArgs],
};
case "ask":
return {
modeId: "ask",

View File

@@ -62,6 +62,7 @@ export const agentConfigs = {
thinkingOptionId: "medium",
modes: {
full: "full", // launches omp with yolo approval mode
write: "write", // launches omp with write approval mode
ask: "ask", // launches omp with always-ask approval mode
},
},