Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/server/integration/perf/serverLatency.perf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,12 +774,12 @@ describe("server perf latency", () => {
const gitLatencyIdle = await Promise.all([
measureRpcLatencySeries({
harness,
name: "git.status",
name: "git.refreshStatus",
loadProfile: "idle-repo-pressure",
iterations: GIT_RPC_SAMPLE_COUNT,
execute: () =>
harness!.rpc.request((client) =>
client[WS_METHODS.gitStatus]({
client[WS_METHODS.gitRefreshStatus]({
cwd: harness!.seededState.workspaceRoot,
}),
),
Expand Down Expand Up @@ -850,12 +850,12 @@ describe("server perf latency", () => {
const gitLatencyMixed = await Promise.all([
measureRpcLatencySeries({
harness,
name: "git.status",
name: "git.refreshStatus",
loadProfile: "mixed-stream-terminal-git",
iterations: GIT_RPC_SAMPLE_COUNT,
execute: () =>
harness!.rpc.request((client) =>
client[WS_METHODS.gitStatus]({
client[WS_METHODS.gitRefreshStatus]({
cwd: harness!.seededState.workspaceRoot,
}),
),
Expand Down
6 changes: 6 additions & 0 deletions apps/server/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,12 @@ const makeWsRpcLayer = (currentSessionId: AuthSessionId) =>
}),
{ "rpc.aggregate": "auth" },
),
[WS_METHODS.subscribeOrchestrationDomainEvents]: (_input) =>
observeRpcStream(
WS_METHODS.subscribeOrchestrationDomainEvents,
orchestrationEngine.streamDomainEvents,
{ "rpc.aggregate": "orchestration" },
),
});
}),
);
Expand Down
12 changes: 12 additions & 0 deletions packages/contracts/src/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
ClientOrchestrationCommand,
ORCHESTRATION_WS_METHODS,
OrchestrationDispatchCommandError,
OrchestrationEvent,
OrchestrationGetFullThreadDiffError,
OrchestrationGetFullThreadDiffInput,
OrchestrationGetSnapshotError,
Expand Down Expand Up @@ -121,6 +122,7 @@ export const WS_METHODS = {
subscribeServerConfig: "subscribeServerConfig",
subscribeServerLifecycle: "subscribeServerLifecycle",
subscribeAuthAccess: "subscribeAuthAccess",
subscribeOrchestrationDomainEvents: "subscribeOrchestrationDomainEvents",
} as const;

export const WsServerUpsertKeybindingRpc = Rpc.make(WS_METHODS.serverUpsertKeybinding, {
Expand Down Expand Up @@ -351,6 +353,15 @@ export const WsSubscribeAuthAccessRpc = Rpc.make(WS_METHODS.subscribeAuthAccess,
stream: true,
});

export const WsSubscribeOrchestrationDomainEventsRpc = Rpc.make(
WS_METHODS.subscribeOrchestrationDomainEvents,
{
payload: Schema.Struct({}),
success: OrchestrationEvent,
stream: true,
},
);

export const WsRpcGroup = RpcGroup.make(
WsServerGetConfigRpc,
WsServerRefreshProvidersRpc,
Expand Down Expand Up @@ -389,4 +400,5 @@ export const WsRpcGroup = RpcGroup.make(
WsOrchestrationReplayEventsRpc,
WsOrchestrationSubscribeShellRpc,
WsOrchestrationSubscribeThreadRpc,
WsSubscribeOrchestrationDomainEventsRpc,
);
Loading