mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
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",
|
||||
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",
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user