Repository navigation
[Story 5.1] Cross-epic integration test suite #378
Description
Part of #360 (Epic 5: Cross-Epic Integration Validation).
Depends on: All of Epics 1–4 (#356, #357, #358, #359).
Context
Each story has unit tests against its own boundaries, but no test exercises the full path: parallel tool dispatch → one tool triggers new_task → TaskScheduler manages subtask → child completes → parent resumes with result. This is where cross-component bugs surface. Using Gemini CLI's wave-based execution log pattern: an executionLog: string[] array traces the full lifecycle and ordering invariants are asserted against it.
Developer Notes
Create src/__tests__/parallel-integration.spec.ts:
- Wire real implementations of
TaskScheduler,TaskRegistry,DispatchState, andToolExecutionContextwith mocked I/O (mock LLM responses, mock file system, in-memoryTaskHistoryStore). - Use sequential Vitest execution (not
test.concurrent) — these tests have inherent ordering dependencies. - Use
vi.useFakeTimers()+ controlled promises for deterministic scheduling.
Test scenarios:
-
Parallel read tools:
[read_file, list_files]→ both start concurrently (wave 1). AssertexecutionLoghas both start events before either end event. -
Mixed parallel + sequential:
[read_file, execute_command]→read_filein wave 1,execute_commandin wave 2 after wave 1 completes. -
Parallel dispatch triggers subtask:
[read_file, new_task]→read_filecompletes in wave 1,new_taskdispatched sequentially in wave 2. Scheduler creates child task, parent suspends. Assert semaphore permit acquired. -
Child completion resumes parent: From scenario 3, child completes → scheduler releases permit → parent resumes with
tool_resultinuserMessageContent. -
Rejection cancels unstarted tools:
[read_file_A, read_file_B, write_to_file]withpLimit(2)→ A and B dispatched, write_to_file queued. User rejects A → write_to_file cancelled. B finishes normally. Assert 3 results:tool_denied,tool_result,tool_cancelled. -
maxConcurrency = 1backward compatibility: Scenarios 1–4 withmaxConcurrency = 1and flag off. Assert strictly serial execution matching current behavior.
Files: src/__tests__/parallel-integration.spec.ts (new)
Acceptance Criteria
- All 6 scenarios pass.
maxConcurrency = 1scenarios produce identical execution logs to current serial behavior.- No flaky tests — all timing controlled via fake timers and controlled promises.
Activity
zoomote commentedon Aug 21, 2026
Please include #1308 in cross-epic coverage: queue a user message while a child is running, let the child reach
attempt_completion, assert completion is interrupted, the parent remains delegated, and the child receives/processes the queued message. This verifies queue semantics across dispatch, delegation, and parent wakeup.