Conversation
| alertAllowedForPhase(input.preferences, input.phase) && | ||
| ((input.phase !== "completed" && input.phase !== "failed") || | ||
| isFreshTerminalNotification(input.updatedAt, input.nowMs)) | ||
| isFreshNotification(input.updatedAt, input.nowMs) |
There was a problem hiding this comment.
🟡 Medium agentActivity/agentActivityAlerts.ts:147
Stale waiting_for_input or waiting_for_approval updates still produce APNs alerts for armed iOS Live Activities, bypassing the intended two-minute limit. Those paths call alertForAttentionTransition directly in ApnsDeliveries.ts (including delivery-job revalidation) without checking updatedAt against nowMs; apply the same freshness filtering there.
🤖 Copy this AI Prompt to have your agent fix this:
In file @infra/relay/src/agentActivity/agentActivityAlerts.ts around line 147:
Stale `waiting_for_input` or `waiting_for_approval` updates still produce APNs alerts for armed iOS Live Activities, bypassing the intended two-minute limit. Those paths call `alertForAttentionTransition` directly in `ApnsDeliveries.ts` (including delivery-job revalidation) without checking `updatedAt` against `nowMs`; apply the same freshness filtering there.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This change modifies existing startup and live notification behavior across signed relay payloads, event scheduling, APNs, and FCM delivery paths rather than making a small isolated correction. An unresolved Medium-severity finding also identifies an APNs path where stale attention alerts can still be emitted. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe relay now marks startup snapshot publications as replays. The replay marker travels through request signing, API forwarding, and APNs/FCM delivery. Replay deliveries suppress alerts. Notification freshness now applies to attention states. ChangesReplay-aware agent activity publishing
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix · Severity of issue fixed: Low Sequence Diagram(s)sequenceDiagram
participant AgentAwarenessRelay
participant PublishAPI
participant AgentActivityPublisher
participant APNs
participant FCM
AgentAwarenessRelay->>PublishAPI: submit replay-marked activity request
PublishAPI->>AgentActivityPublisher: forward replay flag
AgentActivityPublisher->>APNs: enqueue silent replay delivery
AgentActivityPublisher->>FCM: enqueue silent replay delivery
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The replay marker is carried through signing and mobile delivery, and attention notifications use the intended freshness window. No current merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Restarting an environment republishes saved agent state and can flood iOS with completion and input notifications.
What Changed
Mark startup catch-up as signed silent replay and pass it through the existing APNs/FCM replay handling. Use the existing worker to serialize catch-up with live updates, and keep replay silent only while the captured state still matches. Deferred confirmations retain that identity. Ignore settlement-only events and apply the existing two-minute notification freshness window to input and approval pushes.
Why
Saved state must restore remote activity without being treated as new work. Fresh transitions still alert. This complements #9081's terminal timestamp fix and does not duplicate #11073's concurrent-thread notification selection.
Verification
Requires server and relay updates. No mobile UI change or production deployment is included.
Closes #11886
Checklist
Implemented with GPT-6 in the Codex harness. Reviewed with Claude Sonnet 5 before opening the PR; its Android replay finding was reproduced and fixed with two regression cases.
Summary by CodeRabbit
New Features
Bug Fixes