Skip to content

feat(push): accept a notification's workspace server - #26516

Merged
Jinwoo-H merged 2 commits into
mainfrom
feat/push-gateway-execution-host
Oct 11, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
feat/push-gateway-execution-host

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10

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 optional executionHost: a
    runtime:<id> value, capped at 2048 characters. The pattern mirrors the app's own execution-host id
    format, because the cloud image can't import src/shared.
  • buildPushDelivery (cloud/apps/push) copies it into the APNs and FCM data.
  • Absent field: delivery is unchanged.

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 paneKey
field, 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

  • Automated tests added/updated, or explained why not below

push-execution-host-routing.test.ts: a notification with executionHost reaches the APNs and FCM
payloads, and one without it is unchanged. It fails against today's strict schema with a ZodError.

Notes

  • Wire compatibility: optional field only. Old desktops never send it, and old phones ignore it.
  • During a rolling deploy: an old worker may deliver a queued push without the field. The phone
    then behaves as it does today.
  • Follow-up: the desktop and phone changes are in a separate PR, which must not merge until this
    is deployed.

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
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 08a0cc14-b6c5-46e7-ba20-455e1eca57e0

📥 Commits

Reviewing files that changed from the base of the PR and between 644252a and b9925bd.


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
📝 Walkthrough

Walkthrough

PushNotificationSchema now accepts an optional executionHost string with a runtime: prefix and length and character restrictions. buildPushDelivery copies a defined value into orca and omits the property when the value is undefined. Tests cover propagation, notifications without the field, and invalid execution-host values.


Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 64425

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

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: accepting a workspace server in push notifications.
Description check ✅ Passed The description covers the user impact, implementation, rationale, rollout order, linked issue exception, visual proof, and automated testing. It omits several template checklist sections, but the cor…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
cloud/apps/push/src/push-execution-host-routing.test.ts (1)

1-35: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Exercise apnsBody before claiming APNs coverage.

orcaDataStrings(delivery.orca) covers the FCM serialization path, but this test never calls apnsBody. A future APNs-specific change could drop executionHost while 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
📥 Commits

Reviewing files that changed from the base of the PR and between a747c1c and 644252a.

📒 Files selected for processing (3)
  • cloud/apps/push/src/push-delivery-message.ts
  • cloud/apps/push/src/push-execution-host-routing.test.ts
  • cloud/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.

@Jinwoo-H
Jinwoo-H merged commit 43645e5 into main Oct 11, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant