Skip to content

Commit 9212ddc

Browse files
StiensWoutcodexclaudeGrok 4.7
committed
perf(client): keep sidebar wakes lightweight on older hosts
Co-authored-by: GPT 6.1 Sol <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Grok 4.7 <[email protected]>
1 parent aed66c9 commit 9212ddc

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎apps/server/src/ws.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3113,7 +3113,8 @@ export const layerWsRpc = (
31133113
[WS_METHODS.assetsPersistChatAttachments]: (input) =>
31143114
persistChatAttachments(input).pipe(Effect.map((attachments) => ({ attachments }))),
31153115
[WS_METHODS.subscribeVcsBranch]: (input) => vcsStatusBroadcaster.streamBranchStatus(input),
3116-
[WS_METHODS.vcsRefreshBranch]: (input) => vcsStatusBroadcaster.refreshBranchStatus(input),
3116+
[WS_METHODS.vcsRefreshBranch]: (input) =>
3117+
vcsStatusBroadcaster.refreshBranchStatus(input).pipe(Effect.asVoid),
31173118
[WS_METHODS.subscribeVcsStatus]: (input) => vcsStatusBroadcaster.streamStatus(input),
31183119
[WS_METHODS.subscribeWorktreeSetup]: (input) => worktreeSetupTracker.stream(input.threadId),
31193120
[WS_METHODS.worktreeSetupCancel]: (input) =>

‎packages/client-runtime/src/rpc/client.test.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ it.effect.each([true, false])(
427427
input: unknown,
428428
) => {
429429
inputs.push(input);
430-
return Effect.succeed({ refName: "external" });
430+
return Effect.void;
431431
},
432432
} as unknown as WsRpcProtocolClient;
433433
yield* SubscriptionRef.set(
@@ -443,8 +443,8 @@ it.effect.each([true, false])(
443443
yield* refreshVcsBranch({ cwd: "/repo" }).pipe(
444444
Effect.provideService(EnvironmentSupervisor.EnvironmentSupervisor, supervisor),
445445
),
446-
).toEqual({ refName: "external" });
447-
expect(inputs).toEqual([supported ? { cwd: "/repo" } : { cwd: "/repo", localOnly: true }]);
446+
).toBeUndefined();
447+
expect(inputs).toEqual(supported ? [{ cwd: "/repo" }] : []);
448448
}).pipe(Effect.scoped),
449449
);
450450

@@ -453,8 +453,10 @@ it.effect("binds branch capability selection and execution to one session", () =
453453
const { activeSession, supervisor } = yield* makeHarness();
454454
const configRequested = yield* Deferred.make<void>();
455455
const config = yield* Deferred.make<ServerConfig>();
456+
const executed = yield* Deferred.make<void>();
456457
const original = {
457-
[WS_METHODS.vcsRefreshBranch]: () => Effect.succeed({ refName: "original" }),
458+
[WS_METHODS.vcsRefreshBranch]: () =>
459+
Deferred.succeed(executed, undefined).pipe(Effect.asVoid),
458460
} as unknown as WsRpcProtocolClient;
459461
const replacement = {
460462
[WS_METHODS.vcsRefreshStatus]: () => Effect.succeed({ refName: "replacement" }),
@@ -477,6 +479,7 @@ it.effect("binds branch capability selection and execution to one session", () =
477479
yield* Deferred.succeed(config, {
478480
environment: { capabilities: { vcsBranchStatus: true } },
479481
} as ServerConfig);
480-
expect(yield* Fiber.join(refresh)).toEqual({ refName: "original" });
482+
expect(yield* Fiber.join(refresh)).toBeUndefined();
483+
yield* Deferred.await(executed);
481484
}).pipe(Effect.scoped),
482485
);

‎packages/client-runtime/src/rpc/client.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,7 @@ export const refreshVcsBranch = Effect.fn("EnvironmentRpc.refreshVcsBranch")(fun
497497
if (config.environment.capabilities.vcsBranchStatus === true) {
498498
return yield* requestInSession(session, WS_METHODS.vcsRefreshBranch, input);
499499
}
500-
const status = yield* requestInSession(session, WS_METHODS.vcsRefreshStatus, {
501-
...input,
502-
localOnly: true,
503-
});
504-
return { refName: status.refName };
500+
// Older hosts retain their existing status stream without adding per-row wake scans.
505501
});
506502

507503
export const request = <TTag extends Exclude<EnvironmentUnaryRpcTag, ClientGuardedRpcTag>>(

‎packages/contracts/src/rpc.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ const WsSubscribeVcsBranchRpc = Rpc.make(WS_METHODS.subscribeVcsBranch, {
14661466

14671467
const WsVcsRefreshBranchRpc = Rpc.make(WS_METHODS.vcsRefreshBranch, {
14681468
payload: VcsStatusInput,
1469-
success: VcsBranchStatus,
1469+
success: Schema.Void,
14701470
error: Schema.Union([GitManagerServiceError, EnvironmentAuthorizationError]),
14711471
});
14721472

0 commit comments

Comments
 (0)