Multi-instruction parsing for batch chat requests#591
Conversation
Introduces a new method that accepts multiple instructions and produces a single multi-operation proposal for atomic review/approve/reject. Closes #574.
- Add ParseBatchInstructionAsync: combines multiple instructions into one multi-operation proposal with sequential operation numbering - Add TryParseBatchCardCreateAsync: parses "create cards: a, b, c" pattern into multiple card-create operations - Add TryParseOperationsAsync: extracted helper for single-instruction operation parsing, reused by both single and batch code paths - Integrate batch card pattern into ParseInstructionAsync as fallback - Enforce MaxBatchSize (30) operations per proposal - Each operation gets its own unique idempotency key - Add batch card pattern to SupportedPatterns for parse hints
When the LLM extracts multiple instructions, use ParseBatchInstructionAsync to create a single atomic proposal instead of separate proposals per instruction. Single-instruction paths remain unchanged for backward compatibility.
32 tests covering:
- Validation (empty list, empty userId, whitespace correlation ID)
- Batch card creation ("create cards: a, b, c" and variants)
- Multiple single-instruction batching
- Mixed operation types in a batch
- Partial success (some instructions parseable, some not)
- Max batch size enforcement (30 limit)
- Unique idempotency keys per operation
- Source metadata passthrough
- Summary generation
- Direct TryParseBatchCardCreateAsync helper tests
- Direct TryParseOperationsAsync helper tests
…tions The multi-instruction test now mocks ParseBatchInstructionAsync and verifies a single atomic proposal is created instead of separate proposals per instruction.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Adversarial Self-ReviewFindings1. Missing RegexOptions.Timeout on BatchCardCreateRegex (Low risk) 2. Code duplication in TryParseOperationsAsync (Design trade-off) 3. Batch card pattern silently swallows boardId-missing errors (Acceptable) 4. Permission validation after proposal creation (Pre-existing pattern) 5. No test for comma-in-title edge case VerdictNo bugs or security issues found. 32 new tests, all 1731 backend tests pass. Backward-compatible. |
Summary
ParseBatchInstructionAsynctoIAutomationPlannerServicethat accepts multiple instructions and produces a single multi-operation proposal for atomic review/approve/reject"create cards: meeting setup, IT onboarding, HR orientation"creates one proposal with multiple card-create operationsCloses #574
Test plan
dotnet test backend/Taskdeck.sln -c Release -m:1)AutomationPlannerBatchTestscover batch parsing logicChatServiceTestsupdated for batch behaviorPOST /chat/sessions/{id}/messageswith content like "create cards: task1, task2, task3"