paperclipai/paperclip · error · HarnessRuntimeRequestResolutionError

invalid question response

Error message

invalid question response

What it means

When a 'submit' resolution for a user_input/elicitation request includes a canonical `response`, it is validated against the persisted PaperclipQuestionSet via parsePaperclipQuestionResponse. Any validation failure is rethrown as a HarnessRuntimeRequestResolutionError; the literal 'invalid question response' is used when the underlying error has no message.

Source

Thrown at packages/paperclip-runner/src/contracts/harness-driver.ts:257

        "canonical submissions cannot also carry provider-specific answers or content",
      );
    }
    if (questionSet === undefined) {
      throw new HarnessRuntimeRequestResolutionError(
        requestKind,
        "canonical submission requires the persisted question set",
      );
    }
    try {
      return {
        action,
        response: parsePaperclipQuestionResponse(
          questionSet,
          candidate.response,
        ),
      };
    } catch (error) {
      throw new HarnessRuntimeRequestResolutionError(
        requestKind,
        error instanceof Error ? error.message : "invalid question response",
      );
    }
  }

  if (requestKind === "user_input") {
    if (action === "accept" || action === "accept_for_session") {
      throw new HarnessRuntimeRequestResolutionError(
        requestKind,
        "user input requires submit, decline, or cancel",
      );
    }
    if (action !== "submit") return { action };
    if ("content" in candidate) {
      throw new HarnessRuntimeRequestResolutionError(
        requestKind,
        "user input submissions carry answers, not content",

View on GitHub (pinned to 01ad858492)

Solutions

  1. Validate the response against the current PaperclipQuestionSet before submitting (field ids, answer types, required fields).
  2. Re-fetch the question set for the request and rebuild the response from it.
  3. Include the underlying validation error message to identify the exact field that failed.
  4. Ensure the caller passes the persisted questionSet argument when using canonical `response` submissions.

Example fix

// before
submit({ action: 'submit', response: { 'What next?': ['ok'] } });
// after
submit({ action: 'submit', response: { q_next_step: ['ok'] } }); // keyed by field id, validated against questionSet
Defensive patterns

Strategy: validation

Validate before calling

function responseMatchesQuestionSet(response, questionSet) {
  return questionSet.questions.every((q) =>
    q.required ? Array.isArray(response[q.id]) && response[q.id].length > 0 : response[q.id] === undefined || Array.isArray(response[q.id]));
}

Try / catch

try {
  await submitResponse(requestId, response);
} catch (e) {
  if (e instanceof HarnessRuntimeRequestResolutionError) {
    const fresh = await fetchQuestionSet(requestId);
    await submitResponse(requestId, buildResponseFromQuestionSet(fresh));
  } else throw e;
}

Prevention

When it happens

Trigger: Submitting `{ action: 'submit', response: ... }` where the response fails question validation: missing required fields, wrong field ids, non-string answers, answers violating single/multi-choice constraints, or the questionSet was not supplied (that case has its own message).

Common situations: UI form schema drifted from the persisted question set; response keyed by question text instead of field id; stale question set after the request was regenerated; empty answer arrays for required questions.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10). Data as JSON: /api/errors/105e7c432dc1c4cf. Report an issue: GitHub.