Skip to content
Source
Sign inSign up
pingdotgg/t3code

Fix OpenCode event session routing #2634

Closedsamjandris(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2634/headopened View on GitHub

Showing 2 changed files with 130 additions and 15 deletions.

x
0 of 2 viewed, 2 left
113 additions and 7 deletionsapps/server/src/provider/Layers/OpenCodeAdapter.test.tsModified
View file
@@ -63,6 +63,9 @@
closeError: null as Error | null,
messages: [] as MessageEntry[],
subscribedEvents: [] as unknown[],
+ subscribedEventDirectory: process.cwd(),
+ globalEventCalls: 0,
+ keepSubscriptionOpen: false,
},
reset() {
this.state.startCalls.length = 0;
@@ -76,9 +79,21 @@
this.state.closeError = null;
this.state.messages = [];
this.state.subscribedEvents = [];
+ this.state.subscribedEventDirectory = process.cwd();
+ this.state.globalEventCalls = 0;
+ this.state.keepSubscriptionOpen = false;
},
};
​
+function toGlobalEvent(event: unknown, directory: string): unknown {
+ return event && typeof event === "object" && "payload" in event
+ ? event
+ : {
+ directory,
+ payload: event,
+ };
+}
+​