{"record":{"id":"ab87cd6a7c2f6b3b","repo":"deepseek-ai/deepseek-harness","slug":"invalid-prompt-variable-name-name-must-match","errorCode":null,"errorMessage":"invalid prompt variable name \"${name}\" (must match ${String(VARIABLE_NAME)})","messagePattern":"invalid prompt variable name \"(.+?)\" \\(must match (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/system-prompt/src/index.ts","lineNumber":448,"sourceCode":"  tools(provider: (context: AssembleContext) => ToolProviderResult): () => void {\n    return this.layers.effect(\n      this.ctx,\n      layer => layer.toolProviders.append(provider),\n      { label: 'systemPrompt.tools()' },\n    )\n  }\n\n  /**\n   * Register a prompt variable in the calling context's scope. Scoped values\n   * shadow globals; invalid or duplicate names throw. A provider may return\n   * `undefined`, but rendering a section that references that value then fails.\n   * @param name - the `[a-z][a-z0-9_]*` reference name.\n   * @param provider - evaluated for each assembly.\n   * @returns the exact Cordis effect disposer.\n   */\n  variable(name: string, provider: (context: AssembleContext) => string | undefined): () => void {\n    if (!VARIABLE_NAME.test(name)) {\n      throw new Error(`invalid prompt variable name \"${name}\" (must match ${String(VARIABLE_NAME)})`)\n    }\n    return this.layers.effect(\n      this.ctx,\n      layer => layer.variables.insert(name, provider),\n      { label: 'systemPrompt.variable()' },\n    )\n  }\n\n  /**\n   * Assemble global and scoped providers, detach tool parameters, apply\n   * canonical ordering, then run the assembly waterfall. Scoped sections and\n   * variables shadow globals. The returned waterfall value is authoritative\n   * except that an effective complete section is restored afterwards as the\n   * sole prompt section.\n   * @param context - the optional scope and plugin-defined assembly fields.\n   * @returns the post-waterfall assembly with any complete prompt enforced.\n   */\n  // Keep configuration failures on the declared asynchronous error path.","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/system-prompt/src/index.ts#L430-L466","documentation":"Error \"invalid prompt variable name \"${name}\" (must match ${String(VARIABLE_NAME)})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/system-prompt/src/index.ts:448 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":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}