Skip to content

[codex] Structure agent awareness registration errors#3328

Merged
juliusmarminge merged 2 commits into
mainfrom
codex/mobile-agent-awareness-errors
Jun 20, 2026
Merged

[codex] Structure agent awareness registration errors#3328
juliusmarminge merged 2 commits into
mainfrom
codex/mobile-agent-awareness-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • wrap native, storage, auth-provider, and Live Activity registration failures in a Schema-tagged operation error
  • attach stable operation fields while preserving every exact underlying cause
  • make background registration logs correlate failures without deriving messages from cause text
  • keep notification permission and preference-setting errors isolated in [codex] Structure mobile notification setting failures #3391

Validation

  • pnpm vp test apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts (14 tests)
  • pnpm vp check (passes with existing repository warnings)
  • pnpm vp run typecheck
  • pnpm vp run lint:mobile

Note

Low Risk
Error-shape and observability changes only; registration success/skip behavior and background coalescing are largely unchanged.

Overview
Agent awareness remote registration now wraps native, storage, relay-auth, and Live Activity failures in a Schema-tagged AgentAwarenessOperationError instead of passing through raw thrown values.

Each failure gets a stable operation label (for example read-live-activity-push-token, load-device-registration-identifier, read-device-registration-relay-token) and keeps the original defect in cause, with a fixed message shape for logging and correlation. Relay token lookup is split so device registration and live activity registration record distinct operation names on auth failures.

A test asserts that a rejected getPushToken() surfaces as AgentAwarenessOperationError with the expected operation and preserved cause. Existing “soft” paths (e.g. native APNs lookup falling back to null, active activity listing returning []) are unchanged aside from the wrapped error type where errors are logged or propagated.

Reviewed by Cursor Bugbot for commit eee9112. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7d390181-c13d-4d7c-81df-2bf4dda2a6f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/mobile-agent-awareness-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/mobile-agent-awareness-errors branch from 9792f0e to 8410521 Compare June 20, 2026 12:25
@juliusmarminge juliusmarminge changed the title [codex] Structure agent awareness registration errors [codex] Structure agent awareness operation errors Jun 20, 2026
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR adds structured error typing to existing error handling without changing control flow. All catch handlers already existed; they now wrap errors in a tagged AgentAwarenessOperationError class for better observability. A corresponding test was added.

No code changes detected at eee9112. Prior analysis still applies.

You can customize Macroscope's approvability policy. Learn more.

@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 14:53

Dismissing prior approval to re-evaluate e44a51c

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jun 20, 2026
@juliusmarminge juliusmarminge changed the title [codex] Structure agent awareness operation errors [codex] Structure agent awareness registration errors Jun 20, 2026
juliusmarminge and others added 2 commits June 20, 2026 13:47
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge force-pushed the codex/mobile-agent-awareness-errors branch from e44a51c to eee9112 Compare June 20, 2026 20:50
@juliusmarminge juliusmarminge merged commit 97de7d7 into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/mobile-agent-awareness-errors branch June 20, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant