Skip to content

acpmux tests: usageStats expects the 400K autocompact window acpmux starts Claude with (base red from #31936) - #32312

Merged
cmux-bot[bot] merged 1 commit into
feat-cmux-nextfrom
base-red-usage
Nov 2, 2026
Merged

cmux-bot[bot] merged 1 commit into
feat-cmux-nextfrom
base-red-usage

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the base red from #31936.

What

fork_through::usage_stats::the_session_list_and_info_carry_what_the_chats_transcript_says (added by #28015) fails on every feat-cmux-next push since #31936 landed:

assertion `left == right` failed: {"autocompact":"capped","autocompactCap":400000,...}
  left: String("capped")
 right: "none"

#31936 makes acpmux start every Claude Code session whose person set no window with CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000, and report it as autocompact: capped, autocompactCap: 400000. That is the intended behavior. This test still expected the old none for a chat with an empty Claude home and a temp-dir folder. #31936 updated the unit test (usage_stats_tests) but not this integration test.

The product is right, so only the test changes:

  • It expects autocompact: capped at harness_limits::CLAUDE_AUTOCOMPACT_WINDOW (not a copied literal).
  • A second chat asks the fake Claude for CLAUDE_CODE_AUTO_COMPACT_WINDOW, so the cap the list reports is the one the harness really runs with. If the spawn rule and the report rule drift apart, the test fails.

Changelog

none

Testing

Command: cmux-ci run --class isolated --script scripts/ci/cmux-tui-rust-check.sh --os linux --arg test --arg the_session_list_and_info_carry_what_the_chats_transcript_says --ref SHA, 5 runs each side.

  • Base 741fb0170111 (red): failed 5/5 (left: String("capped"), right: "none"): jobs 2c523624a919409cb0e7f492, 423936e8ef312ded3398a7df, 3ee38634d49f35d730d60c0f, a27867ef112138f5fcf1f231, 6cf826e7c58ec8e055804844
  • Head (green): passed 5/5 at ecd406b80a72795f23d6fd05a6979393276672f2 (1 test run, 1 passed): jobs 53dff0a15d564535f9c0dd22, 50cd0d243239c3f73ab96ba1, 9e54562e7f885c1b0eee7fe9, 4aada263df514c5adddda909, ad5ec28a8eb0173a8f584896
  • Earlier base 7233516b7cc4: job 0a95b7d3fe634947d7023898 failed the same way, also on its alone-rerun.

Observed / Not run

  • Observed: the fleet runs above (Linux, Blacksmith). prepush-gate.py: no new violations.
  • Not run: macOS. The test has no cfg(target_os) gate and the cap rule does not depend on the OS.
  • Not run: clippy (the feat clippy red in cmux-tui-core/src/mux/tests/read_paths.rs is another agent's fix); the test mode lane does not run clippy.

risk: low (test only)

…cpmux started it with (base red from #31936)

#31936 starts every Claude Code session whose person set no window with
CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000 and reports it as autocompact
"capped" at 400000. fork_through::usage_stats still expected the old
"none" for a chat with an empty Claude home and a temp-dir folder, so it
failed on every feat push since. The product is right; the test now
expects harness_limits::CLAUDE_AUTOCOMPACT_WINDOW, and a second chat
asks the fake Claude for its env, so the reported cap is the one the
harness really runs with.

Red: cmux-tui-rust-check.sh test the_session_list_and_info_carry_what_the_chats_transcript_says
at base fails (left "capped", right "none"); green at this head.
@lawrencecchen lawrencecchen added the risk:low Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@cursor

cursor Bot commented Nov 2, 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.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Review ecd406b: 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=pr32312 -f ref=base-red-usage -f platform=macos -f backend_mode=local

Shipped in:

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41454213833 at 986d466 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at f21d85e. This pull request is one of 5 merged since: #32305, #32312, #32182, #32265, #31743.
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.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (claude-opus-subagent): SHIP at ecd406b

Checked by reading only, with no local build. The test should change, not the product. #31936 meant every acpmux-started Claude session where the person set no window to run with CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000, and to report capped/400000. lift_claude (spawn) and read_usage (report) both use the same rule, claude_autocompact_unset. This test has an empty CLAUDE_CONFIG_DIR, a temp-dir cwd and no flag or env, so capped at the constant is the correct expectation.

The test compiles as far as I can tell. acpmux::harness_limits is pub mod, and CLAUDE_AUTOCOMPACT_WINDOW is a (&str, &str). Value has PartialEq with &str, u64 and String. hub.session_summary(&hub.resolve(..).unwrap()) has the same shape as the existing call in transfer_guard.rs.

The probe chat runs after every earlier assertion. The usage_stats events are filtered by the first session's id, so the probe does not change tokens24h or the event count.

The preview is the raw agent_message_chunk text. Each turn resets it, it is not masked, and short_text(160) does not cut the 38-character reply. fake_claude.py streams NAME=value for env: even with FAKE_CLAUDE_TRANSCRIPT_USAGE=1, which changes only the stored transcript.

The probe compares the reported cap with the env the spawned harness actually received, so the test fails if the spawn rule and the report rule drift apart.

Non-blocking: an ambient CLAUDE_CODE_AUTO_COMPACT_WINDOW or CLAUDE_AUTOCOMPACT_PCT_OVERRIDE in the test runner's env, or a .claude/settings.json in a temp-dir ancestor, would change the result. The old none expectation was exposed to the same ambient env, so this is not a regression.

@cmux-bot
cmux-bot Bot merged commit d6546f5 into feat-cmux-next Nov 2, 2026
193 of 208 checks passed
@cmux-bot
cmux-bot Bot deleted the base-red-usage branch November 2, 2026 13:27
@lawrencecchen lawrencecchen added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Nov 2, 2026

This branch was previously deployed

3 inactive deployments
artifacts — ecd406b8 Deployed Nov 2, 2026 by lawrencecchen via publish tree-addressed cmux-tui #101352
sentry-dsyms — ecd406b8 Deployed Nov 2, 2026 by lawrencecchen via upload cmux-tui dSYMs to Sentry #101352
ci-routing-agent — ecd406b8 Deployed Nov 2, 2026 by lawrencecchen via cmux-tui tree preflight #101352
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:low Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant