fix: remove native question limits

This commit is contained in:
mesalogo
2026-09-08 21:52:10 +08:00
parent fbc0f5e9f3
commit 78418a56fa
6 changed files with 75 additions and 38 deletions
+23 -1
View File
@@ -15,7 +15,10 @@ import {
projectExecutionSpaceSchema,
projectUpdateSchema
} from './assistant-contracts'
import { subagentEventSchema } from './contracts'
import {
agentQuestionResponseSchema,
subagentEventSchema
} from './contracts'
const untouchedProject: AssistantProject = {
id: '00000000-0000-4000-8000-000000000101',
@@ -34,6 +37,25 @@ const untouchedProject: AssistantProject = {
updatedAt: '2026-08-01T00:00:00.000Z'
}
describe('agent question contracts', () => {
it('does not impose GoodBuddy-specific question answer limits', () => {
const answers = Array.from({ length: 5 }, (_, questionIndex) =>
Array.from(
{ length: 21 },
(_, optionIndex) =>
`${questionIndex}:${optionIndex}:${'回答内容'.repeat(600)}`
)
)
expect(
agentQuestionResponseSchema.parse({
questionId: `question-${'id'.repeat(100)}`,
answers
}).answers
).toEqual(answers)
})
})
describe('activity history contracts', () => {
it('accepts more than 500 records and details longer than 4,000 characters', () => {
const records = Array.from({ length: 501 }, (_, index) => ({
+3 -4
View File
@@ -305,13 +305,12 @@ export const workspaceOpenPathRequestSchema = z
.strict()
export const agentQuestionAnswerSchema = z
.array(z.string().trim().min(1).max(2_000))
.max(20)
.array(z.string().trim().min(1))
export const agentQuestionResponseSchema = z
.object({
questionId: z.string().trim().min(1).max(128),
answers: z.array(agentQuestionAnswerSchema).max(4)
questionId: z.string().trim().min(1),
answers: z.array(agentQuestionAnswerSchema)
})
.strict()