Phase 10: Multi-Question Schema - 4 plans in 3 waves - Wave 1: Schema & types (01) - Wave 2: Manager implementations + unit tests (02, 03 parallel) - Wave 3: E2E tests (04) - Ready for execution
4.2 KiB
4.2 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous
| phase | plan | type | wave | depends_on | files_modified | autonomous | |||
|---|---|---|---|---|---|---|---|---|---|
| 10-multi-question-schema | 01 | execute | 1 |
|
true |
Purpose: Enable agents to ask multiple questions in one pause, reducing round-trips. Output: Updated Zod schema, TypeScript types, and event payloads supporting questions array.
<execution_context>
@/.claude/get-shit-done/workflows/execute-plan.md
@/.claude/get-shit-done/templates/summary.md
</execution_context>
@src/agent/schema.ts @src/agent/types.ts @src/events/types.ts
Task 1: Update agent output schema to questions array src/agent/schema.ts Change `question` status variant from single question to array:Before:
z.object({
status: z.literal('question'),
question: z.string(),
options: z.array(optionSchema).optional(),
multiSelect: z.boolean().optional(),
})
After:
z.object({
status: z.literal('questions'), // plural
questions: z.array(z.object({
id: z.string(), // unique identifier for matching answers
question: z.string(),
options: z.array(optionSchema).optional(),
multiSelect: z.boolean().optional(),
})),
})
Update agentOutputJsonSchema to match the Zod schema.
Key points:
- Rename status from 'question' to 'questions' (plural) for clarity
- Each question has an
idfield so answers can be matched - Single question case:
questions: [{ id: "q1", question: "..." }]npm run typecheck passes Schema exports updated AgentOutput type with questions array
Before:
export interface PendingQuestion {
question: string;
options?: Array<{ label: string; description?: string }>;
multiSelect?: boolean;
}
After:
export interface QuestionItem {
id: string;
question: string;
options?: Array<{ label: string; description?: string }>;
multiSelect?: boolean;
}
export interface PendingQuestions {
questions: QuestionItem[];
}
Update AgentManager interface:
- Rename
getPendingQuestiontogetPendingQuestions - Return type:
Promise<PendingQuestions | null>npm run typecheck passes Types updated to array-based questions
Before:
export interface AgentWaitingEvent extends DomainEvent {
type: 'agent:waiting';
payload: {
agentId: string;
name: string;
taskId: string;
sessionId: string;
question: string;
options?: Array<{ label: string; description?: string }>;
multiSelect?: boolean;
};
}
After:
export interface AgentWaitingEvent extends DomainEvent {
type: 'agent:waiting';
payload: {
agentId: string;
name: string;
taskId: string;
sessionId: string;
questions: Array<{
id: string;
question: string;
options?: Array<{ label: string; description?: string }>;
multiSelect?: boolean;
}>;
};
}
<success_criteria>
- All tasks completed
- Agent output schema uses
questionsarray (not single question) - PendingQuestions type uses array
- AgentWaitingEvent payload uses questions array
- Each question has
idfield for answer matching </success_criteria>