Repository navigation
fix(desktop): surface silent client failures - #10084
Conversation
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for tightening these fail-open/silent-failure paths. I reviewed the diff and the direction looks good: the Rust agent VM recovery paths now log and fail closed for authoritative Firestore transitions, use_custom_token=true no longer returns a partial success when custom-token minting is unavailable, and the desktop/Electron changes surface previously swallowed errors without changing the fallback behavior.
A few maintainer notes before this should merge:
- This touches auth, agent VM state, and CI/workflow behavior, so I’m not going to formally approve it from automation; it needs human maintainer sign-off on the intended fail-closed UX and the
no-changelog-neededCI bypass semantics. - GitHub currently reports the branch as not cleanly mergeable (
DIRTY), so it needs to be brought up to date withmainbefore final review/merge. - I could not run the Rust check locally in this sandbox because
cargois not installed here, but the PR’s GitHub checks show the Rust Backend and Desktop Swift Build & Tests jobs passing.
No blocking code issue jumped out from the patch review; after the merge conflict is resolved, I’d mainly want a maintainer to confirm the auth/agent failure behavior is the desired product behavior.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
Scope and behavioral-proof follow-upThe fail-closed direction is promising, but this remains a cross-cutting auth/agent-state/workflow PR. Before merge:
A maintainer still needs to explicitly sign off on the intended user-facing fail-closed UX. |
adb59ed to
4e3b27d
Compare
533013a to
767f7ea
Compare
|
retriggering CI |
|
Hey @undivisible 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
767f7ea to
5d00a1f
Compare
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the follow-up on this head. The fail-closed/silent-failure direction still looks worthwhile, but I’m going to keep this in changes-requested state before merge.
Blocking items that still apply on f0955b8:
- The Desktop Swift CI
no-changelog-needed/--skip-changelogbehavior is still bundled with the auth and agent-state runtime hardening. That workflow policy change is independently reviewable/rollbackable, so please split it from the auth/agent/desktop failure-surfacing changes. - I still don’t see focused behavioral coverage for the Rust auth custom-token error contract (
use_custom_token=trueshould hard-error rather than return a partial payload) or for failed Firestore/GCE authoritative agent-VM transitions. The existing CI is helpful, but these are security/user-state-sensitive behavior changes and need direct regression coverage. - A human maintainer still needs to sign off on the intended fail-closed UX for the auth and agent-state paths before merge.
No security attack concern from my review; this is normal heightened review because the PR touches auth, agent VM state, and workflow/changelog enforcement.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
@undivisible this looks good to merge on review but has merge conflicts with |
f0955b8 to
3748b45
Compare
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Addressed CHANGES_REQUESTED on
Human maintainer sign-off on fail-closed UX still needed per prior review. |
Restore backend/database/memories.py so this PR no longer triggers the full backend unit suite (unrelated dead-code removal). Add HTTP-level auth token fail-closed tests and an async agent transition contract test alongside the existing helper unit coverage. Failure-Class: none Co-authored-by: Cursor <[email protected]>
Review blocker follow-up (
|
| Contract | Test |
|---|---|
use_custom_token=true hard-errors instead of partial payload |
auth_token_with_custom_token_fails_closed_when_mint_unavailable (POST /v1/auth/token → 400 custom_token_unavailable, no id_token) |
| Mint skipped when custom token not requested | auth_token_without_custom_token_returns_id_token_without_mint |
| Authoritative Firestore agent-VM transition fails closed | authoritative_agent_vm_transition_fails_closed_in_async_handler (+ existing fail_closed_firestore_transition_* helper tests) |
| Custom-token helper | existing require_custom_token_* unit tests |
Local verification: cargo test auth_token_ fail_closed authoritative_agent in desktop/macos/Backend-Rust.
3. Backend unit suite failure
Root cause: the earlier backend/database/memories.py deletion forced the full backend unit suite (backend/database/** → full run). That suite was failing in parallel CI due to unrelated langchain_core stub pollution in other test files — not caused by the auth/agent/desktop runtime changes.
Fix: restored memories.py on this branch so backend unit selection is now “no backend files changed” and the suite should skip for this PR.
Ready for human maintainer sign-off (cannot be automated)
Please confirm the intended fail-closed UX for:
- Auth token exchange — desktop clients sending
use_custom_token=truenow receive400 { error: "custom_token_unavailable" }when minting is unavailable, instead of a partial token payload. Clients must surface/handle that hard error. - Agent VM status recovery — when an authoritative Firestore write during stopped/missing-VM recovery fails, the handler returns 500 (via
?onfail_closed_firestore_transition) rather than proceeding as if the transition succeeded.
Desktop failure-surfacing (Swift APIClient+Apps, Windows token/screen/retention logging) remains unchanged from 3748b45a26.
Head for re-review: 8a15569024
Current head resolves the stale automation blockers: wording now matches the desktop-only diagnostic diff and relevant checks are green.
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for the follow-up. I re-reviewed the current head against the last automation blockers.
The two items from the previous changes-requested review now look resolved: the changelog/PR wording is narrowed to desktop/client diagnostics rather than agent behavior, and the Desktop Swift/Windows checks are green on this head. The remaining diff is cohesive and low-risk: it surfaces previously swallowed macOS app-setup and Windows token/screen/retention failures while preserving the existing fallback return behavior.
I’m dismissing the stale automated changes-requested review. I’m still not formally approving from automation because the PR touches auth-adjacent token-storage diagnostics and screen/retention logging, so please keep the existing human/security review labels until a maintainer is comfortable with the diagnostic/logging surface.
No security attack concern from my review.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
9668b55 to
c71a0a6
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_50bf9f4c-5d1c-4f44-ac31-19827ff15367) |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Re-reviewed the current head (c71a0a6). The narrowed diff looks cohesive: it surfaces previously swallowed desktop client failures in macOS app setup and Windows token/screen/retention paths while preserving the existing fallback behavior. I do not see a code blocker or a security-attack concern in these changed files.
I’m still not formally approving from automation. This touches auth-adjacent token-storage diagnostics plus screen/retention logging, and the current Backend Hermetic Merge Gate check is failing, so please keep needs-maintainer-review / security-review until a maintainer signs off on the diagnostic/logging surface and the checks are green.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
c71a0a6 to
c16240d
Compare
Git-on-my-level
left a comment
There was a problem hiding this comment.
Re-reviewed the current head (c16240d). This is still a cohesive desktop diagnostics cleanup, and the current checks are green. I do not see a code blocker or a security-attack concern in the changed files:
desktop/macos/Desktop/Sources/Services/APIClient/APIClient+Apps.swiftnow logs both non-JSON setup-status responses and thrown request failures, while preserving the existingfalsefallback fromisAppSetupCompleted().desktop/macos/changelog/unreleased/20260724-silent-failure-logging.jsonaccurately scopes the release note to desktop diagnostics for app setup, connected accounts, screen capture, and retention cleanup.desktop/macos/e2e/flows/apps.yamladdsAPIClient+Apps.swiftto the manual apps flow coverage list, which matches where the app setup diagnostics are exercised.desktop/windows/src/main/integrations/tokenStore.tslogs corrupt/unreadable secure-storage failures but still returnsnull, so the Google-token load behavior remains fail-soft.desktop/windows/src/main/ipc/screen.tslogs primary-screen lookup failures and keeps the existing fallback to the first captured screen.desktop/windows/src/main/rewind/retentionRunner.tscontinues treatingENOENTas idempotent while surfacing other frame-deletion failures so retention disk-growth issues are diagnosable.
I’m still not formally approving from automation because this touches auth-adjacent token-storage diagnostics plus screen/retention logging surfaces, and the existing security-review / needs-maintainer-review labels are the right place for maintainer sign-off on the diagnostic/logging behavior before merge.
by AI on behalf of David — security-sensitive desktop diagnostics need human maintainer sign-off before merge.
c16240d to
72fbe24
Compare
72fbe24 to
4101216
Compare
kodjima33
left a comment
There was a problem hiding this comment.
Swallowed desktop client failures are now logged on both macOS setup checks and the Windows connected-account/capture/retention paths; logging-only, success paths unchanged.
Summary
Surface previously swallowed desktop client failures in macOS app setup checks and Windows connected-account, screen-capture, and retention cleanup paths.
Product invariants affected
Verification
xcrun swift test -c debug --package-path Desktop --filter APIClientSetupCompletedTestscompiled successfully. The local XCTest runner could not load Sparkle under host Xcode Beta 27; the authoritative rerun uses CI’s pinned Xcode 16.4.Failure-Class: none
Note
Low Risk
Logging-only changes with no altered success paths; failures remain handled as before but are easier to diagnose in support and CI logs.
Overview
Replaces swallowed errors with diagnostic logging on macOS and Windows desktop paths where failures were previously invisible. Runtime behavior on failure stays the same (e.g. setup still reports not completed, token load still returns null).
macOS:
isAppSetupCompletednow logs when the setup-status response is not JSON and when the network request fails, instead of an emptycatch.Windows: Google refresh token load warns on corrupt secure storage (still returns null so UI does not treat corruption as “never connected”). Screen capture fallback warns when primary display lookup fails before using the first screen. Rewind retention logs non-
ENOENTframe delete failures during prune; launch and hourly prune already had top-level failure warnings.Also adds an unreleased changelog entry and extends the macOS apps e2e flow covers to include
APIClient+Apps.swift.Reviewed by Cursor Bugbot for commit c71a0a6. Bugbot is set up for automated code reviews on this repo. Configure here.