fix: satisfy room-event strict smoke types

This commit is contained in:
Peter Steinberger
2026-05-15 20:51:20 +01:00
parent 2e5a86adfe
commit 903e246e87
4 changed files with 21 additions and 14 deletions

View File

@@ -1622,19 +1622,23 @@ export async function runAgentTurnWithFallback(params: {
abortSignal: params.replyOperation?.abortSignal ?? params.opts?.abortSignal,
replyOperation: params.replyOperation,
});
const result = isRoomEventCliTurn
? {
...rawResult,
meta: {
...rawResult.meta,
agentMeta: {
...rawResult.meta?.agentMeta,
sessionId: "",
cliSessionBinding: undefined,
},
},
}
: rawResult;
const result: EmbeddedAgentRunResult =
isRoomEventCliTurn && rawResult.meta.agentMeta
? (() => {
const { cliSessionBinding: _cliSessionBinding, ...agentMeta } =
rawResult.meta.agentMeta;
return {
...rawResult,
meta: {
...rawResult.meta,
agentMeta: {
...agentMeta,
sessionId: "",
},
},
};
})()
: rawResult;
bootstrapPromptWarningSignaturesSeen = resolveBootstrapWarningSignaturesSeen(
result.meta?.systemPromptReport,
);

View File

@@ -232,6 +232,7 @@ function collectSummaryRuntimeMetadata(items: FollowupRun[]): FollowupRuntimeMet
}
function clearFollowupQueueSummaryState(queue: {
dropPolicy: "summarize" | "old" | "new";
droppedCount: number;
summaryLines: string[];
summarySources?: FollowupRun[];

View File

@@ -1 +1 @@
export type { InboundTurnKind } from "./types.js";
export type InboundTurnKind = "user_request" | "room_event";

View File

@@ -21,6 +21,8 @@ import type { InboundLastRouteUpdate, RecordInboundSession } from "../session.ty
import type { ChannelBotLoopProtectionFacts } from "./bot-loop-protection.js";
import type { InboundTurnKind } from "./kind.js";
export type { InboundTurnKind } from "./kind.js";
export type ChannelTurnAdmission =
| { kind: "dispatch"; reason?: string }
| { kind: "observeOnly"; reason: string }