Skip to content

test(hooks): add test coverage for model-fallback hook#4521

Open
Hungdoan565 wants to merge 2 commits into
code-yeongyu:devfrom
Hungdoan565:test/model-fallback-hook-coverage
Open

test(hooks): add test coverage for model-fallback hook#4521
Hungdoan565 wants to merge 2 commits into
code-yeongyu:devfrom
Hungdoan565:test/model-fallback-hook-coverage

Conversation

@Hungdoan565

@Hungdoan565 Hungdoan565 commented May 26, 2026

Copy link
Copy Markdown
Contributor

Add 17 tests for the model-fallback hook's FallbackStateController covering:

  • setSessionFallbackChain / getSessionFallbackChain (defensive copy, undefined, empty sessionID)
  • clearSessionFallbackChain
  • setPendingModelFallback (no chain, empty chain, valid chain, already pending, chain exhausted, agent requirements fallback)
  • getNextFallback / clearPendingModelFallback
  • reset

Summary by cubic

Add 17 unit tests for the model-fallback FallbackStateController covering session chain I/O, pending fallback setup, next-fallback retrieval, and reset/cleanup, including undefined/empty chains, agent-derived chains, already-pending/exhausted chains, and defensive copies. Sync bun.lock platform binaries for oh-my-opencode-* to 4.5.1.

Written for commit 8c21c83. Summary will update on new commits. Review in cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant