Skip to content

Repair the two frontend CI breaks main inherited from #11373 - #11416

Merged
danielhanchen merged 2 commits into
mainfrom
ci/sidebar-drag-test-narrows-stay
Sep 21, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
ci/sidebar-drag-test-narrows-stay

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

The break

Frontend CI fails typecheck on main itself, and has been since planSidebarDrop started answering STAY:

tests/sidebar-row-drag.test.ts(106,25): error TS2339: Property 'action' does not exist on type 'SidebarDropPlan | "stay"'.
... 61 errors in that one file

The planner returns SidebarDropOutcome = SidebarDropPlan | typeof STAY | null. The test reads .action, .cue and .effects straight off that. assert.ok(plan) rules out null and leaves "stay", so every dereference is an error.

Every open pull request inherits it. Frontend CI is red on main, so it is red on all of them, and none of them touched the sidebar.

The fix

A plannedDrop helper that rules out both and returns the plan:

function plannedDrop(outcome: SidebarDropOutcome, message?: string): SidebarDropPlan {
  assert.ok(
    outcome !== null && outcome !== STAY,
    message ?? `expected a drop plan, got ${String(outcome)}`,
  );
  return outcome;
}

Asserting instead of casting is the point. A cast would make the type error go away and leave a test that reads undefined off a string when the planner answers STAY, failing somewhere that does not say why. This fails at the call, naming what came back.

27 plan bindings are wrapped, two inline ?. dereferences with it, and the assert.ok lines that only checked for null are dropped where the helper already covers them. The tests that expect STAY or null are untouched: they compare the outcome directly and never dereference it.

The second break, same cause

ToolGroupRoot started reading message.status through useAuiState in the same merged PR. That hook throws outside an AuiProvider, and smoke-tool-activity-main.tsx renders those primitives on their own, so the page died before publishing __probeReady:

RuntimeError: the harness page never published __probeReady (chromium). Page errors:
You are using a component or hook that requires an AuiProvider.

That is the Tool activity collapse regression (Playwright) job, red on main since.

The harness has no runtime and no message, and "no message is running" is the scene it wants, so it now provides exactly what useAuiState uses: a subscribe for useSyncExternalStore and the symbol-keyed state its selector reads. Anything else a component reaches for still throws, deliberately. Faking a whole client would hide the next dependency like this one instead of surfacing it.

Checked in chromium against the dev server, both ways:

__probeReady page errors
without this change undefined requires an AuiProvider
with it published none, 14 probe elements render

The sibling smoke-collapse-layout harness renders no tool group and was already clean; it was loaded the same way to confirm.

I could not run the Playwright job itself here, since it drives a full Studio with a model loaded. What is verified is the thing that was failing: the page now reaches __probeReady.

Checks

  • npx tsc -b clean, npx tsc -p tsconfig.test.json clean, both from 61 errors.
  • npm test in studio/frontend: 8165 passed, 0 failed.
  • prettier and eslint clean on the changed file.
  • Test-only: no src/ file is touched, so no app behaviour moves. The two changed files are a test and a test harness page.

Pairs with #11404, which fixes the three Python contract guards that are red on main for the same reason. Between them, an open PR's CI starts meaning something again.

Frontend CI has been failing typecheck on main since planSidebarDrop
started answering STAY. Its return type is SidebarDropPlan | STAY |
null, and the test read .action, .cue and .effects straight off that,
which is 61 errors in one file and a red Frontend CI on every open pull
request.

assert.ok only rules out null, so a plannedDrop helper rules out both
and returns the plan. Asserting rather than casting is the point: where
a test expects a plan and the planner answers STAY, it now fails saying
so, instead of reading a property off a string somewhere further on.

Two inline dereferences that used ?. are wrapped the same way, and the
asserts that only checked for null are gone where the helper already
covers them.

Test-only. tsc -b and tsc -p tsconfig.test.json are both clean, and the
frontend suite is 8165 passed, 0 failed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 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-21T07:02:34.029222Z 6820f7e 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.

ToolGroupRoot started reading message.status through useAuiState in
#11373. useAuiState throws outside an AuiProvider, and the harness page
renders those primitives on their own, so it died before publishing
__probeReady and the Tool activity collapse regression job has failed on
main ever since.

The page has no runtime and no message, and "no message is running" is
the scene it wants, so it provides the two things useAuiState actually
uses: a subscribe for useSyncExternalStore and the symbol-keyed state
its selector reads. Anything else a component reaches for still throws,
which is the right outcome for a harness: faking a whole client would
hide the next dependency like this one.

Verified in chromium against the dev server, with the page loaded both
ways:

  without this change  __probeReady undefined, page error
                       "You are using a component or hook that requires
                       an AuiProvider"
  with it              no page errors, 14 probe elements, __probeReady
                       published

The sibling collapse-layout harness does not render a tool group and
was already clean; it was checked the same way.
@danielhanchen danielhanchen changed the title Narrow the drag planner's outcome before reading a plan off it Repair the two frontend CI breaks main inherited from #11373 Sep 21, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 21, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 6820f7e181

ℹ️ 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 598e8ed into main Sep 21, 2026
47 of 48 checks passed
@danielhanchen
danielhanchen deleted the ci/sidebar-drag-test-narrows-stay branch September 21, 2026 07:16
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…unslothai#11416)

* Narrow the drag planner's outcome before reading a plan off it

Frontend CI has been failing typecheck on main since planSidebarDrop
started answering STAY. Its return type is SidebarDropPlan | STAY |
null, and the test read .action, .cue and .effects straight off that,
which is 61 errors in one file and a red Frontend CI on every open pull
request.

assert.ok only rules out null, so a plannedDrop helper rules out both
and returns the plan. Asserting rather than casting is the point: where
a test expects a plan and the planner answers STAY, it now fails saying
so, instead of reading a property off a string somewhere further on.

Two inline dereferences that used ?. are wrapped the same way, and the
asserts that only checked for null are gone where the helper already
covers them.

Test-only. tsc -b and tsc -p tsconfig.test.json are both clean, and the
frontend suite is 8165 passed, 0 failed.

* Give the tool-activity harness the provider its components now need

ToolGroupRoot started reading message.status through useAuiState in
unslothai#11373. useAuiState throws outside an AuiProvider, and the harness page
renders those primitives on their own, so it died before publishing
__probeReady and the Tool activity collapse regression job has failed on
main ever since.

The page has no runtime and no message, and "no message is running" is
the scene it wants, so it provides the two things useAuiState actually
uses: a subscribe for useSyncExternalStore and the symbol-keyed state
its selector reads. Anything else a component reaches for still throws,
which is the right outcome for a harness: faking a whole client would
hide the next dependency like this one.

Verified in chromium against the dev server, with the page loaded both
ways:

  without this change  __probeReady undefined, page error
                       "You are using a component or hook that requires
                       an AuiProvider"
  with it              no page errors, 14 probe elements, __probeReady
                       published

The sibling collapse-layout harness does not render a tool group and
was already clean; it was checked the same way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant