Repository navigation
Hold update relaunches on the shared agent classifier - #17824
Closed
azooz2003-bit wants to merge 26 commits into
Closed
azooz2003-bit wants to merge 26 commits into
azooz2003-bit wants to merge 26 commits into
Conversation
…launch right away An explicit Install and Relaunch, Restart Now or Install Now relaunches as soon as the app has captured its sessions (#15084). With the new Install Updates Automatically setting (on by default for nightly), Sparkle downloads updates in the background and the relaunch waits for no busy agent, no running command and a minute without input. Every update relaunch first takes a fresh process scan, so agents started since the last scan are saved as running and resume. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Safe and care agents resume after the relaunch, so only risky agents (a foreground command, an unanswered prompt) and other running commands hold it. An install the user asks for relaunches right away unless something is risky; then the popover lists every agent with a safety chip and offers Wait, Update When These Finish and Update Anyway. Remote cmux ssh agents keep running on their host and count as safe. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AgentActivity splits the coarse working/needs-input lifecycle into what an agent is doing now (thinking, a tool with its command and start time, subagents, background work, a question, a permission) and ResumeSafety classifies whether a restart or update can interrupt it (safe, care, risky, with reasons). Pure package code with tests; the app wiring follows. Refs #15266 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AgentHookActivityState folds one session's queued hooks (prompt submit, pre and post tool use by tool_use_id, stop with background work, idle notification, session start and end) into turn facts. AgentActivityEvidence combines them with the session registry state, the Feed decision overlay and a foreground command into AgentActivitySignals. AgentForegroundCommand picks the command an agent runs through a foreground shell child, so MCP servers and background shells do not count. Refs #15266 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The current-work reducer built a Cloud or SSH agent row with the badge's report provenance (hook, plugin, detected) as its kind and the raw daemon state, so a blocked remote agent never raised needs_input attention. SurfaceAgentBadge now exposes agentIdentity (the adapter, shared with the sidebar slot key) and sessionState (blocked is needs_input, done is ended), and carries extra.agent_session_id from the cmux-tui catalog so the row gets its session id. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AgentActivityIndex joins the agent session registry to live workspace and dock panels in one main-actor turn, adds each session's hook turn facts, the Feed decision overlay and, for local panes, a foreground command from one cached process census, then classifies. Each entry carries workspace, panel, surface and pane ids, name, agent, session, pid, placement (local, ssh with its host, cloud), survives_app_relaunch, activity and resume_safety. Claude now installs an unmatched queued PostToolUse hook. agent.hook.enqueue records every admitted hook in AgentHookActivityTracker before queueing, and a Claude post-tool-use only closes the open call: no hook process runs for it. agent.list is a worker-lane read advertised in capabilities. It has no relay contract because it returns local argv, and a test pins that. Refs #15266 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tic update Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n nudges A menu install while risky agents hold an automatic update switches the popover to asking instead of stopping them. A continuation nudge the restore never used expires after ten minutes, and a failed relaunch stops marking panels after a minute. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review fixes for the activity index: - A compaction, resume or unknown SessionStart keeps the running turn; only startup and clear reset it. - Placement comes from the surface (cloud attachment, owning machine, remote terminal context), so a local pane in a remote workspace no longer reports survives_app_relaunch. - An unavailable or partial process census, or a local agent without a pid, sets foregroundCommandUnknown; the classifier never calls that safe (reason process_unknown). - Failed, denied and interrupted calls close: Claude also sends PostToolUseFailure to post-tool-use, an idle prompt ends the turn, and a later call of another tool closes a pending question. Both post-tool-use hooks are async. - Compaction keeps tool_use_id and agent_id; a post without an id closes the newest same-named call. - started_at is the PreToolUse time; since moves only on a change. - Subagent hooks and late posts never reopen a finished turn; hooks decide the turn only after they have seen a boundary. - Process filtering starts at the turn start, else at the last idle point, so older shells (such as shell-wrapped MCP servers) are ignored. - Relayed question PreToolUse is ignored: remote daemons send no PostToolUse, and the Feed overlay covers remote questions. - agent.list errors when the session owners are unavailable instead of returning an empty list, and redacts tool commands and argv. Refs #15266 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…types package-conventions-lint flags caseless all-static enums. The classifier becomes AgentActivitySignals.classify() (plus AgentActivityEvidence.classify()), with the read-only and subagent-launcher tool sets on AgentActivity.Tool. AgentForegroundCommand becomes AgentProcessTree, an instantiated census with foregroundCommandPID(agentPID:notBefore:) and a static describe(arguments:). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The CLI's redaction policy is not compiled into the app target. The socket is same-user and never relayed, and the updater shows these commands to the user, so report them as recorded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A CMUX_UI_TEST_* variable marks the process as a test host, which never starts the updater, so the DEV-build dogfood opt-in needs its own feed variable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts: # cmux.xcodeproj/project.pbxproj
…o-update # Conflicts: # cmux.xcodeproj/project.pbxproj
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ds-free-auto-update
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> # Conflicts: # tests/test_claude_wrapper_hooks.py
…e-gate-agent-activity
The update relaunch gate now reads AgentActivityIndex snapshots instead of hook lifecycle state, so a mid-turn agent that is only thinking resumes as care, and only a running command, an open question or permission, or a draft holds the relaunch. The updater's blockers read is now async and the gate awaits it on each check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ent-activity # Conflicts: # cmux.xcodeproj/project.pbxproj
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
Contributor
|
Note Pull Request opener @azooz2003-bit is not an author or co-author of any commit in this PR (commit identities: All contributors have signed the CLA ✍️ ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacks on #15296 and #15276, and must merge after both. The branch contains a merge of both.
The update relaunch gate from #15296 classified agents from hook lifecycle state alone, which cannot tell a model request from a foreground build, so any mid-turn local agent counted as risky and held automatic installs. This switches the gate to the shared classifier from #15276 (
AgentActivityIndex), which also reads the pane's process tree.Mapping, per
AgentActivitySnapshot(a pure staticAppDelegate.updateRelaunchBlockers(agents:workspaceTitles:shellPanels:)):idis the panel id;locationis the workspace title looked up byworkspaceID;nameis the agent's display name from its kind (the snapshot'snameis the pane title, so it is not used).cmux sshor cloud) is safe, with "Keeps running on the remote host".endedcount as plain panels.The classifier reads the process census asynchronously, so
UpdateActionDelegate.updaterRelaunchBlockers()is nowasync.UpdateRelaunchGateawaits its readiness closure on the first publish, every re-check and after prepare, and re-checks that the hold is still current after each await. An install the user asks for reads the blockers in a main-actor task before deciding to relaunch or ask. The interim hook-lifecycle classifier is removed;midTaskPanelIdsandUpdateRelaunchContinuationNudgesstay.New activity labels are localized in all nine app locales.
Testing
swift testinPackages/macOS/CmuxUpdater: 146 tests passed, three runs. The gate tests now wait for the hold's first async publish before asserting on it; the behaviors they check are unchanged.cmuxTests/UpdateRelaunchBlockersTests.swiftis rewritten for the mapping. Not run locally: it needs the app test target, so CI runs it.python3 scripts/verify-local.py(16/16 passed, including Swift syntax, test wiring and localization parity) andpython3 scripts/localization_catalog.py check(0 parity errors).Changelog
Changed: Automatic updates no longer wait on an agent that only looks busy; they wait only for agents running a command or waiting on you
Checklist
update.agentActivity.*keys with all nine locales🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Switches the update relaunch gate from hook lifecycle state to the shared
AgentActivityIndexclassifier, so an automatic install only waits on agents running a command, blocked on a prompt, or sitting on a draft — a mid-turn agent that is only thinking resumes as care and no longer holds the install. Adds an Install Updates Automatically setting (on for nightly builds) where updates download in the background and install at a quiet moment. The interim hook-lifecycle classifier is removed.Agent classification
AgentActivityIndexsnapshots; the blockers read isasyncand re-awaited on every check.cmux sshor cloud pane counts as safe because it keeps running on the remote host.agent.listworker surface.Automatic installs
Written for commit 0596e2e. Summary will update on new commits.
Migrated from #15417 after correcting the PR author identity. The original head commit 0596e2e is preserved.