{"record":{"id":"579755a7da9387f4","repo":"different-ai/openwork","slug":"tool-namespace-reservednamespace-is-reserved","errorCode":null,"errorMessage":"Tool namespace '${reservedNamespace}' is reserved for CodeMode discovery tools.","messagePattern":"Tool namespace '(.+?)' is reserved for CodeMode discovery tools\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/codemode/src/tool-runtime.ts","lineNumber":480,"sourceCode":"  namespace: path.split(\".\", 1)[0]!,\n  searchText: [\n    path,\n    definition.description,\n    ...inputProperties(definition).flatMap(({ name, description: property }) =>\n      property === undefined ? [name] : [name, property],\n    ),\n  ]\n    .join(\"\\n\")\n    .toLowerCase(),\n})\n\n/** The runtime search index over every described tool. Search is always registered. */\nexport const searchIndex = <R>(tools: HostTools<R>): ReadonlyArray<SearchEntry> =>\n  visibleDefinitions(tools).map(({ path, definition, description }) => toSearchEntry(path, definition, description))\n\nexport const assertValidTools = <R>(tools: HostTools<R>): void => {\n  if (Object.hasOwn(tools, reservedNamespace)) {\n    throw new Error(`Tool namespace '${reservedNamespace}' is reserved for CodeMode discovery tools.`)\n  }\n}\n\n/**\n * Budgeted catalog: every namespace is always listed with its tool count; full call\n * signatures are inlined against the `catalogBudget` (estimated tokens,\n * chars/4) round-robin across namespaces - in each round (namespaces alphabetical), every\n * namespace still holding un-inlined tools attempts to place its next-cheapest line, and\n * a namespace whose next line does not fit is done while the others keep going - so every\n * namespace gets some representation before any namespace gets everything. The section\n * states exactly how comprehensive it is - overall (COMPLETE vs PARTIAL) and per\n * namespace. Namespace stub lines are never budgeted: every namespace appears with its\n * tool count even at budget 0.\n */\nexport const prepare = <R>(tools: HostTools<R>, catalogBudget = defaultCatalogBudget): DiscoveryPlan => {\n  if (!Number.isSafeInteger(catalogBudget) || catalogBudget < 0) {\n    throw new RangeError(\"discovery.catalogBudget must be a non-negative safe integer\")\n  }","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/packages/codemode/src/tool-runtime.ts#L462-L498","documentation":"Error \"Tool namespace '${reservedNamespace}' is reserved for CodeMode discovery tools.\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at packages/codemode/src/tool-runtime.ts:480 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}