can1357/oh-my-pi · error · Error
Legacy WriteToolOptions.operations is not supported: OMP's b
Error message
Legacy WriteToolOptions.operations is not supported: OMP's built-in write tool writes the local filesystem natively and exposes no pluggable operations seam. Register a custom write tool via defineTool() instead of passing operations to createWriteTool()/createWriteToolDefinition().
What it means
The legacy write tool shim rejects the `operations` option from pi's WriteToolOptions: OMP's built-in write tool writes the local filesystem directly and exposes no pluggable operations adapter. Passing operations throws at tool-definition time.
Source
Thrown at packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts:731
if (options?.operations) {
throw new Error(
"Legacy EditToolOptions.operations is not supported: OMP's built-in edit tool writes the local " +
"filesystem natively and exposes no pluggable operations seam. Register a custom edit tool via " +
"defineTool() instead of passing operations to createEditTool()/createEditToolDefinition().",
);
}
return legacyBuiltinTool(cwd, "edit");
}
/** Create the legacy edit tool. */
export function createEditTool(cwd: string, options?: EditToolOptions): ToolDefinition {
return createEditToolDefinition(cwd, options);
}
/** Create the legacy write tool definition. */
export function createWriteToolDefinition(cwd: string, options?: WriteToolOptions): ToolDefinition {
if (options?.operations) {
throw new Error(
"Legacy WriteToolOptions.operations is not supported: OMP's built-in write tool writes the local " +
"filesystem natively and exposes no pluggable operations seam. Register a custom write tool via " +
"defineTool() instead of passing operations to createWriteTool()/createWriteToolDefinition().",
);
}
return legacyBuiltinTool(cwd, "write");
}
/** Create the legacy write tool. */
export function createWriteTool(cwd: string, options?: WriteToolOptions): ToolDefinition {
return createWriteToolDefinition(cwd, options);
}
/** Create legacy read, bash, edit, and write tools. */
export function createCodingTools(cwd: string): ToolDefinition[] {
return LEGACY_CODING_TOOL_NAMES.map(name => legacyBuiltinTool(cwd, name));
}
View on GitHub (pinned to 9690622007)
Solutions
- Remove `operations` from the WriteToolOptions you pass.
- Implement a custom write tool with defineTool() if you need to route writes through an adapter.
- Let the built-in write tool operate on the real filesystem, scoping via cwd if needed.
Example fix
// before
createWriteToolDefinition(cwd, { operations: memFs })
// after
createWriteToolDefinition(cwd) Defensive patterns
Strategy: validation
Validate before calling
if (options && "operations" in options && options.operations) {
registerCustomWriteTool(operations); // defineTool() based
} else {
createWriteToolDefinition(cwd, options);
} Type guard
function hasOperations(o: WriteToolOptions | undefined): o is WriteToolOptions & { operations: NonNullable<WriteToolOptions["operations"]> } {
return !!o && !!o.operations;
} Try / catch
try {
tool = createWriteToolDefinition(cwd, options);
} catch (err) {
if (err instanceof Error && err.message.includes("WriteToolOptions.operations is not supported")) {
tool = defineCustomWriteTool(cwd, options.operations);
} else throw err;
} Prevention
- Omit `operations` when creating legacy write tools
- Use defineTool() for any virtual-filesystem write behavior
- Audit shared option objects during pi -> OMP migration
When it happens
Trigger: Calling createWriteTool(cwd, { operations }) or createWriteToolDefinition(cwd, { operations }) with a non-undefined `operations` field.
Common situations: Migration from legacy pi coding-agent code that wired a virtual FS into write; shared options objects reused across tool factories where read/ls still accept operations.
Related errors
- Legacy EditToolOptions.operations is not supported: OMP's bu
- Path not found: ${absolutePath}
- cachedContent cannot be combined with request-level ${incomp
- `context.tools` must be an array when present
- Tool "${toolCall.name}" not found
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/109ffe30135cae2b.
Report an issue: GitHub.