Repository navigation
Automate agent-flow (stuck-state) coverage as e2e with a stub model - #1621
Conversation
…covery, download terminal states (closes #1526) Covers the acceptance criteria that existing tests structurally couldn't reach: - Daemon-level ai-chat tests (real NodeService + SQLite, stub inference engine): send->idle with no stuck processing, stuck-processing recovery on watcher restart, turn cancellation resetting to idle with no stray token, and engine reuse across a second message. - Model-download terminal-state tests driving perform_download directly against a hand-rolled local HTTP server (the real catalog only resolves against hardcoded multi-GB HuggingFace URLs, so this is the actual seam): successful download + SHA-256 verification, progress events, verification failure cleanup, and mid-stream cancellation leaving no partial file. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_011wp5Fqs59SBSGYNvejgWqC
Code Review: PR #1621 — Automate agent-flow (stuck-state) coverage as e2e with a stub modelReview type: Initial review (no prior reviews found on the PR). SummaryThis PR adds 8 new All 8 new tests pass locally ( Requirements Check (issue #1526)
Step 6 — Overlap / Redundancy Investigation (as requested)Layer comparison:
Findings:
Architectural Design & IntegrityNo concerns — this PR touches only test modules, uses the existing Functionality & Correctness
SecurityNo production code changed. The two hand-rolled fake HTTP servers:
Maintainability & ReadabilityStrong. Both new test blocks are prefaced with clear "why this seam, not that one" doc comments explaining exactly why Nit: The comment block starting at Testing Strategy & RobustnessExcellent test-to-risk ratio for a test-only PR. Each of the 8 new tests targets a distinct, previously-unreachable failure mode (termination, reuse, recovery, cancellation, checksum success, checksum failure, progress reporting, cancel-with-cleanup) rather than re-asserting the same path repeatedly. Confirmed via direct execution: all pass, ~0.3s combined, no flakiness across 5 repeated runs, no Performance & ScalabilityNot applicable — test-only change, and the tests themselves are fast (sub-second), so no negative impact on CI wall-clock time. Dependencies & DocumentationNo new third-party dependencies — Triage Matrix[Critical/Blocker]: None. [Improvement]:
[Nit]:
RecommendationAPPROVE. This is a clean, well-reasoned, test-only PR that measurably improves coverage of a real, previously-manual-only bug class (stuck processing state, engine-reuse correctness, download cancellation cleanup) at an appropriate and well-justified architectural seam. It does not, by itself, add new Tauri-stack e2e test files, but a full investigation confirms that ask was already satisfied by unrelated prior PRs (#1563/#1610), and this PR's own doc comments correctly and transparently explain why those existing e2e tests can't reach the specific failure modes covered here. The one improvement worth tracking (real e2e coverage silently skipping without a pre-provisioned model) is a pre-existing gap this PR does not worsen, and is better addressed as separate follow-up work rather than a blocker on this PR. |
malibio
left a comment
There was a problem hiding this comment.
RECOMMENDATION: APPROVE (posted as --comment because GitHub blocks self-approval on your own PR; author and reviewing account are the same here). Test-only PR (+549/-0, both hunks entirely inside pre-existing #[cfg(test)] mod tests blocks, verified via diff). All 8 new tests pass, stable across 5 repeated runs, no #[ignore], no network/model dependency. Confirmed via investigation that this closes acceptance criterion 1 (stub-engine agent-loop coverage: termination, reuse, recovery, cancellation) at a well-justified integration seam; criterion 2 (e2e ai-chat send/idle + download terminal state) was already closed by pre-existing Tauri-layer tests in PR #1563/#1610 — this PR's new tests are complementary (cover failure modes the real-model e2e tests structurally can't reach), not duplicative. One follow-up worth tracking separately: the pre-existing e2e test silently skips without a pre-provisioned GGUF file, so the original bug has no guaranteed-to-run e2e coverage on a clean CI box — not a regression from this PR, but still an open gap. Full review posted as a separate PR comment above.
Per project convention, code comments describe behavior directly rather than referencing ticket numbers. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_011wp5Fqs59SBSGYNvejgWqC
Closes #1526