Pricing v3 batch 3: sleep race, delete retry, moved chats, ads notice #2721
<!-- coderabbit-ai-generated:v1 -->
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: rate limited by coderabbit.ai -->
[!IMPORTANT]
## Review skipped
> Too many files!
> This PR contains 108 files, which is 8 over the limit of 100.
> To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.
> Upgrade to a paid plan to raise the limit.
> This organization's CodeRabbit subscription is cancelled. Resubscribe in Billing to continue reviews beyond the free-tier limit.
> <details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
<dl>
<dd>
<br>
> - Source mode: Auto
- Repository: [arul28/DAEX](<https://github.com/arul28/DAEX>)
- Branch: [ade/pricing-v3-batch3](<https://github.com/arul28/DAEX/tree/ade%2Fpricing-v3-batch3>)
- File: [.coderabbit.yaml](<https://github.com/arul28/DAEX/blob/46d710e7a6efc9a79d84c2fc9712663401743a39/.coderabbit.yaml>)
- Commit: [46d710e](<https://github.com/arul28/DAEX/commit/46d710e7a6efc9a79d84c2fc9712663401743a39>)
- Layers: Repository YAML
- Review profile: CHILL
- Plan: Advanced
- Run ID: fe847764-5098-4883-aea6-033f3588ea0b> </dd>
</dl>
</details>
> <details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
<dl>
<dd>
<br>
> Reviewing files that changed from the base of the PR and between 03fec378641a49ada75d17643818574d7b564aed and 46d710e7a6efc9a79d84c2fc9712663401743a39.
> </dd>
</dl>
</details>
> <details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-minus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-minus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files ignored due to path filters: 1</strong></summary>
<dl>
<dd>
<br>
>docs/features/ade-cloud/README.mdis excluded by!docs/
> </dd>
</dl>
</details>
> <details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 108</strong></summary>
<dl>
<dd>
<br>
> apps/account-directory/README.md apps/account-directory/migrations/0084_ad_notice_shown.sql apps/account-directory/src/cloud/accountState.ts apps/account-directory/src/cloud/adPrice.ts apps/account-directory/src/cloud/adProof.ts apps/account-directory/src/cloud/chatMessages.ts apps/account-directory/src/cloud/contract.ts apps/account-directory/src/cloud/cron.ts apps/account-directory/src/cloud/gravity.ts apps/account-directory/src/cloud/idleCleanup.ts apps/account-directory/src/cloud/idleSleep.ts apps/account-directory/src/cloud/launches.ts apps/account-directory/src/cloud/routes.ts apps/account-directory/src/cloud/store.ts apps/account-directory/test/cloudAccount.test.ts apps/ade-cli/src/adeRpcServer.ts apps/ade-cli/src/adeToolAccess.ts apps/ade-cli/src/cli.ts apps/ade-cli/src/cliMachineTargeting.ts apps/ade-cli/src/services/cloudChats/cloudComputerRest.ts apps/ade-cli/src/services/power/cloudDeleteFreeze.ts apps/ade-cli/src/services/power/cloudKeepAwake.ts apps/ade-cli/src/services/power/cloudMoveMark.ts apps/ade-cli/src/services/power/power.test.ts apps/ade-cli/src/services/sync/brainProjectActionsSyncHandler.ts apps/ade-cli/src/services/sync/syncHostService.test.ts apps/ade-cli/src/services/sync/syncHostService.ts apps/ade-cli/src/services/sync/syncRemoteCommandService.test.ts apps/ade-cli/src/services/sync/syncRemoteCommandService.ts apps/ade-cli/src/services/sync/syncTerminalStreams.ts apps/ade-cli/src/services/sync/syncTunnelClientService.ts apps/desktop/src/main/main.ts apps/desktop/src/main/services/adeCloud/cloudLaneComputerStages.ts apps/desktop/src/main/services/adeCloud/cloudLaneLaunchService.ts apps/desktop/src/main/services/adeCloud/cloudLaneLaunchSteps.ts apps/desktop/src/main/services/adeCloud/registerCloudIpc.ts apps/desktop/src/main/services/cloudChats/registerCloudSavedChatsIpc.ts apps/desktop/src/main/services/ipc/registerIpc.ts apps/desktop/src/main/services/ipc/runtimeBridge.ts apps/desktop/src/main/services/pty/ptyService.test.ts apps/desktop/src/main/services/remoteRuntime/remoteConnectionService.test.ts apps/desktop/src/main/services/remoteRuntime/remoteConnectionService.ts apps/desktop/src/preload/global.d.ts apps/desktop/src/preload/preload.ts apps/desktop/src/renderer/components/activity/ActivityDetailSheet.tsx apps/desktop/src/renderer/components/activity/ActivityPanel.tsx apps/desktop/src/renderer/components/activity/HeaderActivityControl.tsx apps/desktop/src/renderer/components/activity/useDeletedCloudComputers.ts apps/desktop/src/renderer/components/app/App.tsx apps/desktop/src/renderer/components/app/TopBar.tsx apps/desktop/src/renderer/components/chat/AgentChatPane.tsx apps/desktop/src/renderer/components/chat/CloudQueueSendCard.tsx apps/desktop/src/renderer/components/chat/CloudQueuedMessages.tsx apps/desktop/src/renderer/components/chat/launch/chatLaunchActions.test.ts apps/desktop/src/renderer/components/chat/launch/chatLaunchActions.ts apps/desktop/src/renderer/components/chat/sponsored/SponsoredReplySlot.test.tsx apps/desktop/src/renderer/components/chat/sponsored/SponsoredReplySlot.tsx apps/desktop/src/renderer/components/chat/sponsored/useSponsoredViewer.ts apps/desktop/src/renderer/components/chat/useCloudQueuedBubbles.ts apps/desktop/src/renderer/components/settings/cloudDashboard/CloudAdsBand.tsx apps/desktop/src/renderer/lib/useDocumentVisible.ts apps/desktop/src/renderer/state/accountCloudLaunches.ts apps/desktop/src/renderer/state/adeCloudChatQueue.test.ts apps/desktop/src/renderer/state/adeCloudChatQueue.ts apps/desktop/src/renderer/state/adeCloudTabs.ts apps/desktop/src/renderer/state/appStore.ts apps/desktop/src/renderer/state/chatLaunchStore.ts apps/desktop/src/renderer/state/cloudAccountStore.ts apps/desktop/src/renderer/state/cloudSavedChats.ts apps/desktop/src/renderer/webclient/adapter/savedChatOnWeb.ts apps/desktop/src/shared/adeCloud/binding.test.ts apps/desktop/src/shared/adeCloud/binding.ts apps/desktop/src/shared/cloudAdPriceWords.ts apps/desktop/src/shared/codedError.ts apps/desktop/src/shared/savedChatRoute.test.ts apps/desktop/src/shared/savedChatRoute.ts apps/desktop/src/shared/sentry/expectedFailure.ts apps/desktop/src/shared/types/chatLaunch.ts apps/desktop/src/shared/types/core.ts apps/desktop/src/shared/types/sync.ts apps/ios/ADE/Services/AccountCloudLaunches.swift apps/ios/ADE/Services/AccountCloudStore.swift apps/ios/ADE/Services/ChatLaunchStore.swift apps/ios/ADE/Services/CloudServerClient.swift apps/ios/ADE/Services/CloudSponsored.swift apps/ios/ADE/Services/SyncService+ChatLaunch.swift apps/ios/ADE/Services/SyncService+Cloud.swift apps/ios/ADE/Services/SyncService.swift apps/ios/ADE/Views/Cloud/CloudAdPrice.swift apps/ios/ADE/Views/Cloud/CloudPlansCard.swift apps/ios/ADE/Views/Components/StartOnPicker.swift apps/ios/ADE/Views/Hub/HubComposerDrawer.swift apps/ios/ADE/Views/Hub/HubMachineSections.swift apps/ios/ADE/Views/Hub/HubScreen.swift apps/ios/ADE/Views/Settings/SettingsMachines.swift apps/ios/ADE/Views/Work/WorkChatLaunchPendingScreen.swift apps/ios/ADE/Views/Work/WorkChatLaunchSetupCard.swift apps/ios/ADE/Views/Work/WorkCloudLaunchViews.swift apps/ios/ADE/Views/Work/WorkCloudMachine.swift apps/ios/ADE/Views/Work/WorkNewChatMachinePicker.swift apps/ios/ADE/Views/Work/WorkNewChatScreen.swift apps/ios/ADE/Views/Work/WorkRootScreen.swift apps/ios/ADE/Views/Work/WorkSessionDestinationView.swift apps/ios/ADE/Views/Work/WorkSponsoredCards.swift apps/ios/ADETests/ADETests.swift apps/ios/ADETests/ChatLaunchTests.swift apps/ios/ADETests/CloudAccountRequestTests.swift* apps/ios/ADETests/HubProjectPresentationTests.swift> </dd>
</dl>
</details>
> You can disable this status message by setting thereviews.review_statustofalsein the CodeRabbit configuration file.
<!-- end of auto-generated comment: rate limited by coderabbit.ai -->
<!-- autopilot:start -->
<!-- autopilot:end -->
<!-- tips_start -->
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.
<details>
<summary><strong>Share</strong></summary>
<dl>
<dd>
<br>
</dd>
</dl>
</details>
<!-- tips_end -->
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Launch reaches the wrong computer
The wake loop reuses a send with a plain project id. If the person switches computers during the five-minute wait, performCommandRequest sends the next attempt through the newly focused connection. The launch fails on the wrong computer or starts there if that project exists. Keep the original machine in the scope used by both the resend and its cancel.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: apps/ios/ADE/Services/SyncService+ChatLaunch.swift
Line: 719
Comment:
**Launch reaches the wrong computer**
The wake loop reuses a send with a plain project id. If the person switches computers during the five-minute wait, `performCommandRequest` sends the next attempt through the newly focused connection. The launch fails on the wrong computer or starts there if that project exists. Keep the original machine in the scope used by both the resend and its cancel.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href="https://app.greptile.com/ide/claude-code?prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0APath%3A%20apps%2Fios%2FADE%2FServices%2FSyncService%2BChatLaunch.swift%0ALine%3A%20719%0A%0AComment%3A%0ALaunch%20reaches%20the%20wrong%20computer%0A%0AThe%20wake%20loop%20reuses%20a%20send%20with%20a%20plain%20project%20id.%20If%20the%20person%20switches%20computers%20during%20the%20five-minute%20wait%2C%20%60performCommandRequest%60%20sends%20the%20next%20attempt%20through%20the%20newly%20focused%20connection.%20The%20launch%20fails%20on%20the%20wrong%20computer%20or%20starts%20there%20if%20that%20project%20exists.%20Keep%20the%20original%20machine%20in%20the%20scope%20used%20by%20both%20the%20resend%20and%20its%20cancel.%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=arul28%2Fdaex&pr=2721&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaudeDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaude.svg?v=7"><img alt="Fix in Claude Code" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaude.svg?v=7"></picture></a>
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Ads skip the visible notice
With above_prompt, the request uses the dock's seen value, but the notice still requires the below-reply region's onScreen value. If the person is scrolled up when a reply finishes, the server marks the notice delivered without showing it. Starting the next turn removes the only turn allowed to show that notice, so later ads can appear without it. Wait until the notice's own region is visible before sending its delivery request.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: apps/desktop/src/renderer/components/chat/sponsored/SponsoredReplySlot.tsx
Line: 353-357
Comment:
**Ads skip the visible notice**
With `above_prompt`, the request uses the dock's `seen` value, but the notice still requires the below-reply region's `onScreen` value. If the person is scrolled up when a reply finishes, the server marks the notice delivered without showing it. Starting the next turn removes the only turn allowed to show that notice, so later ads can appear without it. Wait until the notice's own region is visible before sending its delivery request.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href="https://app.greptile.com/ide/claude-code?prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0APath%3A%20apps%2Fdesktop%2Fsrc%2Frenderer%2Fcomponents%2Fchat%2Fsponsored%2FSponsoredReplySlot.tsx%0ALine%3A%20353-357%0A%0AComment%3A%0AAds%20skip%20the%20visible%20notice%0A%0AWith%20%60above_prompt%60%2C%20the%20request%20uses%20the%20dock's%20%60seen%60%20value%2C%20but%20the%20notice%20still%20requires%20the%20below-reply%20region's%20%60onScreen%60%20value.%20If%20the%20person%20is%20scrolled%20up%20when%20a%20reply%20finishes%2C%20the%20server%20marks%20the%20notice%20delivered%20without%20showing%20it.%20Starting%20the%20next%20turn%20removes%20the%20only%20turn%20allowed%20to%20show%20that%20notice%2C%20so%20later%20ads%20can%20appear%20without%20it.%20Wait%20until%20the%20notice's%20own%20region%20is%20visible%20before%20sending%20its%20delivery%20request.%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=arul28%2Fdaex&pr=2721&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaudeDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaude.svg?v=7"><img alt="Fix in Claude Code" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaude.svg?v=7"></picture></a>
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Slow sleeps lose queued wakes
If an accepted sleep takes longer than roughly fourteen seconds to appear at the provider, this function returns without waking the computer. The message's idle_sleep_rewoken row has already been written. If the computer sleeps just afterward, its brain cannot lift the freeze or drain the message, and no later attempt retries this wake. The message stays queued until another action wakes the computer. Keep the wake pending until the sleep finishes or is confirmed refused.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: apps/account-directory/src/cloud/routes.ts
Line: 1418-1421
Comment:
**Slow sleeps lose queued wakes**
If an accepted sleep takes longer than roughly fourteen seconds to appear at the provider, this function returns without waking the computer. The message's `idle_sleep_rewoken` row has already been written. If the computer sleeps just afterward, its brain cannot lift the freeze or drain the message, and no later attempt retries this wake. The message stays queued until another action wakes the computer. Keep the wake pending until the sleep finishes or is confirmed refused.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href="https://app.greptile.com/ide/claude-code?prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0APath%3A%20apps%2Faccount-directory%2Fsrc%2Fcloud%2Froutes.ts%0ALine%3A%201418-1421%0A%0AComment%3A%0ASlow%20sleeps%20lose%20queued%20wakes%0A%0AIf%20an%20accepted%20sleep%20takes%20longer%20than%20roughly%20fourteen%20seconds%20to%20appear%20at%20the%20provider%2C%20this%20function%20returns%20without%20waking%20the%20computer.%20The%20message's%20%60idle_sleep_rewoken%60%20row%20has%20already%20been%20written.%20If%20the%20computer%20sleeps%20just%20afterward%2C%20its%20brain%20cannot%20lift%20the%20freeze%20or%20drain%20the%20message%2C%20and%20no%20later%20attempt%20retries%20this%20wake.%20The%20message%20stays%20queued%20until%20another%20action%20wakes%20the%20computer.%20Keep%20the%20wake%20pending%20until%20the%20sleep%20finishes%20or%20is%20confirmed%20refused.%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=arul28%2Fdaex&pr=2721&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaudeDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaude.svg?v=7"><img alt="Fix in Claude Code" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaude.svg?v=7"></picture></a>
<a href=""><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> Old retries survive account changes
The account-change handler clears the launches and stops their poller, but leaves deleteOwed and its timers intact. Those timers later call cancelAccountCloudLaunch through the current account's bridge. The previous account's persistent notice also stays visible. Clear the retry entries and notices on account change, and guard in-flight answers with accountEpoch.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: apps/desktop/src/renderer/state/accountCloudLaunches.ts
Line: 633-636
Comment:
**Old retries survive account changes**
The account-change handler clears the launches and stops their poller, but leaves `deleteOwed` and its timers intact. Those timers later call `cancelAccountCloudLaunch` through the current account's bridge. The previous account's persistent notice also stays visible. Clear the retry entries and notices on account change, and guard in-flight answers with `accountEpoch`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href="https://app.greptile.com/ide/claude-code?prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0APath%3A%20apps%2Fdesktop%2Fsrc%2Frenderer%2Fstate%2FaccountCloudLaunches.ts%0ALine%3A%20633-636%0A%0AComment%3A%0AOld%20retries%20survive%20account%20changes%0A%0AThe%20account-change%20handler%20clears%20the%20launches%20and%20stops%20their%20poller%2C%20but%20leaves%20%60deleteOwed%60%20and%20its%20timers%20intact.%20Those%20timers%20later%20call%20%60cancelAccountCloudLaunch%60%20through%20the%20current%20account's%20bridge.%20The%20previous%20account's%20persistent%20notice%20also%20stays%20visible.%20Clear%20the%20retry%20entries%20and%20notices%20on%20account%20change%2C%20and%20guard%20in-flight%20answers%20with%20%60accountEpoch%60.%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=arul28%2Fdaex&pr=2721&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaudeDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaude.svg?v=7"><img alt="Fix in Claude Code" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixInClaude.svg?v=7"></picture></a>
Notice turn can later serve an ad
Medium Severity
<!-- DESCRIPTION START -->
The first reply that delivers the ads notice returns notice before the per-turn answer is stored. A later ask for that same reply (reload, second screen) no longer takes the notice branch, skips the stored-answer reuse, and can fetch a real ad. Ads then appear on the notice turn, not the next reply.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: 3fcf5753-7dd1-4b8f-982b-05ac071326de -->
<!-- LOCATIONS START
apps/account-directory/src/cloud/gravity.ts#L757-L770
LOCATIONS END -->
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjU4OTcxMmIxLTY1NTYtNDIzNi1iYzNlLWJhYmE4ZDNmYTVlYyIsImVuY3J5cHRpb25LZXkiOiI2WmxMa3NjTFlYWlIzbVgtaXpNWlhQeUx3YW4yckdZekxsREMtblR3eG00IiwiYnJhbmNoIjoiYWRlL3ByaWNpbmctdjMtYmF0Y2gzIiwicmVwb093bmVyIjoiYXJ1bDI4IiwicmVwb05hbWUiOiJEQUVYIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjU4OTcxMmIxLTY1NTYtNDIzNi1iYzNlLWJhYmE4ZDNmYTVlYyIsImVuY3J5cHRpb25LZXkiOiI2WmxMa3NjTFlYWlIzbVgtaXpNWlhQeUx3YW4yckdZekxsREMtblR3eG00IiwiYnJhbmNoIjoiYWRlL3ByaWNpbmctdjMtYmF0Y2gzIiwicmVwb093bmVyIjoiYXJ1bDI4IiwicmVwb05hbWUiOiJEQUVYIiwicHJOdW1iZXIiOjI3MjEsImNvbW1pdFNoYSI6IjQ2ZDcxMGU3YTZlZmM5YTc5ZDg0YzJmYzk3MTI2NjM0MDE3NDNhMzkiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by Cursor Bugbot for commit 46d710e7a6efc9a79d84c2fc9712663401743a39. Configure here.</sup>
Moved computer shown as deleted
Medium Severity
<!-- DESCRIPTION START -->
The detail sheet now passes a chatId into useDeletedCloudComputers, so a chat that moved to a new computer is classified as deleted. It still has no cloudComputerMovedTo branch, so the banner says the computer was deleted and the chat is only a saved copy. The Activity list already says that computer was replaced and the chats moved.
<!-- DESCRIPTION END -->
<!-- BUGBOT_BUG_ID: 04a3618e-f302-4721-91ed-6c1bbda276e4 -->
<!-- LOCATIONS START
apps/desktop/src/renderer/components/activity/ActivityDetailSheet.tsx#L78-L204
apps/desktop/src/renderer/components/activity/ActivityDetailSheet.tsx#L257-L262
LOCATIONS END -->
<details>
<summary>Additional Locations (1)</summary>
apps/desktop/src/renderer/components/activity/ActivityDetailSheet.tsx#L257-L262</details>
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFhYThjYWNiLTcyZDktNDRhMC1hYjBjLTg3ZDczNGU4NjM2ZiIsImVuY3J5cHRpb25LZXkiOiJ0NFJydlJuWnBZdzFHNldrWThOOXFGRkw1b0Z4OXZRUzV5ME9fcUp2d2dNIiwiYnJhbmNoIjoiYWRlL3ByaWNpbmctdjMtYmF0Y2gzIiwicmVwb093bmVyIjoiYXJ1bDI4IiwicmVwb05hbWUiOiJEQUVYIiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmFhYThjYWNiLTcyZDktNDRhMC1hYjBjLTg3ZDczNGU4NjM2ZiIsImVuY3J5cHRpb25LZXkiOiJ0NFJydlJuWnBZdzFHNldrWThOOXFGRkw1b0Z4OXZRUzV5ME9fcUp2d2dNIiwiYnJhbmNoIjoiYWRlL3ByaWNpbmctdjMtYmF0Y2gzIiwicmVwb093bmVyIjoiYXJ1bDI4IiwicmVwb05hbWUiOiJEQUVYIiwicHJOdW1iZXIiOjI3MjEsImNvbW1pdFNoYSI6IjQ2ZDcxMGU3YTZlZmM5YTc5ZDg0YzJmYzk3MTI2NjM0MDE3NDNhMzkiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by Cursor Bugbot for commit 46d710e7a6efc9a79d84c2fc9712663401743a39. Configure here.</sup>
<!-- BUGBOT_REVIEW -->
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
<!-- BUGBOT_FIX_ALL -->
<a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTo3MWMxMThlOC0xNjNkLTQ2ZTUtODAzMi04NmU4MzZjMTY3NGEiLCJlbmNyeXB0aW9uS2V5IjoiTnVleWtsUGpQOEZaVElwNzdaMlhOSDdWemdVb2R6YV9VY29Ua0x5SXFNQSIsImJyYW5jaCI6ImFkZS9wcmljaW5nLXYzLWJhdGNoMyIsInJlcG9Pd25lciI6ImFydWwyOCIsInJlcG9OYW1lIjoiREFFWCIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>
<!-- /BUGBOT_FIX_ALL -->
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN -->
<sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.</sup>
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END -->
_Comment @cursor review or bugbot run to trigger another review on this PR_
<sup>Reviewed by Cursor Bugbot for commit 46d710e7a6efc9a79d84c2fc9712663401743a39. Configure here.</sup>
greptile-apps[bot]
arul28
Why
PR #2702 brought Pricing v3 and the DAEX Cloud Mac to main with both server switches off. Validation kept going on that tree and found more problems. Each was fixed on its own branch, reviewed and accepted. This PR joins those fixes, plus the ads notice that #2702 held back, on top of main.
The switches
pricing_v3andmac_computersstayoff. Nothing here turns them on.What changed
Server
ade/idle-sleep-rewakes-for-queued).ade/server-deletes-write-power-log).ade/reconcile-does-not-charge-rounding).ade/cancel-delete-retries).ade/ads-notice-shown, migration0084_ad_notice_shown.sql).Brain, CLI and desktop
ade/idle-sleep-freezes-first).ade/moved-chat-opens-where-it-lives).ade/desktop-fixes-stack, notice commit).Phone (
ade/phone-zero-credits-small)Tests
ade/pty-dispose-test-machine-independent).Database migration. One add-only file:
0084_ad_notice_shown.sql. It comes after0085_ad_proof_target_at.sqlin history, because0085went out with #2702. The migration rehearsal applied0084and0085in both orders. Each order applies cleanly, and a second apply finds nothing.Evidence
-
routes.tsimports;- the reconcile query in
cron.ts;-
CloudQueuedMessages.tsx;-
useCloudQueuedBubbles.ts.- account-directory typecheck passed, and 1158/1158 tests;
- desktop typecheck passed, and the full desktop suite;
- CLI typecheck passed.
- the account server, desktop, CLI and web typechecks and builds pass;
- the account server's full suite passes, 1158/1158;
- the desktop and CLI tests that cover the changed files pass;
- the terminal dispose test passed 5 runs in a row.
- Outside iOS, this tree is the same as the one they checked.
0084was already applied on dev.- the idle-sleep freeze on a DAEX Cloud Mac, with the runtime built from this branch;
- the cancel keep and delete rows;
- the moved-chat and Activity rows on desktop;
- the phone's launch and notice rows.
- The idle-sleep Mac row ran on a dev-only brain with a 60-second delay added before the idle-sleep ask, so its timings are not the shipped timing.
Not checked
🤖 Generated with Claude Code
<!-- greptile_comment -->
<!-- greptile_summary -->
<h2><ruby><rp>Confidence Score: 2/5 · Fix the wrong-computer resend, unseen ads notice, and slow-sleep recovery before merging.</rp></ruby><a href="https://app.greptile.com/api/retrigger?id=122969411&sig=a74be0e2cdae65a0b1c2c5c2a5c26696ce278fa8690c0943746d79d134208998"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/-/switch-tenant?tenant=versic&next=%2Farul28%2Fdaex%2Fpull%2F2721&utm_source=greptile_review&utm_medium=github&utm_campaign=view_in_greptile"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 2/5</h2>
<!-- greptile-risk -->
Fix the wrong-computer resend, unseen ads notice, and slow-sleep recovery before merging.
<h2><ruby><rp>Findings</rp></ruby><a href="https://app.greptile.com/ide/claude-code?prompt=%23%23%23%20Issue%201%0Aapps%2Fios%2FADE%2FServices%2FSyncService%2BChatLaunch.swift%3A719%0AThe%20wake%20loop%20reuses%20a%20send%20with%20a%20plain%20project%20id.%20If%20the%20person%20switches%20computers%20during%20the%20five-minute%20wait%2C%20%60performCommandRequest%60%20sends%20the%20next%20attempt%20through%20the%20newly%20focused%20connection.%20The%20launch%20fails%20on%20the%20wrong%20computer%20or%20starts%20there%20if%20that%20project%20exists.%20Keep%20the%20original%20machine%20in%20the%20scope%20used%20by%20both%20the%20resend%20and%20its%20cancel.%0A%0A%23%23%23%20Issue%202%0Aapps%2Fdesktop%2Fsrc%2Frenderer%2Fcomponents%2Fchat%2Fsponsored%2FSponsoredReplySlot.tsx%3A353-357%0AWith%20%60above_prompt%60%2C%20the%20request%20uses%20the%20dock's%20%60seen%60%20value%2C%20but%20the%20notice%20still%20requires%20the%20below-reply%20region's%20%60onScreen%60%20value.%20If%20the%20person%20is%20scrolled%20up%20when%20a%20reply%20finishes%2C%20the%20server%20marks%20the%20notice%20delivered%20without%20showing%20it.%20Starting%20the%20next%20turn%20removes%20the%20only%20turn%20allowed%20to%20show%20that%20notice%2C%20so%20later%20ads%20can%20appear%20without%20it.%20Wait%20until%20the%20notice's%20own%20region%20is%20visible%20before%20sending%20its%20delivery%20request.%0A%0A%23%23%23%20Issue%203%0Aapps%2Faccount-directory%2Fsrc%2Fcloud%2Froutes.ts%3A1418-1421%0AIf%20an%20accepted%20sleep%20takes%20longer%20than%20roughly%20fourteen%20seconds%20to%20appear%20at%20the%20provider%2C%20this%20function%20returns%20without%20waking%20the%20computer.%20The%20message's%20%60idle_sleep_rewoken%60%20row%20has%20already%20been%20written.%20If%20the%20computer%20sleeps%20just%20afterward%2C%20its%20brain%20cannot%20lift%20the%20freeze%20or%20drain%20the%20message%2C%20and%20no%20later%20attempt%20retries%20this%20wake.%20The%20message%20stays%20queued%20until%20another%20action%20wakes%20the%20computer.%20Keep%20the%20wake%20pending%20until%20the%20sleep%20finishes%20or%20is%20confirmed%20refused.%0A%0A%23%23%23%20Issue%204%0Aapps%2Fdesktop%2Fsrc%2Frenderer%2Fstate%2FaccountCloudLaunches.ts%3A633-636%0AThe%20account-change%20handler%20clears%20the%20launches%20and%20stops%20their%20poller%2C%20but%20leaves%20%60deleteOwed%60%20and%20its%20timers%20intact.%20Those%20timers%20later%20call%20%60cancelAccountCloudLaunch%60%20through%20the%20current%20account's%20bridge.%20The%20previous%20account's%20persistent%20notice%20also%20stays%20visible.%20Clear%20the%20retry%20entries%20and%20notices%20on%20account%20change%2C%20and%20guard%20in-flight%20answers%20with%20%60accountEpoch%60.%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=arul28%2Fdaex&pr=2721&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaudeDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaude.svg?v=7"><img alt="Fix All in Claude Code" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaude.svg?v=7" align="right"></picture></a>Findings</h2>
1. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> Launch reaches the wrong computer <a href="https://github.com/arul28/DAEX/pull/2721#discussion_r4730076229">▶</a>
2. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> Ads skip the visible notice <a href="https://github.com/arul28/DAEX/pull/2721#discussion_r4730076233">▶</a>
3. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> Slow sleeps lose queued wakes <a href="https://github.com/arul28/DAEX/pull/2721#discussion_r4730076238">▶</a>
4. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"> Old retries survive account changes <a href="https://github.com/arul28/DAEX/pull/2721#discussion_r4730076242">▶</a>
<details><summary>Fix with agent prompt</summary>
`
</details>
<h3>Summary</h3>
This PR joins fixes for cloud sleep races, refused deletes, daily billing corrections, moved chats, and the first-reply ads notice. It also adds phone wake waits and the add-only ads-notice migration.
Acknowledged limits: arul28
documented that a provider refusal of a cancel's delete was not forced live because there was no safe way to force it on one dev computer; server tests cover that path.arul28` also documented that the unrelated Windows-only failures are fixed on a separate branch and are not included here.<h3>Diagram</h3>
<!-- greptile_confidence_score:2 -->
<sub>Reviews (1) · Last reviewed commit: "Merge ade/phone-zero-credits-small (7dd8..." · Reviewed by Greptile</sub>
<!-- /greptile_comment -->