Skip to content

cmux-next: stop the layout migration tests indexing past the defaults (Index out of range crash) - #18399

Merged
teamleaderleo merged 3 commits into
feat-cmux-nextfrom
op-next-layout-test-crash
Oct 7, 2026
Merged

teamleaderleo merged 3 commits into
feat-cmux-nextfrom
op-next-layout-test-crash

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes the base-red crash that hides every Swift result.

CmuxNextPackageTests dies with Swift/ContiguousArrayBuffer.swift:705: Fatal error: Index out of range (signal 5), so about 1,700 tests never report.

Cause: SIDEBAR-NO-RECENTS removed Recents from SidebarLayoutDocument.defaults, so the defaults now have three sections. Two tests in SidebarLayoutMigrationTests still replaced the footer with stored.sections[3] = …, an index past the end:

  • theGridBottomRowBecomesTheMinimalFooter
  • aCustomizedGridBottomIsKept

Fix: a helper finds the bottom section by bottomSectionID behind try #require. A future change to the defaults then fails one test instead of trapping the whole process. Test-only change.

With the crash gone, the run finishes and showed two more tests with the same Recents-era layout assumption. Both are fixed here:

  • aStoredRailLayoutBecomesTheSectionsDefaults expected the account in section 3; it now finds the bottom section by id.
  • aDestinationTurnsTheFooterIntoOneWideBackButton (from cmux-next sidebar: the footer becomes Back on a destination page #18326) measured Back against the bottom band. A bare sidebar's minimal footer (f3962c5) leaves that band empty, so Back sits at the bottom edge, as the app does. The test now expects that when the band is empty.

How it was found

  • I compared the tests that started but never finished across 9 crashed runs. That narrowed it to 16 tests, which include both of these.
  • The crash first appears on base at 37f48efa7d6 (run 37628869285) and is absent at 07637f3853e (run 37626290032, a full 7,136-test summary). That range is the all-chats / SIDEBAR-NO-RECENTS merge, which dropped recentsSection from the defaults.
  • Of all the sections[N] writes in the tests, only these two index the layout defaults past 2.

Testing

  • Red: base runs 37630490813 and 37640755528 (and 7 more) crash with both tests started and never finished.
  • Green: fleet step 6041c2f9a97d (head e564e23) has no crash, and both migration tests pass. The step for the current head follows in a comment.
  • Still red after the crash fix, and not touched here:
    • ContextMenuExportParityTests: a separate fix is waiting for the catalog queue.
    • Localization bundle tests (germanTableIsRead, everyKeyShipsInEnglishAndJapanese, theJapaneseTableIsRead, …): Bundle.module tables come up nil on the runner.

Changelog

none

🤖 Generated with Claude Code


Note

Low Risk
Changes are limited to Swift unit tests; no production sidebar or migration logic is modified.

Overview
Fixes test-only failures that were trapping the whole CmuxNextPackageTests run after SIDEBAR-NO-RECENTS shrank SidebarLayoutDocument.defaults to three sections.

SidebarLayoutMigrationTests stops writing stored.sections[3] when building grid-bottom fixtures. A new defaultsWithGridBottom() helper resolves the footer via bottomSectionID (with #require), and rail migration expectations locate the account item in that bottom section instead of assuming index 3.

SidebarFooterBackTests broadens back-button placement checks for the minimal footer: when the footer band is shorter than the button, the test expects alignment to the bottom edge rather than the (empty) band’s vertical center.

Reviewed by Cursor Bugbot for commit 18654d1. Bugbot is set up for automated code reviews on this repo. Configure here.

…p crashing

SIDEBAR-NO-RECENTS dropped Recents from SidebarLayoutDocument.defaults, so
the defaults have three sections. theGridBottomRowBecomesTheMinimalFooter
and aCustomizedGridBottomIsKept still wrote sections[3], an index past the
end, which traps (Swift/ContiguousArrayBuffer.swift:705: Index out of range)
and kills CmuxNextPackageTests, so about 1,700 tests never report. They now
find the bottom section by id behind #require.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 185c7d15-89e3-452c-b2a3-cd705f1c8a9d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Not verified: macOS jobs did not run: compile and app tests were skipped on 18654d1983; ci-status is green without them.

CI passes on 18654d1983 (run 37649825588 attempt 1).
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped (the macos job needs both to succeed). Re-run CI once they pass, before merging.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

With the crash gone, two tests the crash hid were red:
aStoredRailLayoutBecomesTheSectionsDefaults expected the account in
section 3, and aDestinationTurnsTheFooterIntoOneWideBackButton measured
Back against the bottom band, which a bare sidebar's minimal footer
leaves empty. The first now finds the bottom section by id; the second
expects Back at the bottom edge when the band is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo merged commit c5598f5 into feat-cmux-next Oct 7, 2026
67 of 84 checks passed
@teamleaderleo
teamleaderleo deleted the op-next-layout-test-crash branch October 7, 2026 20:53
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/37689519735 at 3e0a1ad failed: cmux-next generated files.
Those jobs last passed at a14deb7. This pull request is one of 4 merged since: #18399, #18200, #18401, #18431.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

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