Repository navigation
Conversation
The hook was rewritten in 34502dd (OSS public release) to drop sessionStorage idempotency, crypto.randomUUID fallback and the retryStatus API, and the ToolsPage caller was updated in the same commit. The test suite was left behind, still mocking postWithSignal / getWithSignal and expecting the old submit({})/retryStatus() contract, which made all 7 tests in this file fail. Rewrite the tests against the current contract: api.post(path, args) / api.get(url), submit(path, args), busy/status/result/queryError states, polling via timers, no double-submission on rapid clicks and no re-submission after a failed status query.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Commit 34502dd (OSS public release) rewrote
useToolTest.ts(143 → 90 lines): it dropped sessionStorage idempotency,crypto.randomUUIDfallback and theretryStatusAPI, and theToolsPagecaller was updated in the same commit. However, the test suite was left behind — it still mockedpostWithSignal/getWithSignaland expected the oldsubmit(obj)/retryStatus()contract, which made all 7 tests inuseToolTest.test.tsxfail (api.post is not a function).The broken tests were not caught by CI because the GitHub Actions workflow only runs the Python test suite, not the frontend vitest suite.
Fix
Rewrite the tests against the current hook contract:
api.post(path, args)/api.get(url)submit(path, args)signature andbusy/status/result/queryErrorstate machineVerification
npx vitest run: 59 files / 294 tests all pass (previously 7 failed)npx tsc --noEmit: passesNote
This is a test-only change (no runtime behavior affected).