{"record":{"id":"4c65d3b3c3a54058","repo":"paperclipai/paperclip","slug":"native-session-goal-unavailable","errorCode":"native_session_goal_unavailable","errorMessage":"native_session_goal_unavailable","messagePattern":"native_session_goal_unavailable","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/backends/harness-driver-backend.ts","lineNumber":746,"sourceCode":"  }\n\n  handoffRuntimeRequest(input: {\n    requestId: string;\n    turnId: string;\n    reason: \"durable_handoff\";\n    signal: AbortSignal;\n  }) {\n    this.#assertProtocolIntegrity();\n    if (this.#session.handoffRuntimeRequest === undefined) {\n      throw new Error(\"native_runtime_request_handoff_unavailable\");\n    }\n    return this.#session.handoffRuntimeRequest(input);\n  }\n\n  goal(input: Parameters<NonNullable<HarnessSession[\"goal\"]>>[0]) {\n    this.#assertProtocolIntegrity();\n    if (this.#session.goal === undefined) {\n      throw new Error(\"native_session_goal_unavailable\");\n    }\n    return this.#withProtocolIntegrity(() => this.#session.goal!(input));\n  }\n\n  async result() {\n    this.#assertProtocolIntegrity();\n    if (this.#explicitlyCancelled) return null;\n    const snapshot = await this.#harnessSnapshot();\n    if (\n      snapshot.semanticResult === undefined ||\n      snapshot.semanticResult === null\n    ) {\n      return null;\n    }\n    if (this.#terminal === null) {\n      return null;\n    }\n    return {","sourceCodeStart":728,"sourceCodeEnd":764,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/backends/harness-driver-backend.ts#L728-L764","documentation":"goal forwards a goal-setting call to the HarnessSession's optional goal capability. When the driver does not implement goal, the backend throws native_session_goal_unavailable because the session cannot accept programmatic goal updates. Protocol integrity is asserted before and after the delegation.","triggerScenarios":"Calling goal() on a session whose driver has no goal method (this.#session.goal === undefined); setting or updating a run goal on a driver lacking the goal protocol extension.","commonSituations":"Board-driven goal updates targeting an agent adapter without goal support; older driver builds predating the goal method; drivers where goals are supplied only at session creation, not dynamically.","solutions":["Upgrade the driver/adapter to a version implementing goal","Pass the goal at session creation time instead of updating it dynamically","Guard with a capability check and disable goal editing in the UI for unsupported agents","Recreate the session with the new goal if dynamic updates are unsupported"],"exampleFix":"// before\nawait backend.goal({ text: newGoal });\n// after\nif (!backend.canSetGoal()) {\n  await recreateSessionWithGoal(newGoal);\n} else {\n  await backend.goal({ text: newGoal });\n}","handlingStrategy":"try-catch","validationCode":"if (typeof session.goal !== 'function') throw new Error('goal updates unsupported by driver');","typeGuard":"const canSetGoal = (s: HarnessSession): s is HarnessSession & { goal: NonNullable<HarnessSession['goal']> } => typeof s.goal === 'function';","tryCatchPattern":"try { await backend.goal(input); } catch (e) { if (e.message === 'native_session_goal_unavailable') { await recreateSessionWithGoal(input); } else throw e; }","preventionTips":["Set goals at session creation when dynamic goal is unsupported","Disable goal editing in UI for incapable agents","Keep driver builds current with the goal protocol method"],"tags":["goal","capability-missing","session"],"backgroundTag":"unsupported-operation","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}