{"record":{"id":"65acce773f6d13bd","repo":"continuedev/continue","slug":"depth-must-be-a-number","errorCode":null,"errorMessage":"Depth must be a number","messagePattern":"Depth must be a number","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/context/providers/GitCommitContextProvider.ts","lineNumber":111,"sourceCode":"            name: query,\n            description: `commit ${query}`,\n            content,\n          },\n        ];\n      }\n    } catch (err) {\n      return [];\n    }\n  }\n\n  async loadSubmenuItems(\n    args: LoadSubmenuItemsArgs,\n  ): Promise<ContextSubmenuItem[]> {\n    const depth = this.options?.Depth ?? 50;\n    const lastXCommitsDepth = this.options?.LastXCommitsDepth ?? 10;\n\n    if (typeof depth !== \"number\") {\n      throw new Error(\"Depth must be a number\");\n    }\n    if (typeof lastXCommitsDepth !== \"number\") {\n      throw new Error(\"LastXCommitsDepth must be a number\");\n    }\n\n    const topLevelDir = fileURLToPath((await args.ide.getWorkspaceDirs())[0]);\n    try {\n      const gitResult = await runGitCommand(\n        [\n          \"--no-pager\",\n          \"log\",\n          '--pretty=format:\"%H%x00%s\"',\n          `-n`,\n          depth.toString(),\n        ],\n        topLevelDir,\n      );\n      const recentCommits = [","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/providers/GitCommitContextProvider.ts#L93-L129","documentation":"The WatsonX streaming chat request returned a non-ok status or had no body, and the raw response text is embedded. This is the generic upstream failure for WatsonX chat streaming (auth, space/project id, model id, network).","triggerScenarios":"Expired/invalid IAM token in headers; wrong project_id or watsonx.ai space; model id not available to the account; TLS/proxy issues producing non-2xx; empty body on early connection close.","commonSituations":"IAM token from WatsonX Machine Learning expires mid-session and streams start failing; wrong WATSONX_PROJECT_ID env var; model gated by entitlement in the WatsonX catalog.","solutions":["Read the embedded response.text() — WatsonX states the exact reason (401 token, 404 project/model)","Refresh the IAM/access token before long-lived streaming sessions","Verify project/space id and that the model is available in your WatsonX region","Wrap stream start in retry-with-backoff for transient 5xx"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { for await (const c of api.chatCompletionStream(body, signal)) {} } catch (e) { const msg = (e as Error).message; if (/401|token/i.test(msg)) { await refreshToken(); return retry(); } if (/429|5\\d\\d/.test(msg)) await backoff(); else throw e; }","preventionTips":["Refresh WatsonX IAM tokens on a schedule shorter than their TTL","Validate project id and model availability at startup","Capture the embedded response text in error logs"],"tags":["watsonx","streaming","http-error","ibm-cloud"],"backgroundTag":"upstream-api-http-error","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}