feat(omp): add write approval mode (#2228)
Expose OMP write approval mode in the provider manifest and launch configuration.
This commit is contained in:
@@ -151,6 +151,13 @@ export const OMP_MODES: AgentProviderModeDefinition[] = [
|
|||||||
colorTier: "dangerous",
|
colorTier: "dangerous",
|
||||||
isUnattended: true,
|
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",
|
id: "ask",
|
||||||
label: "Always Ask",
|
label: "Always Ask",
|
||||||
|
|||||||
@@ -74,6 +74,18 @@ describe("OMP agent client and session", () => {
|
|||||||
expect(omp.launchConfiguration().argv).toEqual(expect.arrayContaining(["--thinking", "max"]));
|
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 () => {
|
test("streams a prompt through completion", async () => {
|
||||||
const omp = new OmpHarness();
|
const omp = new OmpHarness();
|
||||||
await omp.start();
|
await omp.start();
|
||||||
@@ -282,6 +294,7 @@ describe("OMP agent client and session", () => {
|
|||||||
|
|
||||||
await expect(omp.availableModes()).resolves.toEqual([
|
await expect(omp.availableModes()).resolves.toEqual([
|
||||||
expect.objectContaining({ id: "full" }),
|
expect.objectContaining({ id: "full" }),
|
||||||
|
expect.objectContaining({ id: "write" }),
|
||||||
expect.objectContaining({ id: "ask" }),
|
expect.objectContaining({ id: "ask" }),
|
||||||
]);
|
]);
|
||||||
await expect(omp.commands()).resolves.toEqual(
|
await expect(omp.commands()).resolves.toEqual(
|
||||||
|
|||||||
@@ -39,6 +39,11 @@ export function resolveOmpLaunchMode(
|
|||||||
switch (modeId ?? DEFAULT_OMP_MODE_ID) {
|
switch (modeId ?? DEFAULT_OMP_MODE_ID) {
|
||||||
case "full":
|
case "full":
|
||||||
return { modeId: "full", extraArgs: ["--approval-mode", "yolo", ...modelRoleArgs] };
|
return { modeId: "full", extraArgs: ["--approval-mode", "yolo", ...modelRoleArgs] };
|
||||||
|
case "write":
|
||||||
|
return {
|
||||||
|
modeId: "write",
|
||||||
|
extraArgs: ["--approval-mode", "write", ...modelRoleArgs],
|
||||||
|
};
|
||||||
case "ask":
|
case "ask":
|
||||||
return {
|
return {
|
||||||
modeId: "ask",
|
modeId: "ask",
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ export const agentConfigs = {
|
|||||||
thinkingOptionId: "medium",
|
thinkingOptionId: "medium",
|
||||||
modes: {
|
modes: {
|
||||||
full: "full", // launches omp with yolo approval mode
|
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
|
ask: "ask", // launches omp with always-ask approval mode
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user