Skip to content

chore(desktop): remove the retired Agent VM client surface (SCA-344) - #25050

Merged
Git-on-my-level merged 4 commits into
mainfrom
agent/m5-mbp-opencode-deepseek-v4-1/d21c4f8a168d
Nov 18, 2026
Merged

Git-on-my-level merged 4 commits into
mainfrom
agent/m5-mbp-opencode-deepseek-v4-1/d21c4f8a168d

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Removes the desktop client half of the retired cloud Agent VM (SCA-344, follow-up to #11795). The broker endpoints are now tombstones (410 /v2/agent/provision, 200-null /v2/agent/status) and the control plane is deleted, but the macOS app still provisioned a VM, polled its status, gzip-uploaded omi.db to it, and ran a 3s sync loop against it.

Deleted AgentVMService.swift (587 LOC) and AgentSyncService.swift (754 LOC) plus every call site: the onboarding-completion pipeline, the Home launch-warmup task (StartupWarmupTaskID.agentVMProvisioning and its 20s delay), the owner-transition fences in RuntimeOwnerIdentity/AuthService, the ResourceMonitor memory-pressure pause/resume, the sleep-time final flush, and the APIClient v2/agent wrappers and DTOs.

The remaining capture, transcript-persistence and retry-health paths now report successful database operations so removing AgentSync does not change the recovery counter from consecutive failures to cumulative failures. The lifecycle regression exercises a real health read between error groups and still proves that five consecutive errors close the pool. Two stale lint-baseline entries for the deleted sync test are removed.

The server tombstones and backend/tests/unit/test_desktop_agent_vm.py are untouched — they exist to cover pre-cutover clients.

Product invariants affected

  • INV-AUTH-1 — the owner-transition fence in RuntimeOwnerIdentity and the sign-out storage transition in AuthService lose their VM/sync drains. The remaining fence ordering (file indexer, OCR embeddings, RewindDatabase.retargetEffectiveOwner, storage cache invalidation) is unchanged, and the deleted actors were the only consumers of the removed drains.
  • INV-CUTOVER-1 — the account-cutover signed-in startup no longer schedules a VM provisioning warmup; loadDataIfAdmitted keeps its admission gate and conversation warmup.
  • INV-CHAT-1 — untouched. The desktop-local runtime under desktop/macos/agent/src/runtime/** is not modified; only the retired cloud-VM client is removed.
  • INV-NAV-1 — no navigation surface changes; the Home view only loses a background warmup task.

Historical removal verification (85979bc)

  • xcrun swift build -c debug --package-path Desktop → Build complete! (281s).
  • xcrun swift test --package-path Desktop filtered to the touched suites: StartupWarmupPolicyTests, ContextBucketSchemaTests, RewindDatabaseLifecycleTests, AuthSessionCoordinatorTests, RewindDatabaseCurrentUserIdConcurrencyTests → 71 tests, 0 failures.
  • Second pass over the owner/onboarding/startup neighbours: RuntimeOwnerIdentityTests, SignOutStorageInvalidationTests, SleepCaptureRearmPolicyTests, OnboardingFlowTests, SBOnboardingLaunchAtLoginCompletionTests, SBOnboardingSkipPermissionIntentTests, AppStateOwnerFenceTests, AppStateOwnershipTests, EffectiveOwnerDatabaseBoundaryTests, OCREmbeddingServiceOwnerResetTests, DesktopReviewRegressionTests → all passed.
  • backend/.venv/bin/python -m pytest -q tests/unit/test_desktop_agent_vm.py → 6 passed (tombstone contract intact).
  • ./scripts/swift-format-wrapper.sh lint on the 15 changed Swift files → clean. ./scripts/swiftlint-wrapper.sh lint → 0 violations in 1912 files.
  • python3 scripts/check_desktop_test_quality.py → OK. python3 scripts/check-e2e-flow-coverage.py --strict → exit 0. .github/scripts/check_desktop_auth_session.py → INV-AUTH-1 ratchet passed.
  • grep -rn "AgentVMService\|AgentSyncService\|v2/agent" desktop/macos → no matches.

Not verified: a live named-bundle launch. The removed surface was a background fire-and-forget pipeline with no UI, and the server side is already a tombstone, so there is no user-facing path left to exercise.

Recovery follow-up verification

Follow-up commit a67f71efcc9f: RewindDatabaseLifecycleTests passes all 10 tests, including the real health-read reset regression; TranscriptionStorageRecoveryTests and TranscriptionRetryResilienceTests pass in separate processes (see test receipt). Current-base local preflight passes all 37 checks using this PR body. Desktop test-quality and diff whitespace checks pass. Current-head hosted CI and independent review remain required. No named-bundle install, release, merge or live account verification performed.

Tests

  • Deleted the four suites that only covered the removed services: AgentVMLifecycleFenceTests, AgentSyncBatchQueryTests, AgentVMCompressionRatioTests, AgentVMWarmupAdoptionTests (~870 LOC).
  • RewindDatabaseLifecycleTests.testAgentSyncDatabaseFailureReportingClosesPoolForRecovery → renamed to testReportedDatabaseReadFailuresClosePoolForRecovery and now drives RewindDatabase.shared.reportQueryError directly, which is the production API AgentSyncService.reportDatabaseReadFailure only forwarded to. It now exercises a real TranscriptionStorage health read between error groups to verify the reset, then proves five consecutive errors still rotate the pool.
  • ContextBucketSchemaTests drops its AgentSyncService.syncedTableNames disjointness assertion (the sync table set no longer exists); the derived-data egress assertions are unchanged.
  • StartupWarmupPolicyTests and AuthSessionCoordinatorTests drop the assertions that named the removed warmup ID and the removed owner-transition call.

UI evidence

UI-Evidence: none -- no user-visible surface changes; this removes a background pipeline.

Failure class (fixes)

Failure-Class: none

View guided diff Turn on auto-fix

Git-on-my-level and others added 3 commits November 10, 2026 23:07
The cloud Agent VM was retired in #11795: the broker endpoints are now
tombstones (410 /v2/agent/provision, 200-null /v2/agent/status) and the
control plane is gone. The desktop client kept provisioning, polling,
gzip-uploading omi.db, and running a 3s sync loop against a VM that no
longer exists.

Delete AgentVMService and AgentSyncService plus every call site:

- Onboarding completion and Home launch warmup no longer start a VM
  pipeline; the StartupWarmupTaskID.agentVMProvisioning warmup and its
  delay are gone.
- Owner-transition fences in RuntimeOwnerIdentity and AuthService drop
  their VM/sync drains.
- ResourceMonitor no longer pauses/resumes AgentSync under memory
  pressure, and sleep no longer flushes a final sync.
- APIClient loses the v2/agent provision/status wrappers and DTOs.

Tests: the four AgentVM/AgentSync suites are deleted. The RewindDatabase
pool-rotation test now drives RewindDatabase.reportQueryError directly
(the production API AgentSync used to forward to), and the context-bucket
egress test drops its AgentSync table-disjointness assertion.

Server tombstones and backend/tests/unit/test_desktop_agent_vm.py stay
untouched: they exist to cover pre-cutover clients.

Refs SCA-344

Co-authored-by: multica-agent <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui a67f71efcc9f5ed30f7f90afe1a9f8fb7eef18b8. Each new head needs a fresh approval. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

@kodjima33 Rollout-lead recovery for SCA-344: please review this PR at unchanged exact head a67f71efcc9f5ed30f7f90afe1a9f8fb7eef18b8. The independent exact-head source verdict is SHIP and Mobile Release Eligibility is green; required UI author approval is the remaining merge blocker.

If you approve the current diff, comment:
/approve-ui a67f71efcc9f5ed30f7f90afe1a9f8fb7eef18b8

To withdraw that approval, comment:
/reject-ui a67f71efcc9f5ed30f7f90afe1a9f8fb7eef18b8

The release owner retains the gate: no merge or deployment until this check passes, the head remains unchanged, and the complete overlap scan is refreshed.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

@kodjima33 Gate update for SCA-344: PR #25050 now has merge conflicts, so please do not approve the old head a67f71efcc9f5ed30f7f90afe1a9f8fb7eef18b8. Conflict recovery has been dispatched to the original implementer on the M5 macOS host (SCA-2488).

After the resolution is published, we will request independent source review and your fresh UI-author approval at the resulting full head SHA. Please reply here with your disposition/ETA for that review, or tell us if you cannot remain the gate owner. Withdrawal remains /reject-ui <full head SHA>. The release owner keeps merge and deployment blocked meanwhile.

Resolve the SwiftLint baseline conflict by taking main's regenerated
baseline and dropping the four entries for the files this branch deletes
(AgentSyncService.swift, AgentSyncBatchQueryTests.swift). The result is a
strict subset of main's baseline, so the down-only ratchet stays green,
and no baseline entry is left pointing at a deleted file.

Co-authored-by: multica-agent <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 8ff90bc480e6736cf04f6cc9484a61511d0e328a. Each new head needs a fresh approval. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

Copy link
Copy Markdown
Member Author

@kodjima33 Rollout-lead follow-up to the existing approval request after its 12-hour backstop. The current reviewed head is still 8ff90bc480e6736cf04f6cc9484a61511d0e328a; independent SHIP and the bot-finding inventory are complete, and required UI author approval remains failing.

Please give an explicit disposition and UTC ETA by 2026-11-16T23:15:00Z: approve this exact diff, reject it, or defer with a review time. This is a requested response deadline, not an assumed approval ETA. If unavailable, please say so. The release owner retains the blocked hold; silence or expiry cannot authorize merge.

After reviewing, approval must be a separate exact command: /approve-ui 8ff90bc480e6736cf04f6cc9484a61511d0e328a. Withdrawal is /reject-ui 8ff90bc480e6736cf04f6cc9484a61511d0e328a. Fresh head/check/overlap/release-gate checks remain required before any merge.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

/approve-ui 8ff90bc

@Git-on-my-level
Git-on-my-level merged commit bfa045f into main Nov 18, 2026
50 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m5-mbp-opencode-deepseek-v4-1/d21c4f8a168d branch November 18, 2026 12:55
Git-on-my-level added a commit that referenced this pull request Nov 18, 2026
…ed after #25050) (#25694)

Failure-Class: none

Co-authored-by: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Nov 18, 2026
…parity and exact undo (#25686)

* feat(conversations-v3): per-owner backfill and repair runs with live parity and exact undo

Turn the v3 backfill into a reusable per-owner repair tool:

- Operator plans one owner + window (default 2 days) from an owners file;
  partitions cut at five-minute silences; run ledger with counts, code SHA
  and outcome; the sweep starts planned runs only when
  CONVERSATIONS_V3_BACKFILL=on; one step at a time on a dedicated
  conversations-v3-backfill queue.
- Derive passes hold their own backfill-builder lease and notes marker, so
  they never make the live builder busy or ride the live queue/sweep.
- Backfilled notes take the live CAPTURE_END path (relevance, speaker
  resolution, meeting context, live floors); process_conversation withholds
  only derived effects for v3 backfilled rows.
- Non-destructive conversion: legacy notes kept, prior field values recorded,
  undo restores donors exactly and removes derived rows; deleting a
  backfilled copy never arms the donor audio purge.
- Resume and re-derive reuse ids by adoption; legacy manual stops map to the
  v3 manual end; discarded/imported/private/unreadable rows stay legacy.

Failure-Class: FC-irreversible-terminal-hide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(conversations-v3): backfill settle/resume edge cases from self-review

Count live-writer terminal failures as failed, keep a start-marker read error
from failing the live sweep, resume a run whose start marker was lost, and
rename the live backoff local that shadowed the window bound.

Failure-Class: FC-irreversible-terminal-hide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(conversations-v3): classify and register CONVERSATIONS_V3_BACKFILL_QUEUE

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(conversations-v3): narrow the backfill start run for the type checker

Failure-Class: FC-irreversible-terminal-hide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(conversations-v3): drop an unused loop index in the backfill operator

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(conversations-v3): keep StrictFirestore DELETE_FIELD semantics; bind historical in the hook harness

Revert the fixture change (other suites assert the stored sentinel) and compare
the restored donor as Firestore would store it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(conversations-v3): answer the backfill panel review

- A legacy row no derived window claims stays a visible legacy conversation
  (counted as sources_unclaimed) instead of being hidden with no replacement.
- Start markers move under users/{uid} so account deletion purges them; the
  sweep reads them with a bounded collection-group list.
- The operator refuses a new run while one is blocked; undo/resume exit 1
  when no listed owner has the run.
- A redelivered committed partition re-dispatches a lost successor (named
  task, so a duplicate is a no-op).
- Re-derive blocks (rederive_mixed_runs) rather than merge rows from two
  runs, keeping undo run-scoped.
- A refused undo records its reason; a drain stopped mid-way reports stopped.
- classify_window reports legacy_candidates; the cost model has a test;
  the runbook documents the row-level partition-gap caveat.

Failure-Class: FC-irreversible-terminal-hide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(conversations-v3): pin the historical gate on owner-recognition telemetry

Backfilled v3 rows skip owner-recognition telemetry and capture-loss
accounting; legacy processing already observed the same speech.

Failure-Class: FC-irreversible-terminal-hide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(conversations-v3): declare the backfill lifecycle payload sites

The run ledger's run/partition status, the re-derive reset of a prior
backfilled copy, and undo's donor restore are reviewed entries in the
lifecycle writer inventory (restore is a backfill-lease-fenced extra writer).

Failure-Class: FC-irreversible-terminal-hide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(home): import home_feed at collection so the CPU guard measures the test

The file-isolated runner charged the cold database.home_feed import to the
first feed-read case's call phase, which crossed the 1.00s CPU guard on CI.

Failure-Class: FC-irreversible-terminal-hide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(desktop): drop the retired /v2/agent out-of-scope prefix (main red after #25050)

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* config(conversations-v3): enable the operator-only backfill route on prod backend-sync

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(deploy): omit the stale-head canary uid from the Cloud Run manifest

#25679 bound BATCH_PIPELINE_MERGE_STALE_HEAD_UID_ALLOWLIST as a literal in the
prod backend-integration overlay. test_rollout_cohort_deploy's contract is
that the Cloud Run manifest omits private uid bindings so deploys keep the
live value (gcloud preserves undeclared env), so main's backend unit suite
went red. Remove the literal and its known-gaps exception; the uid is bound
on the service at deploy time.

Unchanged: the test, #25673's skip code, #25679's regression case, and the
GPU worker Helm value. Helm is declarative, so omitting it there would drop
the canary on the next upgrade instead of preserving it; that literal keeps
its reviewed no-uid-literals exception.

Failure-Class: none
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(conversations-v3): undo never resurrects a deletion; fence it with both builders

- A donor whose backfilled copy the owner deleted (a post-run deleted span, or
  no claim left) is kept converted, with every copy it shares and their donors;
  the restore transaction re-checks, and a deletion that races undo is kept.
- Undo holds the backfill and live builder leases before it enumerates the
  run, so no pass commits or stamps a row while it restores and deletes.
- A converted donor that no longer reads blocks the partition
  (backfill_source_unreadable) instead of retiring its only copy.
- undo on a re-derive run id names the original run and exits 1; the dry-run
  counts donors the owner deleted; classification splits not-completed rows.

Failure-Class: FC-irreversible-terminal-hide

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant