paperclipai/paperclip · warning
rememberAction must be a boolean
Error message
rememberAction must be a boolean
What it means
HTTP 400 validation on the tool-gateway approve endpoint: the request body includes rememberAction but it is not a boolean. The handler explicitly allows it to be omitted (undefined) but rejects any other type.
Source
Thrown at server/src/routes/tool-gateway.ts:589
tool: body.tool,
parameters: body.parameters ?? {},
timeoutMs: body.timeoutMs,
approvedActionRequestId:
typeof body.approvedActionRequestId === "string" ? body.approvedActionRequestId : null,
idempotencyKey: typeof body.idempotencyKey === "string" ? body.idempotencyKey : null,
callerHeaders: callerHeaders(req),
});
res.json(result);
} catch (err) {
sendGatewayError(res, err);
}
});
router.post("/tool-gateway/action-requests/:id/approve", async (req, res) => {
try {
assertBoard(req);
const body = (req.body ?? {}) as { companyId?: string; rememberAction?: boolean };
if (body.rememberAction !== undefined && typeof body.rememberAction !== "boolean") { res.status(400).json({ error: "rememberAction must be a boolean" }); return; }
const companyId = body.companyId ?? (typeof req.query.companyId === "string" ? req.query.companyId : null);
if (!companyId) {
res.status(400).json({ error: "companyId is required" });
return;
}
assertBoardMutationAccess(req, companyId);
const actor = getActorInfo(req);
const actionRequest = await toolGateway.approveActionRequest({
companyId,
actionRequestId: req.params.id,
rememberAction: body.rememberAction,
actor: {
agentId: actor.agentId,
userId: req.actor.type === "board" ? req.actor.userId : null,
},
});
res.json(actionRequest);
} catch (err) {View on GitHub (pinned to 01ad858492)
Solutions
- Send rememberAction as a real JSON boolean: {"rememberAction": true}.
- Omit the key entirely if you don't want the decision remembered.
- Fix the client serializer to map boolean flags to JSON booleans, not strings.
- If using a form/query builder, coerce with rememberAction === 'true' on the client before sending.
Example fix
// before
fetch(url, { method: 'POST', body: JSON.stringify({ companyId, rememberAction: 'true' }) })
// 400 rememberAction must be a boolean
// after
fetch(url, { method: 'POST', body: JSON.stringify({ companyId, rememberAction: true }) }) Defensive patterns
Strategy: validation
Validate before calling
if (rememberAction !== undefined && typeof rememberAction !== 'boolean') throw new TypeError('rememberAction must be a boolean or omitted'); Type guard
const isBoolOrUndefined = (v) => typeof v === 'boolean' || v === undefined;
Try / catch
try {
const res = await approveActionRequest({ id, companyId, rememberAction });
} catch (e) {
if (e.status === 400 && /rememberAction/.test(e.body?.error ?? '')) {
return approveActionRequest({ id, companyId }); // retry without the flag
}
throw e;
} Prevention
- Never stringify booleans in JSON request bodies.
- Use a typed client so rememberAction is boolean at compile time.
- Omit optional flags rather than sending null.
- Add client-side schema validation (e.g. Zod) before POSTing.
When it happens
Trigger: POST /api/tool-gateway/action-requests/:id/approve with body { rememberAction: "true" } (string), { rememberAction: 1 }, or { rememberAction: null } — typeof body.rememberAction !== 'boolean' while the key is present.
Common situations: Client sends JSON booleans as strings; form-encoded clients stringify true; SDK serializes a nullable boolean as null; copy-pasted curl with quoted 'true'.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- reason must be a string up to 4000 characters
- Invalid status '${String(rawStatus)}'. Must be one of: ${PLU
- Request body is required
- "tool" is required and must be a string
- "runContext" is required and must be an object
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10).
Data as JSON: /api/errors/f89f84ac0548d1af.
Report an issue: GitHub.