mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-26 01:39:51 +01:00
fix(shared): allow one answer per ask_user_questions question (max 64) (#16702)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Agents ask board users questions with `ask_user_questions` interactions > - The question payload allows up to 64 questions (`askUserQuestionsPayloadFields`) > - The response schema `respondIssueThreadInteractionSchema` allows only 20 answers > - A card with 21 to 64 questions can be created, but the user cannot submit all answers > - This pull request raises the answer limit to 64, the same as the question limit > - The benefit is that every valid card can be answered ## Linked Issues or Issue Description **What happened?** An `ask_user_questions` card with more than 20 questions is accepted on creation. When the user answers every question, the response is rejected by validation because `answers` has a maximum of 20 items. **Steps to reproduce** 1. Create an `ask_user_questions` interaction with 21 questions (the limit is 64). 2. Answer all 21 questions. 3. Send the response to `respondIssueThreadInteractionSchema`. **Expected behavior** One answer per question is accepted, up to 64. **Actual behavior** Validation fails because `answers` allows at most 20 items. No existing public issue found (searched issues and PRs for `respondIssueThreadInteraction`). ## What Changed - `packages/shared/src/validators/issue.ts`: `answers` maximum changed from 20 to 64 to match the question maximum. - `packages/shared/src/validators/issue.test.ts`: new test. 64 answers pass. 65 answers fail. ## Verification - `LC_ALL=C pnpm --filter @paperclipai/shared exec vitest run src/validators/issue.test.ts` — 44 passed. ## Risks Low risk. The change only raises an upper bound to a value the question schema already allows. ## Model Used Claude (Anthropic), model ID `claude-sonnet-5-5`, with tool use and code execution in Claude Code. A human reviewed the change. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes (none needed) - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [ ] I will address all Greptile and reviewer comments before requesting merge
This commit is contained in:
1 parent
0c3ed144cb
commit
81e2c50aa9
2 files changed
+14
-1
No files matched your search
@@ -568,6 +568,19 @@ describe("issue validators", () => {
|
||||
expect(document.body).toBe("# Plan\n\nShip it");
|
||||
});
|
||||
|
||||
it("accepts one answer per question up to the 64-question payload limit", () => {
|
||||
const answers = Array.from({ length: 64 }, (_, i) => ({
|
||||
questionId: `q${i}`,
|
||||
optionIds: [],
|
||||
otherText: null,
|
||||
}));
|
||||
|
||||
expect(respondIssueThreadInteractionSchema.safeParse({ answers }).success).toBe(true);
|
||||
expect(
|
||||
respondIssueThreadInteractionSchema.safeParse({ answers: [...answers, answers[0]] }).success,
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("clamps oversized requestDepth values on create", () => {
|
||||
const parsed = createIssueSchema.parse({
|
||||
title: "Clamp request depth",
|
||||
|
||||
@@ -2356,7 +2356,7 @@ export type WithdrawIssueThreadInteraction = z.infer<
|
||||
>;
|
||||
|
||||
export const respondIssueThreadInteractionSchema = z.object({
|
||||
answers: z.array(askUserQuestionsAnswerSchema).max(20),
|
||||
answers: z.array(askUserQuestionsAnswerSchema).max(64),
|
||||
summaryMarkdown: multilineTextSchema
|
||||
.pipe(z.string().max(20000))
|
||||
.nullable()
|
||||
|
||||
Reference in new issue
Block a user