Skip to content

Stub the low-disk check in the tool-approval harness - #11552

Merged
danielhanchen merged 1 commit into
mainfrom
fix/tool-approval-harness-stubs-the-disk-check
Sep 22, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/tool-approval-harness-stubs-the-disk-check

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Frontend build + bundle sanity is red on main. 8458 pass, 3 fail, all three in studio/frontend/tests/tool-approval-gone.test.ts:

not ok 7799 - an approval that is no longer pending throws the typed error, not a bare one
not ok 7800 - a transport failure stays an ordinary error, so retrying is still offered
not ok 7801 - a matched decision still resolves true

Each on the same cause:

Error: no stub for import "@/features/settings/low-disk-check" in .../features/chat/api/chat-api.ts
    at requireStub (tests/helpers/module-stubs.ts:58:11)

Neither PR is wrong

The harness loads chat-api.ts through loadWithStubs, 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.

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):

"@/features/settings/low-disk-check": { checkDiskSpace: () => Promise.resolve() },

chat-api.ts calls checkDiskSpace() 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.ts should 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)
  • whole frontend suite on main with this applied: 8465 pass, 0 fail

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.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T16:03:43.946940Z ea363d8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: ea363d8a81

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit ffbc3a5 into main Sep 22, 2026
37 of 41 checks passed
@danielhanchen
danielhanchen deleted the fix/tool-approval-harness-stubs-the-disk-check branch September 22, 2026 16:05
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
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.
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