Skip to content

cmux NEXT updater: a log file at ~/Library/Logs/cmux-next/<bundle>-updater.log - #34635

Open
teamleaderleo wants to merge 4 commits into
feat-cmux-nextfrom
lane/updater-file-log
Open

teamleaderleo wants to merge 4 commits into
feat-cmux-nextfrom
lane/updater-file-log

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Leo-ask: ask-8112d98df7

Leo, 2026-11-04: "i only clicked the "download" button and it allegedly "updated" but i didnt restart the app/get a prompt to?"

Two explanations are on record for that relaunch: #34612 cites an install click 3.3 s after Restart to Update appeared, and the #34477 helper concluded it was an automatic install that reopened cmux behind his frontmost app. Neither can be checked on his Mac: log show returns no com.cmuxterm.app.next updater lines there, not even for the last 5 minutes, and ~/Library/Logs/cmux-next holds no updater file. This adds that file, as classic's cmux-update.log was.

What changed

  • UpdateLogFile (new): every UpdateLogBuffer line also goes to ~/Library/Logs/cmux-next/<bundle>-updater.log (for example com.cmuxterm.app.nightly-updater.log) as <ISO 8601 time> [<pid>] <message>. Lines are written in order on one BackgroundWork files lane at one priority, never on the caller's thread. They are posted blockShutdown, so quit waits for the lines before an install's quit. At 1 MB the file moves to .1, replacing the older one, so the pair stays under 2 MB. A failed write drops only that line; memory and unified logging still have it. No timer and no observer.
  • UpdaterService.init logs a launch line with the version, build, track and pid, and says whether the launch was "reopened behind by an automatic install" (--cmux-update-reopened-behind). downloadClicked() and installClicked() each log the click and the flow phase. The checks, found and no-update results, which path installed (automatic=, Sparkle's silent stage, quit-for-install) and the relaunch reason were already log lines; they now persist.
  • No file in test processes (swiftpm-testing-helper, xctest, the XCTest variables) or with recordsUpdates: false.
  • logPath() (shown in update error details) gives the file's path when there is one.

Tests

UpdateLogFileTests: 50 lines reach the file in order with the pid; a full file moves aside before the next line; a test process gets no file.

Observed / Not run

Observed: prepush gate clean. The fleet compile and UpdateLogFileTests results are added below when they finish.

risk: normal (diagnostics only; no update behaviour changes).

Changelog

none

Agent session: agent session

🤖 Generated with Claude Code


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


Summary by cubic

Adds a file-backed log for the cmux NEXT updater at ~/Library/Logs/cmux-next/<bundle>-updater.log so update flows can be traced after the fact. Unified logging kept no updater lines on the affected user's Mac, so the relaunch after a Download click could not be explained.

  • Every updater log line is also written to the file with an ISO 8601 timestamp and pid, in order on a background lane at user-visible priority; at 1 MB the file rotates to .1. The block-shutdown lines just before an install's quit land within milliseconds, well before Sparkle's quit ends, since that quit does not drain the lane.
  • A launch line records the version, build, track, pid, and whether the launch was reopened behind by an automatic install; download and Restart-to-Update clicks log their flow phase.
  • No file in test processes or when recordsUpdates is off.

Written for commit d970c51. Summary will update on new commits.

View guided diff Turn on auto-fix

…dle>-updater.log

Unified logging kept none of a nightly's updater lines on Leo's Mac, so what
relaunched cmux after his Download click (ask-8112d98df7) could not be traced.
Every updater line now also goes to the file, stamped with its time and pid,
in order on one BackgroundWork files lane that quit waits for; past 1 MB the
file moves to .1. A launch line names the build and whether an automatic
install reopened it behind; Download and Restart to Update clicks are logged.
No file in test processes or with recordsUpdates off.

Leo-ask: ask-8112d98df7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-72382ad86fc1ae47e75d
@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 4faa6d9: 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=pr34635 -f ref=lane/updater-file-log -f platform=macos -f backend_mode=local

…es not wait for the lane

Review follow-up at ebc43c3: nothing calls BackgroundWork.shutdown() at quit,
so blockShutdown alone did not keep the lines before an install's quit.

Leo-ask: ask-8112d98df7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-72382ad86fc1ae47e75d
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent claude-opus-5-5 medium): SHIP at 4faa6d9

What it checked: compile surface (imports, Sendable and nonisolated, the date-format chain, the checked file seams); line order (one serial files-lane slot per priority); no file IO on the main thread; no log file from a test process; the tests; no private data in the new lines. The second commit addresses its first two follow-ups (write priority, and the comment about quit).

Follow-ups:

  • Await the updater's BackgroundWork.shutdown() on terminate, with a time limit, so lines queued just before an install's quit are kept.
  • Two processes with the same bundle id can race on rotation and interleave lines (rare; every line carries its pid).

@github-actions github-actions Bot added risk:high Risk tier (docs/ci/risk-tiers.md) and removed risk:normal Risk tier (docs/ci/risk-tiers.md) labels Nov 4, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
nightly cmux-tui resolve/nightly cmux-tui resolve View Logs
nightly.yml must not read vars.NIGHTLY_SIGN while nightly-sign.yml is in shadow mode/
nightly.yml must not read vars.NIGHTLY_SIGN while nightly-sign.yml is in shadow mode
View Logs
the short nightly decide gate must use the pooled Linux route with a Blacksmith fallbac
k/
the short nightly decide gate must use the pooled Linux route with a Blacksmith fallbac
k
View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex, router-review): SHIP at 4faa6d9

Reviewer: codex gpt-6.1-sol xhigh, fast tier.

Follow-ups: 1. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward.

SHIP at 4faa6d9
Visual verdict: no images; Leo tries the build

  1. [P2] [follow-up] UpdateLogFile.swift:52: Await a log flush before termination. Neither production quit path awaits BackgroundWork.shutdown(), so .blockShutdown provides no exit guarantee. A slow operation on the shared files lane can leave the final install/relaunch messages unwritten. The test’s explicit shutdown masks this gap; cover quitting with that lane occupied.

Swift tests were unavailable in this Linux box.

Follow-ups:

  • Flush pending updater logs before exit and test a busy files lane.

cmux-bot[bot]
cmux-bot Bot previously approved these changes Nov 4, 2026

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 4faa6d9: an independent review passed this exact head (router-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 4, 2026 04:24 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 4, 2026 04:24 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 4, 2026 04:26 Inactive
@cmux-bot
cmux-bot Bot dismissed their stale review November 4, 2026 04:28

A newer verdict blocks 2a53531 (no independent SHIP at the head).

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol high, sweep, via the review router; full diff from merge base 851f9ed to this head): SHIP at 2a53531

[P2] [follow-up] Packages/macOS/CmuxNext/Sources/CmuxNextUpdater/UpdateLogFile.swift:52 - Log entries are only queued asynchronously, while Sparkle can terminate the process without draining BackgroundWork, so install and relaunch events can be lost - Await a log barrier or synchronously flush critical entries before handing control to Sparkle.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 4, 2026 13:02 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 4, 2026 13:02 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 4, 2026 13:03 Inactive

This branch was previously deployed

1 inactive deployment
ci-routing-agent — d970c51c Deployed Nov 4, 2026 by cmux-bot[bot] via wait for same-key tree publisher #111747
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant