Repository navigation
feat(push): accept a notification's workspace server - #26516
Conversation
A desktop relays alerts for agents on its paired servers, but the push named only the server's worktree, so a tap opened it on the desktop and bounced. The gateway accepts an optional runtime execution host and forwards it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to The host currently reaches the APNs payload, but the test does not protect that path against a later regression. Add the payload assertion before merging if this coverage is expected from the change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1
✨ Finishing Touches 💡 1
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cloud/apps/push/src/push-execution-host-routing.test.ts (1)
1-35: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winExercise
apnsBodybefore claiming APNs coverage.
orcaDataStrings(delivery.orca)covers the FCM serialization path, but this test never callsapnsBody. A future APNs-specific change could dropexecutionHostwhile both current assertions remain green. Add an assertion on the APNs payload.Suggested fix
+import { apnsBody } from './apns-client.js' import { buildPushDelivery, orcaDataStrings } from './push-delivery-message.js' @@ expect(delivery.orca.executionHost).toBe(expected) expect(orcaDataStrings(delivery.orca).executionHost).toBe(expected) + expect(JSON.parse(apnsBody(delivery)).orca.executionHost).toBe(expected)
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
748ce2ec-91c2-420d-bcb2-41429dc3c5ca
📒 Files selected for processing (3)
cloud/apps/push/src/push-delivery-message.tscloud/apps/push/src/push-execution-host-routing.test.tscloud/packages/push-contract/src/send-messages.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
ELI5
The push service will accept one more optional field on a notification: which Orca server the
workspace runs on. Nothing sends it yet. A follow-up desktop change will, so that tapping a phone
notification about an agent on a server opens that workspace on the right server.
What Changed
Before: the push service rejects any notification field it doesn't know (the schema is strict), so a
desktop can't tell the phone which server a workspace is on.
After:
PushNotificationSchema(cloud/packages/push-contract) accepts an optionalexecutionHost: aruntime:<id>value, capped at 2048 characters. The pattern mirrors the app's own execution-host idformat, because the cloud image can't import
src/shared.buildPushDelivery(cloud/apps/push) copies it into the APNs and FCM data.Why
The desktop forwards alerts for agents running on the servers it's connected to. Today those alerts
name only the server's workspace id, so a tap opens it on the desktop and bounces ("That workspace no
longer exists on this host"). This field lets the phone open it on the server.
Rollout order: this has to be deployed before any desktop that sends the field. A strict old
gateway rejects the whole push, and the desktop doesn't retry a rejected push. Once desktops send the
field, the gateway must not be rolled back below this change. This follows the earlier
paneKeyfield, which was also added to the gateway first.
Linked Issue
N/A (maintainer)
Visual Proof
N/A. Service-side field only; nothing sends it yet.
Testing
push-execution-host-routing.test.ts: a notification withexecutionHostreaches the APNs and FCMpayloads, and one without it is unchanged. It fails against today's strict schema with a ZodError.
Notes
then behaves as it does today.
is deployed.