Repository navigation
Stub the low-disk check in the tool-approval harness - #11552
Conversation
Frontend build + bundle sanity is red on main: 8458 pass, 3 fail, all in tool-approval-gone.test.ts, each on no stub for import "@/features/settings/low-disk-check" in chat-api.ts Neither PR involved is wrong. #11439 added the import to chat-api.ts at 06:08 and updated every harness that existed then. #10365 landed at 08:15 with a new harness written against a chat-api.ts that did not have the import yet, so it passed on its own base and failed once the two met on main. Stub it the way the sibling harnesses already do. The whole frontend suite goes 8465 pass, 0 fail.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Frontend build + bundle sanity is red on main: 8458 pass, 3 fail, all in tool-approval-gone.test.ts, each on no stub for import "@/features/settings/low-disk-check" in chat-api.ts Neither PR involved is wrong. unslothai#11439 added the import to chat-api.ts at 06:08 and updated every harness that existed then. unslothai#10365 landed at 08:15 with a new harness written against a chat-api.ts that did not have the import yet, so it passed on its own base and failed once the two met on main. Stub it the way the sibling harnesses already do. The whole frontend suite goes 8465 pass, 0 fail.
Frontend build + bundle sanityis red on main. 8458 pass, 3 fail, all three instudio/frontend/tests/tool-approval-gone.test.ts:Each on the same cause:
Neither PR is wrong
The harness loads
chat-api.tsthroughloadWithStubs, which throws on any import it was not given a stub for. That is deliberate: it stops a unit test quietly pulling in real modules.18bc51009, 06:08) addedimport { checkDiskSpace } from "@/features/settings/low-disk-check"tochat-api.ts, and updated every harness that existed at that point.0270575f5, 08:15) addedtool-approval-gone.test.ts, written against achat-api.tsthat did not have that import yet.Each was green on its own base. The failure only exists in the combination, which neither branch ever built. Nothing here is a defect in either change.
The change
One line, stubbing it exactly as the sibling harnesses do (
chat-save-conflict-detail,load-warning-toast):chat-api.tscallscheckDiskSpace()in two places and ignores the result (void checkDiskSpace()), so a resolved promise is a faithful stand-in and not a behaviour change under test.On robustifying further
I looked at whether the 13 harnesses referencing
chat-api.tsshould share one stub map, so the next import is added in one place. Only 4 of them stub this module and the other 9 never reach it, so a shared map would be a rewrite of working test infrastructure without buying correctness. I left it alone.Worth noting what would actually prevent this class: requiring branches to be up to date before merge. A test cannot catch a pair of changes that are each green on their own base and only conflict semantically once merged. That is a repo setting rather than something to change from a pull request.
Verification
tests/tool-approval-gone.test.ts: 6 pass, 0 fail (was 3 fail)