Skip to content

Commit ed7d154

Browse files
committed
refactor(server): trim duplicate link retry coverage
1 parent 2c5e473 commit ed7d154

2 files changed

Lines changed: 1 addition & 22 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,6 @@ function cancelledAppOwnedTask(
626626
};
627627
}
628628

629-
/**
630-
* Whether an open link card asked for the machine a later card just linked.
631-
* A card that named a machine matches only that machine; one that named
632-
* nothing matches when its hint is the linked machine's label.
633-
*/
634629
function askedForLinkedMachine(
635630
card: Extract<OrchestrationV2TurnItem, { readonly type: "link_request" }>,
636631
linked: Extract<OrchestrationV2InternalCommand, { readonly type: "link_request.record" }>,

‎apps/server/src/peer/PeerLinkRequests.test.ts‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ const scope: McpInvocationContext.McpInvocationScope = {
126126
issuedAt: 1,
127127
};
128128

129-
/**
130-
* The laptop: a real orchestrator, its orchestrator toolkit, and its links.
131-
* `wrapLinks` lets a test hold a real link while it is made.
132-
*/
129+
/** A real orchestrator and links; the wrapper can hold a link in progress. */
133130
const makeLaptopWith = (
134131
wrapLinks?: (links: PeerLinks.PeerLinks["Service"]) => PeerLinks.PeerLinks["Service"],
135132
) =>
@@ -994,7 +991,6 @@ it.live(
994991
),
995992
);
996993

997-
/** Every link card in the thread, oldest first. */
998994
const linkCards = (a: Laptop) =>
999995
a.orchestrator
1000996
.getThreadProjection(threadId)
@@ -1004,15 +1000,13 @@ const linkCards = (a: Laptop) =>
10041000
),
10051001
);
10061002

1007-
/** Asks through the tool and returns the card that ask left. */
10081003
const ask = (a: Laptop, args: Record<string, unknown>) =>
10091004
Effect.gen(function* () {
10101005
const asked = yield* a.call(args);
10111006
const { turnItemId } = asked.structuredContent as { readonly turnItemId: TurnItemId };
10121007
return (yield* linkCards(a)).find((card) => card.id === turnItemId)!;
10131008
});
10141009

1015-
/** The user links the box from `cardId` with a fresh code; returns the code. */
10161010
const linkBox = (a: Laptop, b: ServedPeer, cardId: TurnItemId) =>
10171011
Effect.gen(function* () {
10181012
const pairing = yield* b.auth.issuePairingCredential();
@@ -1072,16 +1066,10 @@ it.live("linking the machine an older card asked for by hint ends that card too"
10721066
// The agent hears of the one link it made, and nothing about the card that link ended.
10731067
expect((yield* outcomeMessages(a)).messages).toHaveLength(1);
10741068
expect(yield* storedText(a)).not.toContain(credential);
1075-
1076-
const late = yield* a.requests
1077-
.answer({ threadId, turnItemId: older.id, answer: { type: "decline" } })
1078-
.pipe(Effect.flip);
1079-
expect(late.reason).toBe("already_answered");
10801069
}),
10811070
),
10821071
);
10831072

1084-
/** Records an open card with exactly the ask in `fields`, as `request` would. */
10851073
const recordCard = (
10861074
a: Laptop,
10871075
key: string,
@@ -1212,10 +1200,6 @@ it.live("a later card's failed link leaves the older card open", () =>
12121200
),
12131201
);
12141202

1215-
/**
1216-
* A laptop whose link to the box waits on `hold` for each access it returns
1217-
* a gate for, so a test can stall one answer inside its real link.
1218-
*/
12191203
const withHeldLinks = <A, E, R>(
12201204
hold: (access: PeerLinkCreateInput["access"]) => Effect.Effect<void> | undefined,
12211205
body: (a: Laptop, b: ServedPeer) => Effect.Effect<A, E, R>,

0 commit comments

Comments
 (0)