[codex] Structure relay Live Activity errors - #3314
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR adds contextual fields (userId, deviceId, operation) to Live Activity error classes for better debugging. No runtime behavior changes - only error message content is enhanced, with corresponding tests added. You can customize Macroscope's approvability policy. Learn more. |
3e13a7e to
90f0210
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
90f0210 to
e4885fa
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate cdef70f
Summary
Validation
vp check(passes with 20 pre-existing warnings)vp run typecheck/Users/julius/.codex/worktrees/d5fa/codething-mvp/node_modules/.bin/vp test infra/relay/src/agentActivity/LiveActivities.test.ts --no-cache(3 tests)Overlap audit
feat(relay): enforce resource limits); that unrelated overlap is reported here for visibilityNote
Low Risk
Observability and error-shape changes only; persistence behavior is unchanged and covered by new failure-mapping tests.
Overview
Relay Live Activity persistence failures now carry structured correlation data instead of only a wrapped
cause.The three tagged errors gain fields such as
userId,deviceId,operation, and optionalkind, with human-readablemessagestrings derived from that context. Each service method (register,listTargets,markDelivery,markStartQueued,clearStartQueued,invalidateDeliveryToken) maps DB failures at the boundary viaEffect.mapError, including wrappinginvalidateDeliveryTokenin an innerEffect.genso all branches share the same error shape.A new test drives a failing fake
RelayDbthrough every operation and assertsuserId,deviceId,operation/kind,cause, and messages.Reviewed by Cursor Bugbot for commit cdef70f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add correlation context fields to Live Activity persistence errors in relay
Enriches the three persistence error classes in LiveActivities.ts with structured context fields so failures are easier to trace.
LiveActivityRegistrationPersistenceErrornow includesuserIdanddeviceId;LiveActivityTargetListPersistenceErrorincludesuserId;LiveActivityDeliveryMarkPersistenceErrorincludesoperation,userId,deviceId, andkind.LiveActivitiesservice handlers (register,listTargets,markDelivery,markStartQueued,clearStartQueued,invalidateDeliveryToken) now map DB failures to the appropriate enriched error type.Macroscope summarized cdef70f.