{"record":{"id":"109ffe30135cae2b","repo":"can1357/oh-my-pi","slug":"legacy-writetooloptions-operations-is-not-supporte","errorCode":null,"errorMessage":"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().","messagePattern":"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\\(\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts","lineNumber":731,"sourceCode":"\tif (options?.operations) {\n\t\tthrow new Error(\n\t\t\t\"Legacy EditToolOptions.operations is not supported: OMP's built-in edit tool writes the local \" +\n\t\t\t\t\"filesystem natively and exposes no pluggable operations seam. Register a custom edit tool via \" +\n\t\t\t\t\"defineTool() instead of passing operations to createEditTool()/createEditToolDefinition().\",\n\t\t);\n\t}\n\treturn legacyBuiltinTool(cwd, \"edit\");\n}\n\n/** Create the legacy edit tool. */\nexport function createEditTool(cwd: string, options?: EditToolOptions): ToolDefinition {\n\treturn createEditToolDefinition(cwd, options);\n}\n\n/** Create the legacy write tool definition. */\nexport function createWriteToolDefinition(cwd: string, options?: WriteToolOptions): ToolDefinition {\n\tif (options?.operations) {\n\t\tthrow new Error(\n\t\t\t\"Legacy WriteToolOptions.operations is not supported: OMP's built-in write tool writes the local \" +\n\t\t\t\t\"filesystem natively and exposes no pluggable operations seam. Register a custom write tool via \" +\n\t\t\t\t\"defineTool() instead of passing operations to createWriteTool()/createWriteToolDefinition().\",\n\t\t);\n\t}\n\treturn legacyBuiltinTool(cwd, \"write\");\n}\n\n/** Create the legacy write tool. */\nexport function createWriteTool(cwd: string, options?: WriteToolOptions): ToolDefinition {\n\treturn createWriteToolDefinition(cwd, options);\n}\n\n/** Create legacy read, bash, edit, and write tools. */\nexport function createCodingTools(cwd: string): ToolDefinition[] {\n\treturn LEGACY_CODING_TOOL_NAMES.map(name => legacyBuiltinTool(cwd, name));\n}\n","sourceCodeStart":713,"sourceCodeEnd":749,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts#L713-L749","documentation":"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.","triggerScenarios":"Calling createWriteTool(cwd, { operations }) or createWriteToolDefinition(cwd, { operations }) with a non-undefined `operations` field.","commonSituations":"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.","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."],"exampleFix":"// before\ncreateWriteToolDefinition(cwd, { operations: memFs })\n// after\ncreateWriteToolDefinition(cwd)","handlingStrategy":"validation","validationCode":"if (options && \"operations\" in options && options.operations) {\n  registerCustomWriteTool(operations); // defineTool() based\n} else {\n  createWriteToolDefinition(cwd, options);\n}","typeGuard":"function hasOperations(o: WriteToolOptions | undefined): o is WriteToolOptions & { operations: NonNullable<WriteToolOptions[\"operations\"]> } {\n  return !!o && !!o.operations;\n}","tryCatchPattern":"try {\n  tool = createWriteToolDefinition(cwd, options);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"WriteToolOptions.operations is not supported\")) {\n    tool = defineCustomWriteTool(cwd, options.operations);\n  } else throw err;\n}","preventionTips":["Omit `operations` when creating legacy write tools","Use defineTool() for any virtual-filesystem write behavior","Audit shared option objects during pi -> OMP migration"],"tags":["legacy-shim","api-migration","tools","unsupported-option"],"backgroundTag":"unsupported-option-legacy-shim","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}