Skip to content

fix(server): restore contract methods used by perf latency test#4

Merged
Berkay2002 merged 2 commits into
mainfrom
claude/fix-server-latency-test-lk45L
Apr 16, 2026
Merged

fix(server): restore contract methods used by perf latency test#4
Berkay2002 merged 2 commits into
mainfrom
claude/fix-server-latency-test-lk45L

Conversation

@Berkay2002
Copy link
Copy Markdown
Owner

@Berkay2002 Berkay2002 commented Apr 16, 2026

Summary

Fixes the @berkayorhan/bcode#typecheck failure coming from apps/server/integration/perf/serverLatency.perf.test.ts. The cherry-picked perf test referenced WS contract methods that hadn't been cherry-picked into this fork.

  • Adds a subscribeOrchestrationDomainEvents streaming RPC (contract + server handler) so the perf harness can observe raw orchestration domain events over the existing websocket RPC group.
  • Switches the git latency probes to the fork's existing gitRefreshStatus unary RPC (upstream git.status equivalent).

Changes

  • packages/contracts/src/rpc.ts — adds WS_METHODS.subscribeOrchestrationDomainEvents, the WsSubscribeOrchestrationDomainEventsRpc definition (streams OrchestrationEvent), and wires it into WsRpcGroup.
  • apps/server/src/ws.ts — adds the handler that returns orchestrationEngine.streamDomainEvents through observeRpcStream.
  • apps/server/integration/perf/serverLatency.perf.test.ts — replaces WS_METHODS.gitStatus with WS_METHODS.gitRefreshStatus.

Test plan

  • bun turbo run typecheck — all 8 packages succeed
  • bun run lint — no new errors
  • CI typecheck green

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
@github-actions github-actions Bot added size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 16, 2026
@Berkay2002 Berkay2002 marked this pull request as ready for review April 16, 2026 21:44
Copilot AI review requested due to automatic review settings April 16, 2026 21:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores missing websocket RPC contract surface needed by the server latency perf integration test, aligning this fork with the perf harness expectations.

Changes:

  • Added a new websocket streaming RPC subscribeOrchestrationDomainEvents that streams OrchestrationEvent values (contract + group wiring).
  • Implemented the server-side websocket handler to expose orchestrationEngine.streamDomainEvents via observeRpcStream.
  • Updated perf latency probes to use the fork’s existing gitRefreshStatus RPC instead of upstream gitStatus.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/contracts/src/rpc.ts Adds the new WS method constant and WsSubscribeOrchestrationDomainEventsRpc, and includes it in WsRpcGroup.
apps/server/src/ws.ts Adds the websocket RPC handler that streams orchestration domain events.
apps/server/integration/perf/serverLatency.perf.test.ts Switches git latency probes from gitStatus to gitRefreshStatus.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 777 to 783
harness!.rpc.request((client) =>
client[WS_METHODS.gitStatus]({
client[WS_METHODS.gitRefreshStatus]({
cwd: harness!.seededState.workspaceRoot,
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latency series is still labeled name: "git.status", but the RPC being executed is now WS_METHODS.gitRefreshStatus. This will make the perf artifact/metrics misleading; consider renaming the series (e.g. to git.refreshStatus) or otherwise keeping the label consistent with the actual RPC method.

Copilot uses AI. Check for mistakes.
Comment on lines 853 to 859
harness!.rpc.request((client) =>
client[WS_METHODS.gitStatus]({
client[WS_METHODS.gitRefreshStatus]({
cwd: harness!.seededState.workspaceRoot,
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latency series is still labeled name: "git.status", but the RPC being executed is now WS_METHODS.gitRefreshStatus. To avoid confusing perf reports, update the series name (or otherwise ensure the label matches the method being measured).

Copilot uses AI. Check for mistakes.
Keeps the perf artifact/metric labels consistent with the RPC method
actually being measured, addressing review feedback on #4.
@Berkay2002 Berkay2002 merged commit f5df2ff into main Apr 16, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants