Repository navigation
feat(ios): add Chief Home to the classic mobile shell - #21287
Conversation
Copies CmuxAgentQuestion, CmuxHomeCore, CmuxHomeRender and CmuxMessagesLab unchanged from origin/feat-cmux-next so classic can host the same iMessage-style transcript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An in-process conversation owner that persists Chief conversations as JSONL in the build's Chief home, streams brain turns as drafts, tool work and approvals, and serves them to HomeStore through ChiefLocalSource. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Memory lives in the Chief home as person.md, instructions.md and an append-only memory.jsonl that the app and the CLI write under one lock. The system prompt teaches the cmux CLI, agent dispatch, cloud setup and settings editing, then appends the user's memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Work in progress; split into logical commits before review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…row, single selection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anced first run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…down Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… runtime Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e prompt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sters by the composer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| } | ||
|
|
||
| func publish(_ event: HomeEvent) { | ||
| changeCursor = UUID().uuidString |
There was a problem hiding this comment.
Reply chunks rescan saved history
Every streamed reply chunk now changes changeCursor, waking Home and rebuilding every conversation row through controlConversations(). Each row calls snapshot, which can scan that conversation’s full message history for thread counts. Draft chunks do not change the returned previews, so this repeatedly scans saved history without showing new content. As history grows, this consumes more Mac CPU and delays other requests to the Chief owner.
This violates the repository rule against rebuilding unbounded collections on every event. Use a separate inbox cursor that advances only when returned rows change, and fetch previews without calculating unused thread counts.
Rule Used: Flag production code that adds nested full-collection scans, per-target rescans for batch actions, repeated sort/filter/map work in hot UI/socket/search/process paths, in-memory joins that belong in the data store, or unbenchmarked slower algorithms ... (source)
| } catch { | ||
| guard !Task.isCancelled else { return } | ||
| errorMessage = String(describing: error) | ||
| return |
There was a problem hiding this comment.
Home stops updating after failure
One failed conversationsSnapshot request ends waitForChanges for the current Home visit. A temporary busy response or network failure therefore stops automatic updates even after requests work again. Pull-to-refresh calls only load, so it does not restart the wait either. Users must leave the view or change the app’s active state to restart updates.
Restart the subscription through connection recovery or a cancellation-aware retry owner.
Bugbot needs on-demand usage enabledBugbot 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. |
| /// what the transcript shows, and a waiting approval said in plain words | ||
| /// ("Needs your approval: Start Codex in “Scratch”", ``ChiefListPreview``; "Waiting | ||
| /// for you" until that line is read) instead of the card's raw prompt ("Run `…`?"). | ||
| enum ChiefPreviewText { |
There was a problem hiding this comment.
ChiefPreviewText is a new caseless enum containing only static helpers, used by production previews. The repository forbids static-only helper namespaces and requires this behavior to belong to a constructable owner. Make it a preview formatter owned by ChiefService, or move the behavior onto the existing preview model.
Rule Used: Flag new ambient global state in production Swift: a top-level (file-scope) func used as API, a top-level mutable var or a stub class/struct holding a global flag/once-token, a caseless enum/empty struct used purely as a static func/static let namesp... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Exact-head correctness review (
|
main no longer compiles after this merge@azooz2003-bit: after Evidence: https://github.com/manaflow-ai/cmux/actions/runs/39400098502/job/118552744022 Nothing blocks merging meanwhile. A fix-forward (or, failing that, a revert) is attempted automatically unless an open pull request already fixes this. main_compile_attribution.py: post-merge, nothing here gates a merge. |
…x-instinct-b77acc19 Merged by its real history so the Chief files use this branch's Oct 15 commit as their base. Kept this branch's pane-local conversation list over the earlier workspace-list design (1abddf0) the iOS branch carried, and combined the two always-allow fixes: one rules object per owner, saved to the home that allowed the rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* cli-contract: canvas help probe expects the chief pane type (#21287) #21287 added chief to cmux canvas new-pane --type, so the help probe in macOS compile admission failed on main and on every PR based on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdac-78a0-ac2e-a38c001e9b1e&host=cosmic-gray * cli-contract: the canvas new-pane table row lists chief too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdac-78a0-ac2e-a38c001e9b1e&host=cosmic-gray --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… (main red) (#35296) * test: keep Chief Home out of the Option-digit routing suite's windows Chief Home (#21287, on by default) adds a pinned Home workspace at index 0 of every new main window. Two tests in AppDelegateOptionDigitShortcutRoutingTests select `selectTab(at: 0)` and then expect the window's initial terminal workspace to be selected, so they selected Home instead: the terminal never took first responder and the Option+arrow/Option+digit routing assertions saw the wrong workspace. Disable Chief in the suite's isolation wrapper, the same way WorkspaceGroupNumberedSelectionTests does, and restore the setting after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: import only ChiefCatalogSection so StoredShortcut stays unambiguous Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
chief.approve/chief.answer, prevent duplicate taps, and collapse answered cards to receipts.chief.answercontract: it targets the first eligible unanswered item, then the first eligible multi-select item.Testing
Local
swift package dump-package --package-path Packages/iOS/CmuxMobileShell— passed.swift package dump-package --package-path Packages/iOS/CmuxMobileShellUI— passed.swift package dump-package --package-path Packages/macOS/CmuxChief— passed.swiftc -frontend -parsefor the changed Chief backend, Home/question sheet, and backend test files — passed../scripts/lint-ios-package-conventions.sh— passed with no unjustified convention violations.git diff --check— passed.python3 scripts/verify-local.py --only swift-syntax --swift-changed— passed on the final repair head.swiftc -frontend -parsefor the new owner preview API and its two callers — passed../scripts/lint-ios-package-conventions.sh— passed with no unjustified convention violations on the final repair head.xcodebuild testwere run.Exact-head hosted builds
05fd46d730112dd16523deda79f036f56778e920.17f3be65c49fa38b4b9ef90e93a1d22a763965c8predate the final refresh-recovery repair and are retained only as historical evidence; current-head CI is the merge evidence.main: base709612a962a42daec52f90380ca3bfff03d8e4f8, head05fd46d730112dd16523deda79f036f56778e920, speculative merge437a586fcfac8693699c56d792190cf8f572a25d.Runtime evidence
artifacts/verify-remote/20261017-062726-chf30-ios-aws-m4pro-3/, verification stepf20c1bca0675a5083f2dbc71, evidence SHA-256:ced090de2d1b4dc6e0f0d1beea78fc42f0c32f94f22a4d13dc284c334ab5e29.dev.cmux.ios.chf30from the exact iOS artifact and cleaned up its isolated simulator. It reached the expected reconnect/no-paired-Mac state; Chief Home, transcript, send, stop, approval, question composer, and pairing interactions were not exercised because this verification lane does not pair a Mac.https://cmux-dev-backend-1.tail137216.ts.net:3869/; the local Tag Opener health endpoint passed andhttp://127.0.0.1:17320/chf30was registered.Related work
Impact map
MobileChiefClientand the existing authenticated Chief owner dispatch; send correlation also crossesChiefConversationBackend,ChiefService+Control, and the Mac mobile event stream.WorkspaceShellView,MobilePrimaryTabScaffold, existing mobile destinations,MobileHostServicecapability/ticket authorization,TerminalController+Chief, and the Chief owner/control-socket paths.HIG reference
Changelog
Added: Chief Home and conversation access to the classic mobile shell.