Persist session model switches outside event flag (#26765)

This commit is contained in:
Dax
2026-05-10 18:53:14 -04:00
committed by GitHub
parent edffba1425
commit e2ddddb42a
3 changed files with 65 additions and 38 deletions
+3 -2
View File
@@ -44,9 +44,10 @@ export function define<const Type extends string, Fields extends Schema.Struct.F
export function run<Def extends SyncEvent.Definition>(
def: Def,
data: SyncEvent.Event<Def>["data"],
options?: { publish?: boolean },
// Temporary escape hatch while the full v2 event system remains experimental.
options?: { publish?: boolean; bypassExperimentalEventSystem?: boolean },
) {
if (!Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) return
if (!options?.bypassExperimentalEventSystem && !Flag.OPENCODE_EXPERIMENTAL_EVENT_SYSTEM) return
SyncEvent.run(def, data, options)
}