Skip to content

[codex] align relay agent activity Effect services#3179

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-relay-agent-activity
Jun 20, 2026
Merged

[codex] align relay agent activity Effect services#3179
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-relay-agent-activity

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Inlines the relay agent-activity service contracts on their Context.Service tags and replaces standalone shape references with Service["Service"].
  • Uses namespace imports and module-qualified access for local service modules throughout the changed files.
  • Preserves the existing effectful make values and canonical layer exports without synthetic Effect.succeed wrappers.
  • Keeps the APNs queue adapter implementation-specific as layerCloudflareQueues.
  • Replaces free-form APNs invalid-job message data with a structured finite reason; the human-readable message is derived from that reason.

Behavior

Delivery, persistence, queueing, and APNs request behavior are unchanged. The invalid-job error payload is more structured while retaining the existing messages through its getter.

Validation

  • vp test src/agentActivity from infra/relay — 8 files / 50 tests passed
  • vp check — passed; 20 pre-existing unrelated warnings
  • vp run typecheck — passed
  • git diff --check origin/main...HEAD — passed
  • Stale shape and named service-consumer audits — no violations
  • Refactor-only test audit — no test declarations or assertions added
  • Orchestration/MCP diff audit — no changes
  • Review-thread audit — no unresolved threads

Note

Low Risk
Mostly structural typing and imports; the only behavioral API shift is ApnsDeliveryJobInvalid exposing reason instead of a stored message field—callers that relied on serialized error data should use reason.

Overview
Refactors relay agent-activity modules to match the repo’s Effect Context.Service pattern: standalone *Shape interfaces are removed and service contracts are inlined on each service class. Call sites and tests now type mocks and implementations via SomeService["Service"] instead of SomeServiceShape.

ApnsClient switches to submodule imports for effect/unstable/http (Headers, HttpClient, HttpClientRequest) and uses type-only config import; implementation typing references ApnsClient["Service"].

ApnsDeliveryJobInvalid no longer stores a free-text message field. It carries a finite reason code (e.g. invalid-queue-payload, invalid-signature, missing-live-activity-aggregate); human-readable text is unchanged via a message getter mapped from reason. Validation and processSignedJob paths construct errors with reason codes.

Minor import/style updates: Function.cast via effect/Function namespace in persistence modules. No intended change to publish/deliver/register runtime behavior beyond the error payload shape for invalid queue jobs.

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

Note

Refactor relay agent activity services to inline Context.Service types and add reason codes to ApnsDeliveryJobInvalid

  • Removes separate *Shape interfaces from all agent activity services (ApnsClient, ApnsDeliveries, LiveActivities, AgentActivityRows, Devices, etc.) and inlines the service shape directly into the Context.Service generic, aligning with the Effect service pattern used elsewhere in the relay.
  • Redefines ApnsDeliveryJobInvalid in apnsDeliveryJobs.ts to carry a reason field with specific literal codes (e.g. 'missing-live-activity-aggregate', 'invalid-signature') instead of a raw message field; message is now derived via a getter.
  • Updates validatePayloadShape and verifySignedApnsDeliveryJob to construct ApnsDeliveryJobInvalid with the new reason codes.
  • Behavioral Change: ApnsDeliveryJobInvalid error objects now expose a structured reason code for programmatic inspection; callers reading .message from the schema field will need to use the getter instead.

Macroscope summarized 878c7d7.

@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: f6752d20-0f97-4da7-ae3a-50207663e4ed

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/effect-service-relay-agent-activity

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:L 100-499 changed lines (additions + deletions). labels Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea ae3bd597809dfd7771d0898f735d172973d4c1c8
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
App version: 0.1.0
Git commit: f30c72047f910d3c63edf84887f4c6392d72a650
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
App version: 0.1.0
Git commit: eb448c5d21d67cc2c283172b1ea3495232588935
Update Details Update Permalink
DetailsBranch: pr-3179
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
Git commit: f30c72047f910d3c63edf84887f4c6392d72a650
Update Permalink
DetailsBranch: pr-3179
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
Git commit: f30c72047f910d3c63edf84887f4c6392d72a650
Update QR

@juliusmarminge juliusmarminge marked this pull request as ready for review June 20, 2026 02:06
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Mechanical refactoring that reorganizes Effect service type definitions by inlining *Shape interfaces into the class generic parameter. All method signatures are preserved, and the error reason change maintains identical messages via a getter. No runtime behavior impact.

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

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-relay-agent-activity branch from b1ec08c to c24202d Compare June 20, 2026 02:43
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 02:43

Dismissing prior approval to re-evaluate c24202d

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-relay-agent-activity branch from c24202d to 878c7d7 Compare June 20, 2026 03:20
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 03:20

Dismissing prior approval to re-evaluate 878c7d7

@juliusmarminge juliusmarminge merged commit d5a72d5 into main Jun 20, 2026
15 checks passed
@juliusmarminge juliusmarminge deleted the codex/effect-service-relay-agent-activity branch June 20, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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