Skip to content

Commit a1a05ca

Browse files
Remove dummy comments and fix unsafe null cast of adapterHarness
- Remove leftover dummy comments from main.ts and ProviderAdapterRegistry.ts - Make adapterHarness nullable in OrchestrationIntegrationHarness interface to surface null-safety issues at compile time instead of hiding them behind an unsafe cast - Add non-null assertions at test call sites that know adapterHarness is set Co-authored-by: Julius Marminge <[email protected]>
1 parent ef976af commit a1a05ca

File tree

5 files changed

+11
-49
lines changed

5 files changed

+11
-49
lines changed

apps/server/integration/OrchestrationEngineHarness.integration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export interface OrchestrationIntegrationHarness {
152152
readonly rootDir: string;
153153
readonly workspaceDir: string;
154154
readonly dbPath: string;
155-
readonly adapterHarness: TestProviderAdapterHarness;
155+
readonly adapterHarness: TestProviderAdapterHarness | null;
156156
readonly engine: OrchestrationEngineShape;
157157
readonly snapshotQuery: ProjectionSnapshotQuery["Service"];
158158
readonly providerService: ProviderService["Service"];
@@ -435,7 +435,7 @@ export const makeOrchestrationIntegrationHarness = (
435435
rootDir,
436436
workspaceDir,
437437
dbPath,
438-
adapterHarness: adapterHarness as TestProviderAdapterHarness,
438+
adapterHarness,
439439
engine,
440440
snapshotQuery,
441441
providerService,

apps/server/integration/orchestrationEngine.integration.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ it.live("runs a single turn end-to-end and persists checkpoint state in sqlite +
180180
],
181181
};
182182

183-
yield* harness.adapterHarness.queueTurnResponseForNextSession(turnResponse);
183+
yield* harness.adapterHarness!.queueTurnResponseForNextSession(turnResponse);
184184
yield* startTurn({
185185
harness,
186186
commandId: "cmd-turn-start-single",
@@ -314,7 +314,7 @@ it.live("runs multi-turn file edits and persists checkpoint diffs", () =>
314314
Effect.gen(function* () {
315315
yield* seedProjectAndThread(harness);
316316

317-
yield* harness.adapterHarness.queueTurnResponseForNextSession({
317+
yield* harness.adapterHarness!.queueTurnResponseForNextSession({
318318
events: [
319319
{
320320
type: "turn.started",
@@ -373,7 +373,7 @@ it.live("runs multi-turn file edits and persists checkpoint diffs", () =>
373373
(entry) => entry.checkpoints.length === 1 && entry.session?.threadId === "thread-1",
374374
);
375375

376-
yield* harness.adapterHarness.queueTurnResponse(THREAD_ID, {
376+
yield* harness.adapterHarness!.queueTurnResponse(THREAD_ID, {
377377
events: [
378378
{
379379
type: "turn.started",
@@ -473,7 +473,7 @@ it.live("tracks approval requests and resolves pending approvals on user respons
473473
Effect.gen(function* () {
474474
yield* seedProjectAndThread(harness);
475475

476-
yield* harness.adapterHarness.queueTurnResponseForNextSession({
476+
yield* harness.adapterHarness!.queueTurnResponseForNextSession({
477477
events: [
478478
{
479479
type: "turn.started",
@@ -538,7 +538,7 @@ it.live("tracks approval requests and resolves pending approvals on user respons
538538
assert.equal(resolvedRow.decision, "accept");
539539

540540
const approvalResponses = yield* waitForSync(
541-
() => harness.adapterHarness.getApprovalResponses(THREAD_ID),
541+
() => harness.adapterHarness!.getApprovalResponses(THREAD_ID),
542542
(responses) => responses.length === 1,
543543
"provider approval response",
544544
);
@@ -554,7 +554,7 @@ it.live("records failed turn runtime state and checkpoint status as error", () =
554554
Effect.gen(function* () {
555555
yield* seedProjectAndThread(harness);
556556

557-
yield* harness.adapterHarness.queueTurnResponseForNextSession({
557+
yield* harness.adapterHarness!.queueTurnResponseForNextSession({
558558
events: [
559559
{
560560
type: "turn.started",
@@ -633,7 +633,7 @@ it.live("reverts to an earlier checkpoint and trims checkpoint projections + git
633633
Effect.gen(function* () {
634634
yield* seedProjectAndThread(harness);
635635

636-
yield* harness.adapterHarness.queueTurnResponseForNextSession({
636+
yield* harness.adapterHarness!.queueTurnResponseForNextSession({
637637
events: [
638638
{
639639
type: "turn.started",
@@ -691,7 +691,7 @@ it.live("reverts to an earlier checkpoint and trims checkpoint projections + git
691691
(entry) => entry.session?.threadId === "thread-1" && entry.checkpoints.length === 1,
692692
);
693693

694-
yield* harness.adapterHarness.queueTurnResponse(THREAD_ID, {
694+
yield* harness.adapterHarness!.queueTurnResponse(THREAD_ID, {
695695
events: [
696696
{
697697
type: "turn.started",
@@ -796,7 +796,7 @@ it.live("reverts to an earlier checkpoint and trims checkpoint projections + git
796796
gitRefExists(harness.workspaceDir, checkpointRefForThreadTurn(THREAD_ID, 2)),
797797
false,
798798
);
799-
assert.deepEqual(harness.adapterHarness.getRollbackCalls(THREAD_ID), [1]);
799+
assert.deepEqual(harness.adapterHarness!.getRollbackCalls(THREAD_ID), [1]);
800800

801801
const checkpointRows = yield* harness.checkpointRepository.listByThreadId({
802802
threadId: THREAD_ID,

apps/server/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import { Config, Data, Effect, FileSystem, Layer, Option, Path, Schema, ServiceMap } from "effect";
1010
import { Command, Flag } from "effect/unstable/cli";
1111
import { NetService } from "@t3tools/shared/Net";
12-
13-
// Dummy comment.
1412
import {
1513
DEFAULT_PORT,
1614
resolveStaticDir,

apps/server/src/provider/Services/ProviderAdapterRegistry.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ export class ProviderAdapterRegistry extends ServiceMap.Service<
3939
ProviderAdapterRegistryShape
4040
>()("t3/provider/Services/ProviderAdapterRegistry") {}
4141

42-
// Dummy comment for workflow testing.

bun.lock

Lines changed: 0 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)