Skip to content

ci: run the renderer-memory gate and unblock the test registry - #13747

Merged
teamleaderleo merged 1 commit into
manaflow-ai:mainfrom
teamleaderleo:ci/renderer-memory-env-forward
Sep 22, 2026
Merged

teamleaderleo merged 1 commit into
manaflow-ai:mainfrom
teamleaderleo:ci/renderer-memory-env-forward

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Two preflight defects found while profiling app-host CI.

The renderer-memory regression test never runs

.github/workflows/ci-macos.yml runs its focused step with a plain CMUX_RENDERER_MEMORY_REGRESSION=1, but scripts/ci/run-app-host-xcodebuild.sh only forwards named TEST_RUNNER_* variables into the test host, and (as that script's own comment says) Xcode does not inherit the driver environment. So the guard at cmuxTests/TerminalAndGhosttyTests.swift:4248 has been skipping every run, and the one-versus-five renderer footprint has not been asserted in CI.

Fix: forward opt-in gate variables through the TEST_RUNNER_ channel. The workflow step is unchanged, so the same trap won't catch the next gated suite added the same way.

The test-execution registry fails on main

tests/test_sync_test_wiring.py is registered twice in tests/test-execution.toml, so scripts/ci/validate_test_execution_registry.py exits 1 on main and in every PR preflight that runs it. Dropping the duplicate makes it pass: 223 tests (legacy=61, linux-guard=101, macos-cli-no-socket=48, macos-cli-no-socket-post-fish=11, macos-shell=1, macos-shell-fish=1).

Testing

  • bash -n scripts/ci/run-app-host-xcodebuild.sh
  • python3 scripts/ci/validate_test_execution_registry.py (fails on main, passes here)
  • python3 tests/test_ci_linux_guard_routing.py

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Fixes two CI preflight defects: the renderer-memory regression test never ran, and the test-execution registry validation failed on main.

  • Forwards CMUX_RENDERER_MEMORY_REGRESSION through the TEST_RUNNER_ channel so Xcode test hosts pick it up; previously the guard skipped every run because Xcode doesn't inherit the driver environment.
  • Removes the duplicate tests/test_sync_test_wiring.py entry from tests/test-execution.toml that made scripts/ci/validate_test_execution_registry.py exit 1 on main and every preflight.

Written for commit 753ef17. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Improved automated test configuration by forwarding the renderer memory regression setting when enabled.
    • Cleaned up duplicate test registration while preserving the existing test coverage and execution mapping.

Two preflight defects:

The focused renderer-memory step exports a plain
CMUX_RENDERER_MEMORY_REGRESSION=1, but run-app-host-xcodebuild.sh only
forwards named TEST_RUNNER_* variables into the test host, and Xcode does
not inherit the driver environment. The guarded test has therefore been
skipping every run instead of asserting the one-versus-five renderer
footprint. Forward opt-in gate variables through the TEST_RUNNER_ channel.

tests/test_sync_test_wiring.py is registered twice in
tests/test-execution.toml, so validate_test_execution_registry.py fails on
main and in every pull request preflight. Drop the duplicate entry.

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

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c94ef1b0-5a43-4257-a591-c0059448e54f

📥 Commits

Reviewing files that changed from the base of the PR and between e6b3d6b and 753ef17.

📒 Files selected for processing (2)
  • scripts/ci/run-app-host-xcodebuild.sh
  • tests/test-execution.toml
💤 Files with no reviewable changes (1)
  • tests/test-execution.toml

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The app host build script forwards CMUX_RENDERER_MEMORY_REGRESSION through the test runner environment when set. The test execution registry removes a duplicate tests/test_sync_test_wiring.py entry.

Changes

Renderer Memory Gate

Layer / File(s) Summary
Forward renderer memory gate
scripts/ci/run-app-host-xcodebuild.sh
The script forwards a non-empty CMUX_RENDERER_MEMORY_REGRESSION value as TEST_RUNNER_CMUX_RENDERER_MEMORY_REGRESSION.

Test Registry Cleanup

Layer / File(s) Summary
Remove duplicate test registration
tests/test-execution.toml
The registry removes the duplicate linux-guard entry for tests/test_sync_test_wiring.py and retains the existing registration.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: lawrencecchen

Merge Risk: ⚪ Minimal · up to 753ef

The CI gate reaches the test host correctly, and the duplicate registry entry was removed without losing coverage.

🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes both main CI changes: enabling the renderer-memory gate and fixing the test registry.
Description check ✅ Passed The description explains what changed and why, and lists validation commands. It includes the required testing information. The checklist and review-trigger section are missing, but these omissions ar…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS. The pull request changes only app-host CI environment forwarding and removes one duplicate test-registry entry. The new loop forwards CMUX_RENDERER_MEMORY_REGRESSION through Xcode's existing `…
Cmux Swift Actor Isolation ✅ Passed The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. The authoritative diff contains no Swift files or Swift declarations, so it introduces no Swift a…
Cmux Swift Blocking Runtime ✅ Passed PASS: The pull request changes only a shell script and a TOML registry. It changes no Swift files and adds no blocking or timing synchronization primitive. The Swift blocking-runtime check is therefor…
Cmux Browser Automation Off-Main ✅ Passed PASS: The authoritative PR diff changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. It adds environment forwarding for CMUX_RENDERER_MEMORY_REGRESSION and removes a…
Cmux Expensive Synchronous Load ✅ Passed The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. It adds shell environment forwarding and removes a duplicate test registration. It adds or moves …
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. It contains no production Swift, TypeScript, or JavaScript changes, and it does not substit…
Cmux No Hacky Sleeps ✅ Passed PASS: The shell diff adds only environment-variable forwarding for CMUX_RENDERER_MEMORY_REGRESSION through TEST_RUNNER_. It adds no sleep, timer, polling loop, fixed delay, or wall-clock synchroni…
Cmux Algorithmic Complexity ✅ Passed PASS. The only new loop is in scripts/ci/run-app-host-xcodebuild.sh and iterates over the single literal CMUX_RENDERER_MEMORY_REGRESSION gate. It does not scan user-owned or scalable data. The reg…
Cmux Swift Concurrency ✅ Passed PASS: The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. The authoritative diff contains no Swift files or Swift concurrency code, so it does not in…
Cmux Swift @Concurrent ✅ Passed PASS: The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. The authoritative diff contains no Swift changes, so the @concurrent check is not applica…
Cmux Swift Package Boundaries ✅ Passed PASS: The authoritative pull-request diff changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. It contains no Swift source or Swift package changes, so the Swift packa…
Cmux Swiftpm Lockfiles ✅ Passed PASS: The authoritative PR diff changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. It contains no SwiftPM package, Package.swift, Xcode project/package-reference, …
Cmux Swift Logging ✅ Passed The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. It adds shell environment forwarding and removes a TOML registry entry. It adds no Swift logging …
Cmux User-Facing Error Privacy ✅ Passed The diff changes only CI tooling and the test execution registry. It forwards an opt-in environment variable to the macOS XCTest host and removes a duplicate internal test entry. The affected paths ru…
Cmux Full Internationalization ✅ Passed PASS. The PR changes only a CI shell script and the test-execution TOML registry. The added text is developer-only CI comments, and the added names are literal environment/config tokens. The TOML chan…
Cmux Swiftui State Layout ✅ Passed PASS: The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. The diff adds shell environment forwarding and removes a TOML test entry. It introduces no …
Cmux Architecture Rethink ✅ Passed PASS: The authoritative diff changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. It adds shell environment forwarding for CMUX_RENDERER_MEMORY_REGRESSION and remove…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. The authoritative diff contains no Swift files and adds or changes no auxiliary windows. Th…
Cmux Source Artifacts ✅ Passed The authoritative diff changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. These are an intentional CI script and test registry configuration. The diff adds environme…
Cmux No Test Or Debug Seam In Production Source ✅ Passed The pull request changes only scripts/ci/run-app-host-xcodebuild.sh and tests/test-execution.toml. It changes no Swift file under a production Sources/ path, so it cannot introduce a test or deb…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Triage note — this is the most under-noticed PR in the open queue and it should land first out of the registry cluster.

Verified against main at e6b3d6b394: python3 scripts/ci/validate_test_execution_registry.py fails right now with

Python test execution registry validation failed:
  - tests/test_sync_test_wiring.py: registered more than once

tests/test-execution.toml has that path at both line 534 and line 898. So guards / workflow-guard-tests / preflight is red on main and therefore on every open pull request, for a reason no PR author can see in their own diff. This PR is 13 changed lines across 2 files and clears it. Two comments, no review.

Conflict you need to know about: #13745 deletes the same four lines. Its tests/test-execution.toml hunk removes the duplicate test_sync_test_wiring.py block at line 898 — byte-identical to yours — and additionally adds an entry for the test file it introduces. Whichever lands first, the other needs a trivial rebase. I would land this one first: it is 13 lines against #13745's ~490, and the registry is red today.

Note that #13745 would not have prevented today's failure on its own. It downgrades unregistered tests inherited from the base branch to warnings, but explicitly keeps "malformed or duplicated entries" as hard failures. A duplicate entry on main still reddens every PR under #13745's rules. These two are complementary, not redundant, and both should survive.

The renderer-memory half is independent of all of that — scripts/ci/run-app-host-xcodebuild.sh forwarding only TEST_RUNNER_* while ci-macos.yml sets a bare CMUX_RENDERER_MEMORY_REGRESSION=1 is a clean find, and it means the guard at cmuxTests/TerminalAndGhosttyTests.swift:4248 has been a no-op. Nothing else in the queue touches that script except #13723 and #13414, which touch compile-app-host-test-product.sh, not this one.

Also closed today: #13712, which was opened to fix an earlier instance of exactly this "registry failure reddens every PR" problem. Its nine registrations are all on main now, so it was stale — but the failure mode it described is live again through the duplicate entry, which is what this PR fixes.

@teamleaderleo
teamleaderleo merged commit 4777efa into manaflow-ai:main Sep 22, 2026
45 of 47 checks passed
teamleaderleo added a commit to teamleaderleo/cmux that referenced this pull request Sep 22, 2026
`run-in-console-session.sh` re-enters the console user's Aqua session through
`sudo -n launchctl asuser ... sudo -n -u <user> -E env ...`. The outer sudo has
no `-E`, so the environment is reset there and rebuilt from an explicit
`forward=(...)` allowlist.

`CMUX_RENDERER_MEMORY_REGRESSION=1` was never added to that allowlist, so it did
not survive the hop. The opt-in forwarding added to `run-app-host-xcodebuild.sh`
in manaflow-ai#13747 therefore saw an unset variable, appended no `TEST_RUNNER_` pair, and
the regression kept skipping itself at TerminalAndGhosttyTests.swift:4187 — on
every run, while CI reported success.

Add the variable to the allowlist, and add a guard so the next opt-in gate does
not fail the same silent way: the guard walks every backslash-continued
assignment prefixing a `run-in-console-session.sh` call across all workflows and
fails if any name is missing from the allowlist. It fails on the unfixed tree
naming exactly this variable, and passes over all 34 call sites with the fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
teamleaderleo added a commit to teamleaderleo/cmux that referenced this pull request Sep 22, 2026
`run-in-console-session.sh` re-enters the console user's Aqua session through
`sudo -n launchctl asuser ... sudo -n -u <user> -E env ...`. The outer sudo has
no `-E`, so the environment is reset there and rebuilt from an explicit
`forward=(...)` allowlist.

`CMUX_RENDERER_MEMORY_REGRESSION=1` was never added to that allowlist, so it did
not survive the hop. The opt-in forwarding added to `run-app-host-xcodebuild.sh`
in manaflow-ai#13747 therefore saw an unset variable, appended no `TEST_RUNNER_` pair, and
the regression kept skipping itself at TerminalAndGhosttyTests.swift:4187 — on
every run, while CI reported success.

Add the variable to the allowlist, and add a guard so the next opt-in gate does
not fail the same silent way: the guard walks every backslash-continued
assignment prefixing a `run-in-console-session.sh` call across all workflows and
fails if any name is missing from the allowlist. It fails on the unfixed tree
naming exactly this variable, and passes over all 34 call sites with the fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Sep 22, 2026
…13776)

* ci: forward the renderer-memory gate across the console-session hop

`run-in-console-session.sh` re-enters the console user's Aqua session through
`sudo -n launchctl asuser ... sudo -n -u <user> -E env ...`. The outer sudo has
no `-E`, so the environment is reset there and rebuilt from an explicit
`forward=(...)` allowlist.

`CMUX_RENDERER_MEMORY_REGRESSION=1` was never added to that allowlist, so it did
not survive the hop. The opt-in forwarding added to `run-app-host-xcodebuild.sh`
in #13747 therefore saw an unset variable, appended no `TEST_RUNNER_` pair, and
the regression kept skipping itself at TerminalAndGhosttyTests.swift:4187 — on
every run, while CI reported success.

Add the variable to the allowlist, and add a guard so the next opt-in gate does
not fail the same silent way: the guard walks every backslash-continued
assignment prefixing a `run-in-console-session.sh` call across all workflows and
fails if any name is missing from the allowlist. It fails on the unfixed tree
naming exactly this variable, and passes over all 34 call sites with the fix.

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

* ci: harden the console-session forwarding guard against its blind spots

Review of the first version found the regex walk only inspected backslash-
continued lines strictly above the wrapper, so a single-line invocation
(FOO=1 scripts/ci/run-in-console-session.sh ...) was invisible -- the exact
shape the guard exists to catch. It also globbed .github/workflows/*.yml
non-recursively, missing .yaml and composite actions, and harvested names out
of comments inside forward=(), which would count a commented-out entry as
forwarded.

Parse the workflows as YAML and walk each step's run: block instead. Scan the
invocation line itself as well as its continuations, recurse over .github for
both extensions, and strip comments before reading the allowlist. Failures now
name the job and step rather than a line number.

Scope stayed at command prefixes deliberately. Extending it to ambient
environment -- step/job/workflow env: and plain export -- was tried and
produced 60+ false positives on the real workflows (CI cache URLs, Xcode
selection, shard indices), because the allowlist is intentionally selective.
A prefix is the explicit statement that a variable is meant for this command,
and it is the existing convention at every call site that needs one. The
docstring records this so the next reader does not re-litigate it.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
austinywang added a commit that referenced this pull request Sep 23, 2026
…on-screen window

The renderer-memory regression started asserting once #13747 and
#13776 carried CMUX_RENDERER_MEMORY_REGRESSION into the app host (the
second across the console-session hop); before that it skipped itself
on every run. It now fails in app-host shard 6 (run 35800041885): none
of the five renderers is ever presented, so every release and
restoration assertion after that fails too.

The fixture predates the portal rendering authority (a81d39e,
#12414). setVisibleInUI folds its request through
Workspace.portalRenderingEnabled(for:), which denies a tab id that no
registered manager has selected, and the test built its surfaces with
UUID(). Build them in a registered, selected workspace through a shared
AppDelegate test seam, the same registration the direct-interaction
suites use on fix/app-host-green.

The window was also ordered in after the terminals attached. A terminal
samples its window's visibility on attach and afterwards only on an
occlusion, key, or screen change. This borderless window never becomes
key and the headless host never reports occlusion .visible (the case
a1f0cf9 handles), so the renderers could keep seeing a hidden
window. Order it in first.

The memory thresholds and assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo pushed a commit that referenced this pull request Sep 23, 2026
* test: give the five-tab renderer gate a live portal workspace and an on-screen window

The renderer-memory regression started asserting once #13747 and
#13776 carried CMUX_RENDERER_MEMORY_REGRESSION into the app host (the
second across the console-session hop); before that it skipped itself
on every run. It now fails in app-host shard 6 (run 35800041885): none
of the five renderers is ever presented, so every release and
restoration assertion after that fails too.

The fixture predates the portal rendering authority (a81d39e,
#12414). setVisibleInUI folds its request through
Workspace.portalRenderingEnabled(for:), which denies a tab id that no
registered manager has selected, and the test built its surfaces with
UUID(). Build them in a registered, selected workspace through a shared
AppDelegate test seam, the same registration the direct-interaction
suites use on fix/app-host-green.

The window was also ordered in after the terminals attached. A terminal
samples its window's visibility on attach and afterwards only on an
occlusion, key, or screen change. This borderless window never becomes
key and the headless host never reports occlusion .visible (the case
a1f0cf9 handles), so the renderers could keep seeing a hidden
window. Order it in first.

The memory thresholds and assertions are unchanged.

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

* test: give the tmux mirror sizing fixtures manual-mirror panes and a settled start

offPlanGeometryWithUnchangedSizingInputsReconverges fails on main and on
fix/app-host-green. Its diagnostic on run 35800041885 (shard 3) read
rearmsAtPerturbation=3 rearmsDuringRecovery=0: the output-parity judge
had spent its whole re-arm budget before the test perturbed anything.
The fixture built process panels (.pacedSessionRestore). Once those are
authorized and on screen, a process surface's grid follows its view,
because the assigned-grid pin only holds manual-IO surfaces at tmux's
61x35 assignment. The judge's grid-parity half never cleared, so the
baseline spent all three re-arms and left none for the recovery the test
measures.

The fixture now builds its panes with Workspace.makeRemoteTmuxPanePanel,
the manual-mirror factory production mirrors use. It waits for grid
parity as well as frame parity before capturing its fixed point, and it
requires an unspent re-arm budget at the perturbation, so a starved
baseline fails as a precondition instead of reading like the liveness
hole the test pins.

swallowedDividerResizeIsProvenNoOpByTheBarrierAndHeals failed once on
the same shard at "no recovery may fire before the barrier's verdict"
and passed in other runs. Its convergence pump checked frames only.
Frames can match the plan while the render-frame restate, or any other
ignoring-inputs trigger, has cleared the completed sizing inputs and
queued a pass. The likely failure: the pump resumed in that gap, and the
synchronous test code after it never yields, so the test read the
cleared inputs and blamed the swallowed resize. The drag fixtures now
also wait for no scheduled pass and a completed sizing transaction, and
the swallowed, errored, and superseded divider tests require that state
before the drag starts. The divider-drag test's post-reply pump waits
for the same state before its late ack arrives.

No assertion changed.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo deleted the ci/renderer-memory-env-forward branch September 23, 2026 11:32
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