Repository navigation
fix(opencode-plugin): propagate surface_id on feed events so notifications target opencode pane #6504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(opencode-plugin): propagate surface_id on feed events so notifications target opencode pane #6504
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -408,6 +408,10 @@ export const CMUXFeed = async (ctx) => { | |
| typeof process.env.CMUX_WORKSPACE_ID === "string" && process.env.CMUX_WORKSPACE_ID.trim() | ||
| ? process.env.CMUX_WORKSPACE_ID.trim() | ||
| : null; | ||
| const surfaceId = | ||
| typeof process.env.CMUX_SURFACE_ID === "string" && process.env.CMUX_SURFACE_ID.trim() | ||
| ? process.env.CMUX_SURFACE_ID.trim() | ||
| : null; | ||
| const event = { | ||
| session_id: `opencode-${sessionId}`, | ||
| _source: "opencode", | ||
|
|
@@ -416,6 +420,7 @@ export const CMUXFeed = async (ctx) => { | |
| ...extra, | ||
| }; | ||
| if (workspaceId) event.workspace_id = workspaceId; | ||
| if (surfaceId) event.surface_id = surfaceId; | ||
|
Comment on lines
411
to
+423
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The PR description mentions "a matching one-line change on the Swift side," but the actual minimum required is two changes: (1) add a |
||
| if (context) event.context = context; | ||
| return event; | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surfaceId: nilEven after the Swift model is updated, the
TerminalNotificationPolicyPayloadbuilt inFeedCoordinator(line 1067 ofFeedCoordinator.swift) hard-codessurfaceId: nil, so push notifications generated for blocking events will still not carry a surface target. This path is separate from the attention-overlay routing, but it means Bell/notification-centre alerts will remain workspace-level only until that site is also updated to read the event'ssurfaceId.