{"record":{"id":"49df8f08219a1927","repo":"paperclipai/paperclip","slug":"action-does-not-carry-submitted-form-data","errorCode":null,"errorMessage":"${action} does not carry submitted form data","messagePattern":"(.+?) does not carry submitted form data","errorType":"validation","errorClass":"HarnessRuntimeRequestResolutionError","httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/contracts/harness-driver.ts","lineNumber":223,"sourceCode":"  const candidate = plainRecord(value) ?? {};\n  const rawAction = candidate.action;\n  if (\n    typeof rawAction !== \"string\" ||\n    !RUNTIME_REQUEST_ACTIONS.includes(rawAction as HarnessRuntimeRequestAction)\n  ) {\n    throw new HarnessRuntimeRequestResolutionError(\n      requestKind,\n      `unsupported action ${JSON.stringify(rawAction) ?? \"undefined\"}`,\n    );\n  }\n  const action = rawAction as HarnessRuntimeRequestAction;\n  if (\n    action !== \"submit\" &&\n    (\"answers\" in candidate ||\n      \"content\" in candidate ||\n      \"response\" in candidate)\n  ) {\n    throw new HarnessRuntimeRequestResolutionError(\n      requestKind,\n      `${action} does not carry submitted form data`,\n    );\n  }\n\n  if (action === \"submit\" && \"response\" in candidate) {\n    if (requestKind !== \"user_input\" && requestKind !== \"elicitation\") {\n      throw new HarnessRuntimeRequestResolutionError(\n        requestKind,\n        \"approval requests do not accept submitted question responses\",\n      );\n    }\n    if (\"answers\" in candidate || \"content\" in candidate) {\n      throw new HarnessRuntimeRequestResolutionError(\n        requestKind,\n        \"canonical submissions cannot also carry provider-specific answers or content\",\n      );\n    }","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/contracts/harness-driver.ts#L205-L241","documentation":"parseHarnessRuntimeRequestResolution validates that a request resolution matches its request kind. Only action 'submit' may carry form payload fields (answers/content/response); any other action (accept, decline, cancel, accept_for_session) that includes one of those fields is rejected so mismatched submits fail closed instead of degrading into empty responses.","triggerScenarios":"Calling parseHarnessRuntimeRequestResolution (or the agent routes/browser transport that wrap it) with `{ action: 'decline', answers: {...} }`, `{ action: 'accept', content: '...' }`, or similar where a non-submit action also includes answers/content/response.","commonSituations":"UI sends the user's typed text along with an 'accept' action; a generic resolver attaches a stale answers object to a decline; API client copies the submit payload shape for other actions.","solutions":["Strip answers/content/response fields from the payload when the action is not 'submit'.","If the intent is to submit form data, change the action to 'submit'.","For approval requests use accept/accept_for_session/decline with no payload fields; for user_input use submit/decline/cancel.","Validate the resolution object shape client-side before posting it to the route."],"exampleFix":"// before\nresolve({ action: 'decline', answers: { q1: ['no'] } });\n// after\nresolve({ action: 'decline' });","handlingStrategy":"validation","validationCode":"function validateResolution(r) {\n  const payloadFields = ['answers', 'content', 'response'].filter((k) => k in r);\n  if (r.action !== 'submit' && payloadFields.length > 0) {\n    throw new Error(`${r.action} must not carry ${payloadFields.join(',')}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await resolveRequest(requestId, resolution);\n} catch (e) {\n  if (e instanceof HarnessRuntimeRequestResolutionError && e.message.includes('does not carry submitted form data')) {\n    await resolveRequest(requestId, { action: resolution.action });\n  } else throw e;\n}","preventionTips":["Build resolutions from per-action constructors that only attach payload fields for 'submit'.","Add a client-side schema check mirroring parseHarnessRuntimeRequestResolution before posting.","Never reuse the submit payload object for accept/decline/cancel actions."],"tags":["validation","schema","harness"],"backgroundTag":"schema-validation-failed","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"}