{"record":{"id":"d4766686496e78fa","repo":"can1357/oh-my-pi","slug":"legacy-greptooloptions-operations-is-not-supported","errorCode":null,"errorMessage":"Legacy GrepToolOptions.operations is not supported: the built-in grep tool searches the local filesystem natively and exposes no pluggable filesystem seam (the historical seam only customized context-line reads; the search itself always ran locally). Register a custom grep tool via defineTool() instead of passing operations to createGrepTool()/createGrepToolDefinition().","messagePattern":"Legacy GrepToolOptions\\.operations is not supported: the built-in grep tool searches the local filesystem natively and exposes no pluggable filesystem seam \\(the historical seam only customized context-line reads; the search itself always ran locally\\)\\. Register a custom grep tool via defineTool\\(\\) instead of passing operations to createGrepTool\\(\\)/createGrepToolDefinition\\(\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts","lineNumber":555,"sourceCode":"\t\t\t\t\tenv: spawn?.env,\n\t\t\t\t\ttimeout,\n\t\t\t\t},\n\t\t\t\tsignal,\n\t\t\t\tonUpdate,\n\t\t\t);\n\t\t},\n\t});\n}\n\n/** Create the legacy bash tool. */\nexport function createBashTool(cwd: string, options?: BashToolOptions): ToolDefinition {\n\treturn createBashToolDefinition(cwd, options);\n}\n\n/** Create the legacy grep tool definition. */\nexport function createGrepToolDefinition(cwd: string, options?: GrepToolOptions): ToolDefinition {\n\tif (options?.operations) {\n\t\tthrow new Error(\n\t\t\t\"Legacy GrepToolOptions.operations is not supported: the built-in grep tool searches the local \" +\n\t\t\t\t\"filesystem natively and exposes no pluggable filesystem seam (the historical seam only customized \" +\n\t\t\t\t\"context-line reads; the search itself always ran locally). Register a custom grep tool via \" +\n\t\t\t\t\"defineTool() instead of passing operations to createGrepTool()/createGrepToolDefinition().\",\n\t\t);\n\t}\n\tconst tool = createRegistryTool(cwd, \"grep\");\n\treturn markToolDefinition({\n\t\tname: \"grep\",\n\t\tlabel: \"grep\",\n\t\tdescription: \"Search file contents for a pattern.\",\n\t\tparameters: legacyGrepSchema,\n\t\tapproval: \"read\",\n\t\trenderCall: (params, optionsArg, themeArg) => {\n\t\t\tconst theme = renderTheme(optionsArg, themeArg);\n\t\t\tconst pattern = stringField(params, \"pattern\") ?? \"\";\n\t\t\tconst searchPath = stringField(params, \"path\") ?? \".\";\n\t\t\treturn new Text(`${themedTitle(theme, \"grep\")} ${themedMuted(theme, `/${pattern}/ in ${searchPath}`)}`, 0, 0);","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts#L537-L573","documentation":"The legacy grep tool shim no longer accepts the GrepToolOptions.operations pluggable-filesystem seam. The historical seam only customized context-line reads — the search itself always ran locally — so passing operations now throws an explanatory error directing users to register a custom tool instead.","triggerScenarios":"Calling createGrepTool()/createGrepToolDefinition() with options.operations set; porting old pi-coding-agent code that supplied custom read operations for grep context lines.","commonSituations":"Migrating legacy integrations after upgrading to the new extensibility API; code that wrapped remote/virtual filesystems via the old seam.","solutions":["Remove the operations property from GrepToolOptions to use the native local grep","Implement a custom grep tool with defineTool() and register it for non-local filesystems","If only context-line customization is needed, note the search was always local — restructure around the native tool","Pin to the legacy version only as a temporary migration measure"],"exampleFix":"// before\ncreateGrepTool(cwd, { operations: myReadOps });\n// after\ncreateGrepTool(cwd);\n// or register a custom tool:\ndefineTool({ name: 'my-grep', ..., execute: ... });","handlingStrategy":"validation","validationCode":"if (options && 'operations' in options) throw new Error('GrepToolOptions.operations removed: use createGrepTool(cwd) or defineTool() for custom grep');","typeGuard":null,"tryCatchPattern":"try { const tool = createGrepToolDefinition(cwd, options); } catch (err) {\n  if (err instanceof Error && err.message.includes('GrepToolOptions.operations is not supported')) {\n    const tool = createGrepToolDefinition(cwd); // drop the legacy option\n  } else throw err;\n}","preventionTips":["Audit legacy pi-coding-agent code for GrepToolOptions.operations during migration","Use the native grep for local filesystem searches","Implement custom filesystem grep via defineTool() rather than legacy seams","Read the shim's migration error messages — they state the replacement API directly"],"tags":["legacy-shim","grep","api-removal","migration"],"backgroundTag":"unsupported-legacy-option","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}