{"record":{"id":"a701987e749a8264","repo":"stablyai/orca","slug":"codex-app-server-does-not-support-method-res","errorCode":null,"errorMessage":"codex app-server does not support ${method}: ${response.error.message ?? 'method not found'}","messagePattern":"codex app-server does not support (.+?): (.+?)","errorType":"exception","errorClass":"CodexAppServerUnsupportedError","httpStatus":null,"severity":"warning","filePath":"src/main/codex/codex-app-server-session.ts","lineNumber":254,"sourceCode":"      throw buildEarlyExitError()\n    }\n    const id = nextRequestId++\n    const response = await new Promise<JsonRpcResponse>((resolve, reject) => {\n      pending.set(id, { resolve, reject })\n      const payload: Record<string, unknown> = { method, id }\n      if (params !== undefined) {\n        payload.params = params\n      }\n      try {\n        sendLine(payload)\n      } catch (error) {\n        pending.delete(id)\n        reject(error instanceof Error ? error : new Error(String(error)))\n      }\n    })\n    if (response.error) {\n      if (isMethodNotFoundError(response.error)) {\n        throw new CodexAppServerUnsupportedError(\n          `codex app-server does not support ${method}: ${response.error.message ?? 'method not found'}`\n        )\n      }\n      throw new Error(\n        `codex app-server ${method} failed: ${response.error.message ?? 'unknown error'}`\n      )\n    }\n    return response.result\n  }\n\n  function buildEarlyExitError(): Error {\n    if (stderrIndicatesMissingAppServer(stderrTail)) {\n      return new CodexAppServerUnsupportedError(\n        `codex CLI does not support the app-server subcommand: ${stderrTail.trim().slice(0, 400)}`\n      )\n    }\n    return new Error(\n      `codex app-server exited before completing the session${stderrTail ? `: ${stderrTail.trim().slice(0, 400)}` : ''}`","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/codex/codex-app-server-session.ts#L236-L272","documentation":"Thrown as CodexAppServerUnsupportedError when a JSON-RPC response carries an error that is a method-not-found: code === -32601 (JSON_RPC_METHOD_NOT_FOUND) or a message matching /method not found/i. This means the codex binary's app-server supports the subcommand but not the specific method called (e.g., thread/read, hooks/list, config/batchWrite on an older build).","triggerScenarios":"Calling thread/read on a codex build that predates lazy thread indexing; calling hooks/list before that RPC was added; calling config/batchWrite on a version that only supported direct config writes; the method name was renamed/removed in a codex release.","commonSituations":"Index-heal runs thread/read against an older codex; the grant client calls hooks/list on a codex that lacks the hooks RPC surface; a point-release dropped or gated an RPC.","solutions":["Upgrade codex to a version that implements the method (check codex's app-server RPC changelog).","Gate the call behind a capability check / isCodexAppServerUnsupportedError so older hosts degrade instead of throwing.","For heal, the pass already records 'unsupported' and re-probes later — ensure shouldStop and the unsupported marker path are honored.","Confirm the method name is current; codex may have renamed it."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// Cache per-host, per-method capability so unsupported methods are probed once:\nif (capabilityCache.isUnsupported(host, method)) {\n  // skip the call; degrade gracefully\n}","typeGuard":"import { isCodexAppServerUnsupportedError } from './codex-app-server-session'\n// For method-not-found, the thrown error is CodexAppServerUnsupportedError with\n// message starting 'codex app-server does not support <method>:'","tryCatchPattern":"try {\n  await rpc.request('thread/read', { threadId })\n} catch (error) {\n  if (isCodexAppServerUnsupportedError(error)) {\n    capabilityCache.setUnsupported(host, 'thread/read')\n    // record heal marker as unsupported; stop probing this host\n  } else {\n    throw error\n  }\n}","preventionTips":["Gate RPC calls behind a per-host capability cache keyed by method name.","Treat method-not-found as permanent for that codex version; re-probe only after an upgrade.","Upgrade codex to a build that implements the methods you call.","Use isCodexAppServerUnsupportedError (not message matching) to classify."],"tags":["codex","app-server","capability","unsupported","method-not-found","json-rpc"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}