{"record":{"id":"9afc028a3305b686","repo":"paperclipai/paperclip","slug":"unsupported-opencode-proxy-method-message-method","errorCode":null,"errorMessage":"Unsupported OpenCode proxy method ${message.method}","messagePattern":"Unsupported OpenCode proxy method (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/cli/opencode-app-server-proxy.ts","lineNumber":395,"sourceCode":"        turnId: text(params.turnId, activeTurnId ?? \"\"),\n      });\n      result = true;\n      break;\n    case \"thread/read\":\n      if (!session) throw new Error(\"OpenCode thread is not open\");\n      result = {\n        thread: {\n          id: session.ids().driverSessionId,\n          cwd,\n          turns: activeTurnId\n            ? [{ id: activeTurnId, status: \"inProgress\" }]\n            : [],\n        },\n        transcript: await session.read?.(),\n      };\n      break;\n    default:\n      throw new Error(`Unsupported OpenCode proxy method ${message.method}`);\n  }\n  send({ id: message.id, result });\n}\n\nlet pendingInput = Promise.resolve();\nlet bootstrapFailure: Error | null = null;\ninput.on(\"line\", (line) => {\n  if (!line.trim()) return;\n  let message: RpcMessage;\n  try {\n    message = JSON.parse(line) as RpcMessage;\n  } catch (error) {\n    process.stderr.write(`Invalid JSON-RPC input: ${String(error)}\\n`);\n    return;\n  }\n  pendingInput = enqueueOpenCodeProxyInput(\n    pendingInput,\n    async () => {","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/cli/opencode-app-server-proxy.ts#L377-L413","documentation":"The OpenCode proxy implements a fixed set of JSON-RPC methods (initialize, thread/start, thread/resume, collaborationMode/list, turn/start, turn/interrupt, thread/read). Any other method falls into the default case and throws this error, since the proxy cannot translate unknown requests to the underlying driver.","triggerScenarios":"Sending a JSON-RPC request whose `method` is not one of the seven supported methods, including typos ('turn/Start'), version drift ('session/prompt' from an older protocol), or extensions the proxy does not know.","commonSituations":"Client and proxy protocol versions mismatch; a client built against the real OpenCode app-server API sends methods the shim does not implement; typo in method name during development.","solutions":["Use only the supported methods: initialize, thread/start, thread/resume, collaborationMode/list, turn/start, turn/interrupt, thread/read.","Fix the method-name typo or casing in the client request.","Align client protocol version with the proxy (serverInfo reports version 1.18.29 semantics).","If a new method is genuinely needed, add a case to the switch in opencode-app-server-proxy.ts."],"exampleFix":"// before\nawait rpc({ method: 'session/prompt', params });\n// after\nawait rpc({ method: 'turn/start', params: { input: [{ text }] } });","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['initialize','thread/start','thread/resume','collaborationMode/list','turn/start','turn/interrupt','thread/read'];\nif (!SUPPORTED.includes(method)) throw new Error(`method ${method} not supported by opencode proxy`);","typeGuard":null,"tryCatchPattern":"try {\n  return await rpc({ method, params });\n} catch (e) {\n  if (String(e.message).startsWith('Unsupported OpenCode proxy method')) {\n    throw new Error(`check protocol version / method name: ${method}`);\n  }\n  throw e;\n}","preventionTips":["Keep a shared constant list of supported proxy methods in the client.","Version-check via the initialize serverInfo before calling newer methods.","Avoid copying method names from the upstream OpenCode app-server API; the shim is a subset."],"tags":["json-rpc","protocol","unsupported-method"],"backgroundTag":"unsupported-operation","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}