Skip to content

cmux NEXT: a hidden tab too busy to answer the hibernation probe freezes - #23980

Merged
teamleaderleo merged 6 commits into
feat-cmux-nextfrom
probe-unknown-freezes
Oct 22, 2026
Merged

teamleaderleo merged 6 commits into
feat-cmux-nextfrom
probe-unknown-freezes

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Leo-ask: ask-a3c16b28b7
Leo-ask: ask-8f7a35dd52

Leo, 2026-10-21: "AUDIT MY CURRENTLY RUNNING APP WHERE CAN WE MAKE THINS MORE FUCKING EFFICIENT" and "WHERE IS ALL THE CPU AND RAM COMING FROM".

We audited Leo's running cmux read-only. The hottest Chromium page renderer averaged 25% CPU with a 586 MB footprint, and the GPU process another 25%. One way a hidden page ends up like that is in BrowserHibernation. Before a hidden page freezes (30 s) or hibernates, a probe asks it, with a 2 s deadline, whether it plays media or holds form edits. If the probe threw or missed the deadline, the page was treated as playing media. A page busy enough to miss the deadline therefore:

  • never froze;
  • never hibernated;
  • was asked again every 30 s for as long as it stayed hidden.

The busiest pages were the ones that never slept.

Change

  • A probe the page does not answer is now unknown, not "playing" (PageProbe.answered).
  • The tab's last media report still counts.
    • The media the tab last reported still keeps it awake: audible, playing while the tab is muted, or Picture in Picture.
    • The page's media script pushes that state (BrowserTabState.media), so reading it needs no round trip to the busy page.
  • Native signals. I found:
    • WebKit reports camera and microphone use natively. That is the planner's isCapturing, which already excludes the page before any probe.
    • Chromium reports neither capture nor audible state to the app. The CEF audio callbacks are not wired.
    • So a Chromium page's Web Audio and capture are known only from its recorder's answer.
  • Freeze. After 3 unanswered probes in a row, the page freezes. Any answer, a show or a close resets the count.
    • Why 3: one miss can be a load or a pause of a few seconds. Three in a row, freezeSeconds apart (about 90 s), mean a page busy the whole time.
    • A freeze loses nothing: the page thaws when shown or driven.
  • Hibernation.
    • An unanswered page gets its own unanswered exemption (it used to be reported as audio).
    • It hibernates only under memory pressure, after 3 unanswered probes, because its form edits are unknown.
    • When the hibernation probe thaws a page that is past its 3 probes and keeps it, the page freezes again right away.
  • Every existing guard still applies:
    • pinned tabs
    • excluded hosts
    • DevTools
    • capture
    • reported media
    • neighbor and hovered tabs
    • an agent's 30 s grace
    • freezeHiddenTabs: "off"

Tests

UnansweredPageProbeTests (committed red first, e519a0d):

  • A page that does not answer is not "playing media".
  • A page that does not answer but reported audible media stays awake. This is a guard and passes on both commits.
  • A real hidden WebKit page that spins its main thread, so every probe misses its deadline, freezes. On the base it never does.

Changelog

  • Fixed: a hidden browser tab too busy to answer now freezes instead of using CPU for as long as it stays hidden.

No capture: nothing drawn changes.

Observed / Not run

  • Observed on the fleet (aws-m4pro-5), with the focused command cmux-ci run --class light --script scripts/ci/package-test-lane.sh --arg suite --arg Packages/macOS/CmuxNext --arg <suites>:
    • Red, at 6b3aea0: the red test alone on today's base 4e912c0, branch probe-unknown-freezes-red-evidence. The first red commit, e519a0d, never ran its tests: the base's web step failed until ci: the agent pane page ships the Inspector's ContextSection.css (base red since #23789) #23935 landed. UnansweredPageProbeTests failed 2 of 3:
      • aPageThatDoesNotAnswerIsNotPlayingMedia: the probe gave playingMedia: true, so the exemption was .audio.
      • aHiddenPageTooBusyToAnswerFreezes: the busy page never froze within 15 s.
      • The media guard passed, as expected on the base.
    • Green, at the head def9c19: all 5 suites passed. UnansweredPageProbeTests passed 3 of 3, and the busy page froze in about 6.8 s. HiddenPageFreezeTests, NeighborTabsWakeTests, HiddenPageHibernationTests and NeighborTabsTests also passed.
  • Not run: a live CEF page in a tagged app. The unit and WebKit tests drive BrowserHibernation through the freezer seam, which is the path Chromium pages take in the app.
  • Not measured: how much of the audited 25% renderer came from this path. The audit could not map renderers to tabs; cmux browser list reports no renderer PID.

Agent session: Air-Blue

🤖 Generated with Claude Code

teamleaderleo and others added 3 commits October 21, 2026 18:15
A probe the page did not answer (a script error, or no reply within its
2 s deadline) counted as playing media, so the page never froze and was
asked again every 30 s while hidden. It now counts as unknown: after 3
in a row the page freezes; it hibernates only under memory pressure,
since its form edits are unknown. The media the tab last reported still
keeps it awake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2c-7e44-7fc1-abd1-eae4a427ac80&host=Air-Blue
…e freeze guards

Freezing off, an agent's grace, neighbors and hovered tabs still keep it awake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2c-7e44-7fc1-abd1-eae4a427ac80&host=Air-Blue
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review def9c19: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr23980 -f ref=probe-unknown-freezes -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base 4e912c0; does not block

@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 22, 2026
… a show, and not past a reported call

A freeze probe no longer starts beside the hibernation probe of the same
page; a probe that ends after the page was shown counts nothing; a page
whose last answer reported capture or Web Audio stays awake while later
probes go unanswered (Chromium reports neither natively).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2c-7e44-7fc1-abd1-eae4a427ac80&host=Air-Blue
@blacksmith-sh

blacksmith-sh Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Found 12 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpjdpeo8w9/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpw4mjm3t5/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
nightly cmux-tui resolve/nightly cmux-tui resolve View Logs
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules)/
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules)
View Logs
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules) (job='web-bundles')/
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules) (job='web-bundles')
View Logs

...and 2 more test failures. View all on Blacksmith

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

@cursor

cursor Bot commented Oct 22, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

A page the hibernation probe thawed is refrozen by the freeze probe that
runs beside it in the same replan, as before; the hibernation probe reads
the count and records answers. Drops the refreeze in prepare.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d2c-7e44-7fc1-abd1-eae4a427ac80&host=Air-Blue
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next crash-class rules / cmux-next crash-class rules is red on 11 of 11 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent, correctness first): SHIP at 6158387

An independent acpmux Claude reviewer read three rounds. It found two problems, both since fixed:

  • 2a85c0e: HOLD. The refreeze in prepare skipped the neighbor, hover and agent guards and the freeze-off setting. Fixed in 2c50bfe.
  • 3a5a4d9: HOLD. Its !probing filter stopped refreezing pages that prepare keeps. Reverted in 6158387; only the freeze probe now counts misses.

It gave SHIP at 6158387 with two non-blocking nits:

  • Hibernate Tab clears answeredBusy, which needs a rare sequence of events.
  • One branch in doubts is unreachable.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent, correctness first): SHIP at def9c19

def9c19 merges the base (it includes #23935) into the reviewed 6158387. The PR diff is unchanged: git diff origin/feat-cmux-next...def9c19 is byte-identical to the one passed at 6158387. A fresh reviewer confirmed this by reading both diffs and the merged BrowserHibernation.swift. Its reds that are not this PR's:

  • Namespace-type errors in ChiefWorkspaceName.swift and AttentionHighlightLook.swift.
  • The test_cmux_next_checks_workflow submodule-reset test.
  • Guard status and release-notary.

The BrowserHibernation.swift god-file warning is warn-only. The file was already over the ceiling on the base, at 530 lines.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-3lsfx created for this PR by the cmux coordinator.

@teamleaderleo
teamleaderleo merged commit 8bb848b into feat-cmux-next Oct 22, 2026
@teamleaderleo
teamleaderleo deleted the probe-unknown-freezes branch October 22, 2026 04:42
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

1 inactive deployment
ci-routing-agent — def9c19d Deployed Oct 22, 2026 by teamleaderleo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant