Skip to content
Prev Previous commit
Next Next commit
fixes
  • Loading branch information
sanchitrk committed Sep 16, 2026
commit 70844bb601bb19e6884eaa6c75ce16b70bbe0dc5
5 changes: 1 addition & 4 deletions packages/codework/src/server/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ export const run = Effect.fn("Client.run")(function* <E, R>(
);

yield* Effect.raceFirst(consume, reconcile);
if (settled) {
yield* rpc["session.wait"]({ sessionId: input.sessionId });
return;
}
if (settled) return;
if (abandoned)
return yield* unattributed ?? new ExecutionError({ type: "unknown", message: "Prompt was not promoted" });
return yield* new ExecutionError({
Expand Down
8 changes: 3 additions & 5 deletions packages/codework/src/server/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export class Service extends Context.Service<Service, Interface>()("@codeworksh/
* Failure is per-cause, not per-feed: a client that cannot keep up fails alone
* with its own overflow, while an event that cannot be encoded is a server bug
* that disconnects everyone currently attached -- the feed stays usable for
* whoever connects next. Types outside the public registry (plugin events,
* §12) are dropped before they can consume a client's capacity.
* whoever connects next. Types outside the server's registry are dropped
* before they can consume a client's capacity.
*/
export const make = Effect.fn("EventFeed.make")(function* (
listen: (subscriber: Event.Subscriber) => Effect.Effect<Event.Unsubscribe>,
Expand Down Expand Up @@ -83,9 +83,7 @@ export const layer = Layer.effect(
Effect.gen(function* () {
const events = yield* Event.Service;
const registered = yield* EventRegistry.Service;
return yield* make(events.listen, {
registry: (type) => (type === Envelope.Connected.type ? Envelope.Connected : registered.get(type)),
});
return yield* make(events.listen, { registry: registered.get });
}),
);

Expand Down