{"record":{"id":"ed32830bdb96cbd3","repo":"paperclipai/paperclip","slug":"acpx-runtime-does-not-expose-session-goal-controls","errorCode":null,"errorMessage":"ACPX runtime does not expose session goal controls","messagePattern":"ACPX runtime does not expose session goal controls","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/drivers/acpx/runtime-host.ts","lineNumber":596,"sourceCode":"\n  async status(): Promise<AcpxModelStatus> {\n    return structuredClone(await this.#runtime.getStatus());\n  }\n\n  goalCapability(): AcpxRuntimeGoalCapability | null {\n    return this.#runtime.goalCapability?.() ?? null;\n  }\n\n  goalSnapshot(): AcpxRuntimeGoalSnapshot | null {\n    return this.#runtime.goalSnapshot?.() ?? null;\n  }\n\n  async controlGoal(\n    action: \"set\" | \"pause\" | \"resume\" | \"clear\",\n    objective?: string,\n  ): Promise<AcpxRuntimeGoalSnapshot | null> {\n    if (!this.#runtime.controlGoal) {\n      throw new Error(\"ACPX runtime does not expose session goal controls\");\n    }\n    return await this.#runtime.controlGoal(action, objective);\n  }\n\n  startTurn(input: AcpxRuntimeTurnInput): AcpxRuntimeTurn {\n    if (this.#closed || this.#closingStarted) {\n      throw new Error(\"ACPX runtime host is closing\");\n    }\n    if (this.#activeTurn) {\n      throw new Error(\"ACPX runtime host already has an active turn\");\n    }\n    const requestId = boundedRequestId(input.requestId);\n    const text = boundedTurnText(input.text);\n    const turn = this.#runtime.startTurn({\n      text,\n      requestId,\n      ...(input.signal ? { signal: input.signal } : {}),\n      ...(input.onElicitation ? { onElicitation: input.onElicitation } : {}),","sourceCodeStart":578,"sourceCodeEnd":614,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/drivers/acpx/runtime-host.ts#L578-L614","documentation":"The runtime host's controlGoal() delegates session goal set/pause/resume/clear to the underlying AcpxRuntimePort. This error is thrown when the wrapped runtime does not implement the optional controlGoal capability, so goal controls are unavailable for that runtime.","triggerScenarios":"Calling host.controlGoal(\"set\"|\"pause\"|\"resume\"|\"clear\") when the underlying runtime instance was created without goal-control support, i.e. this.#runtime.controlGoal is undefined.","commonSituations":"Using an older or minimal ACPX runtime implementation that predates goal controls; a test/dummy runtime port that omits controlGoal; feature-flagged runtime builds where goal support is disabled.","solutions":["Check that the runtime implementation in use supports goal controls before calling controlGoal (feature-detect host's runtime port)","Upgrade the ACPX runtime/adapter package to a version exposing controlGoal","Skip goal-control UI/actions when the capability is absent","If injecting a custom AcpxRuntimePort (e.g. in tests), implement controlGoal"],"exampleFix":"// before\nawait host.controlGoal(\"set\", objective);\n// after\nif (host.supportsGoalControls?.()) {\n  await host.controlGoal(\"set\", objective);\n}","handlingStrategy":"validation","validationCode":"if (typeof host.controlGoal !== \"function\") {\n  // goal controls unavailable; skip\n}","typeGuard":"function supportsGoalControls(runtime) {\n  return typeof (runtime as AcpxRuntimePort).controlGoal === \"function\";\n}","tryCatchPattern":"try {\n  await host.controlGoal(\"set\", objective);\n} catch (err) {\n  if (err.message.includes(\"session goal controls\")) {\n    return null; // capability absent\n  }\n  throw err;\n}","preventionTips":["Feature-detect goal-control support before surfacing goal UI","Keep runtime/adapter packages on versions that implement controlGoal","Avoid test double runtimes that omit optional capabilities you exercise","Gate goal actions behind a capability flag per runtime build"],"tags":["acpx","runtime","goal-controls","unsupported-operation"],"backgroundTag":"method-not-implemented","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"}