Skip to content

Commit b8c5a79

Browse files
committed
fix: satisfy room-event strict smoke types
1 parent d5d448f commit b8c5a79

4 files changed

Lines changed: 21 additions & 14 deletions

File tree

src/auto-reply/reply/agent-runner-execution.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,19 +1622,23 @@ export async function runAgentTurnWithFallback(params: {
16221622
abortSignal: params.replyOperation?.abortSignal ?? params.opts?.abortSignal,
16231623
replyOperation: params.replyOperation,
16241624
});
1625-
const result = isRoomEventCliTurn
1626-
? {
1627-
...rawResult,
1628-
meta: {
1629-
...rawResult.meta,
1630-
agentMeta: {
1631-
...rawResult.meta?.agentMeta,
1632-
sessionId: "",
1633-
cliSessionBinding: undefined,
1634-
},
1635-
},
1636-
}
1637-
: rawResult;
1625+
const result: EmbeddedAgentRunResult =
1626+
isRoomEventCliTurn && rawResult.meta.agentMeta
1627+
? (() => {
1628+
const { cliSessionBinding: _cliSessionBinding, ...agentMeta } =
1629+
rawResult.meta.agentMeta;
1630+
return {
1631+
...rawResult,
1632+
meta: {
1633+
...rawResult.meta,
1634+
agentMeta: {
1635+
...agentMeta,
1636+
sessionId: "",
1637+
},
1638+
},
1639+
};
1640+
})()
1641+
: rawResult;
16381642
bootstrapPromptWarningSignaturesSeen = resolveBootstrapWarningSignaturesSeen(
16391643
result.meta?.systemPromptReport,
16401644
);

src/auto-reply/reply/queue/drain.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ function collectSummaryRuntimeMetadata(items: FollowupRun[]): FollowupRuntimeMet
232232
}
233233

234234
function clearFollowupQueueSummaryState(queue: {
235+
dropPolicy: "summarize" | "old" | "new";
235236
droppedCount: number;
236237
summaryLines: string[];
237238
summarySources?: FollowupRun[];

src/channels/turn/kind.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type { InboundTurnKind } from "./types.js";
1+
export type InboundTurnKind = "user_request" | "room_event";

src/channels/turn/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import type { InboundLastRouteUpdate, RecordInboundSession } from "../session.ty
2121
import type { ChannelBotLoopProtectionFacts } from "./bot-loop-protection.js";
2222
import type { InboundTurnKind } from "./kind.js";
2323

24+
export type { InboundTurnKind } from "./kind.js";
25+
2426
export type ChannelTurnAdmission =
2527
| { kind: "dispatch"; reason?: string }
2628
| { kind: "observeOnly"; reason: string }

0 commit comments

Comments
 (0)