Skip to content

Commit f5df2ff

Browse files
Berkay2002claude
andauthored
fix(server): restore contract methods used by perf latency test (#4)
* fix(server): restore contract methods used by perf latency test The serverLatency.perf.test.ts cherry-pick referenced WS methods that weren't present in this fork, causing typecheck failures: - Adds subscribeOrchestrationDomainEvents streaming RPC so the perf harness can observe orchestration domain events end-to-end - Switches the git RPC latency probes to gitRefreshStatus, the existing equivalent of upstream's git.status unary RPC * fix(perf): rename git.status latency series to git.refreshStatus Keeps the perf artifact/metric labels consistent with the RPC method actually being measured, addressing review feedback on #4. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6f49435 commit f5df2ff

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

apps/server/integration/perf/serverLatency.perf.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,12 @@ describe("server perf latency", () => {
774774
const gitLatencyIdle = await Promise.all([
775775
measureRpcLatencySeries({
776776
harness,
777-
name: "git.status",
777+
name: "git.refreshStatus",
778778
loadProfile: "idle-repo-pressure",
779779
iterations: GIT_RPC_SAMPLE_COUNT,
780780
execute: () =>
781781
harness!.rpc.request((client) =>
782-
client[WS_METHODS.gitStatus]({
782+
client[WS_METHODS.gitRefreshStatus]({
783783
cwd: harness!.seededState.workspaceRoot,
784784
}),
785785
),
@@ -850,12 +850,12 @@ describe("server perf latency", () => {
850850
const gitLatencyMixed = await Promise.all([
851851
measureRpcLatencySeries({
852852
harness,
853-
name: "git.status",
853+
name: "git.refreshStatus",
854854
loadProfile: "mixed-stream-terminal-git",
855855
iterations: GIT_RPC_SAMPLE_COUNT,
856856
execute: () =>
857857
harness!.rpc.request((client) =>
858-
client[WS_METHODS.gitStatus]({
858+
client[WS_METHODS.gitRefreshStatus]({
859859
cwd: harness!.seededState.workspaceRoot,
860860
}),
861861
),

apps/server/src/ws.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,12 @@ const makeWsRpcLayer = (currentSessionId: AuthSessionId) =>
10441044
}),
10451045
{ "rpc.aggregate": "auth" },
10461046
),
1047+
[WS_METHODS.subscribeOrchestrationDomainEvents]: (_input) =>
1048+
observeRpcStream(
1049+
WS_METHODS.subscribeOrchestrationDomainEvents,
1050+
orchestrationEngine.streamDomainEvents,
1051+
{ "rpc.aggregate": "orchestration" },
1052+
),
10471053
});
10481054
}),
10491055
);

packages/contracts/src/rpc.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
ClientOrchestrationCommand,
3636
ORCHESTRATION_WS_METHODS,
3737
OrchestrationDispatchCommandError,
38+
OrchestrationEvent,
3839
OrchestrationGetFullThreadDiffError,
3940
OrchestrationGetFullThreadDiffInput,
4041
OrchestrationGetSnapshotError,
@@ -121,6 +122,7 @@ export const WS_METHODS = {
121122
subscribeServerConfig: "subscribeServerConfig",
122123
subscribeServerLifecycle: "subscribeServerLifecycle",
123124
subscribeAuthAccess: "subscribeAuthAccess",
125+
subscribeOrchestrationDomainEvents: "subscribeOrchestrationDomainEvents",
124126
} as const;
125127

126128
export const WsServerUpsertKeybindingRpc = Rpc.make(WS_METHODS.serverUpsertKeybinding, {
@@ -351,6 +353,15 @@ export const WsSubscribeAuthAccessRpc = Rpc.make(WS_METHODS.subscribeAuthAccess,
351353
stream: true,
352354
});
353355

356+
export const WsSubscribeOrchestrationDomainEventsRpc = Rpc.make(
357+
WS_METHODS.subscribeOrchestrationDomainEvents,
358+
{
359+
payload: Schema.Struct({}),
360+
success: OrchestrationEvent,
361+
stream: true,
362+
},
363+
);
364+
354365
export const WsRpcGroup = RpcGroup.make(
355366
WsServerGetConfigRpc,
356367
WsServerRefreshProvidersRpc,
@@ -389,4 +400,5 @@ export const WsRpcGroup = RpcGroup.make(
389400
WsOrchestrationReplayEventsRpc,
390401
WsOrchestrationSubscribeShellRpc,
391402
WsOrchestrationSubscribeThreadRpc,
403+
WsSubscribeOrchestrationDomainEventsRpc,
392404
);

0 commit comments

Comments
 (0)