Skip to content

Commit 8d9696c

Browse files
committed
Update fix plugin openclaw
1 parent 9ac6141 commit 8d9696c

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

integrations/openclaw/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ omni stats --today
6161

6262
OMNI is built with a **Privacy-First** design intent. This plugin acts as a secure proxy to facilitate safe execution:
6363

64-
- **Node-Level Sanitization**: This plugin explicitly strips ~25 dangerous environment variables (like `LD_PRELOAD`, `NODE_OPTIONS`, `BASH_ENV`) at the process level before execution.
64+
- **Node-Level Sanitization**: This plugin explicitly strips ~25 dangerous environment variables (like `LD_PRELOAD`, `NODE_OPTIONS`, `BASH_ENV`) at the process level before execution. Other environment variables are passed through to the command.
6565
- **Local-Only Architecture**: The OMNI engine is designed for local processing. No terminal output is ever sent to external cloud services by the engine.
6666
- **Local Persistence**: Usage statistics are stored strictly in a local SQLite database at `~/.omni/omni.db`.
6767
- **Trust & Verification**: As OMNI is a tool for developers, we encourage you to audit the full source code and security policies at the [OMNI GitHub Repository](https://github.com/fajarhide/omni/blob/main/SECURITY.md) to verify these claims for yourself.
6868

69+
> ⚠️ **Note**: This plugin passes through most environment variables to the invoked command. If you run untrusted commands, consider doing so in a restricted environment (container, CI runner, or limited account) with minimal secrets in the environment.
70+
6971
## Benefits
7072
- **Cheaper Tasks**: Massive savings on API bills for long-running autonomous tasks.
7173
- **Higher Accuracy**: Agents focus on the real errors instead of being distracted by 10,000 lines of build logs.

integrations/openclaw/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@ const OmniCmdParams = Type.Object({
3636
command: Type.String({ description: "The terminal command to execute (e.g. 'npm install' or 'git diff')" })
3737
});
3838

39-
function createOmniCmdTool(): AnyAgentTool {
39+
type PluginConfig = { omniPath?: string };
40+
41+
function createOmniCmdTool(api: OpenClawPluginApi): AnyAgentTool {
4042
return {
4143
name: "omni_cmd",
4244
label: "OMNI Command",
4345
description: "Execute terminal tools (git, npm, cargo, docker, etc.) through OMNI's local semantic distillation engine to save 80-90% of token costs.",
4446
parameters: OmniCmdParams,
4547
async execute(_toolCallId: string, params: Record<string, unknown>) {
4648
const command = params.command as string;
47-
const omniPath = "omni";
49+
const config = (api.pluginConfig ?? {}) as PluginConfig;
50+
const omniPath = config.omniPath || "omni";
4851

4952
try {
5053
const { stdout, stderr, code } = await runOmni(omniPath, ["exec", "--", command]);
@@ -81,6 +84,6 @@ export default definePluginEntry({
8184
if (api.registrationMode !== "full") {
8285
return;
8386
}
84-
api.registerTool(createOmniCmdTool() as OpenClawPluginToolFactory, { optional: true });
87+
api.registerTool(createOmniCmdTool(api) as OpenClawPluginToolFactory, { optional: true });
8588
}
8689
});

0 commit comments

Comments
 (0)