Skip to content

Commit a81dc15

Browse files
committed
fix(cron): split isolated run result types
1 parent b7cc361 commit a81dc15

3 files changed

Lines changed: 24 additions & 20 deletions

File tree

src/cron/isolated-agent/delivery-dispatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
import type { CronJob, CronRunTelemetry } from "../types.js";
2121
import type { DeliveryTargetResolution } from "./delivery-target.js";
2222
import { pickSummaryFromOutput } from "./helpers.js";
23-
import type { RunCronAgentTurnResult } from "./run.js";
23+
import type { RunCronAgentTurnResult } from "./run.types.js";
2424
import { expectsSubagentFollowup, isLikelyInterimCronMessage } from "./subagent-followup-hints.js";
2525

2626
function normalizeDeliveryTarget(channel: string, to: string): string {

src/cron/isolated-agent/run.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { CliDeps } from "../../cli/outbound-send-deps.js";
44
import type { OpenClawConfig } from "../../config/config.js";
55
import type { AgentDefaultsConfig } from "../../config/types.agent-defaults.js";
66
import { resolveCronDeliveryPlan } from "../delivery-plan.js";
7-
import type { CronJob, CronRunOutcome, CronRunTelemetry } from "../types.js";
7+
import type { CronJob, CronRunTelemetry } from "../types.js";
88
import {
99
dispatchCronDelivery,
1010
matchesMessagingToolDeliveryTarget,
@@ -54,6 +54,7 @@ import {
5454
setSessionRuntimeModel,
5555
supportsXHighThinking,
5656
} from "./run.runtime.js";
57+
import type { RunCronAgentTurnResult } from "./run.types.js";
5758
import { resolveCronAgentSessionKey } from "./session-key.js";
5859
import { resolveCronSession } from "./session.js";
5960
import { resolveCronSkillsSnapshot } from "./skills-snapshot.js";
@@ -71,24 +72,7 @@ function resolveNonNegativeNumber(value: number | undefined): number | undefined
7172
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : undefined;
7273
}
7374

74-
export type RunCronAgentTurnResult = {
75-
/** Last non-empty agent text output (not truncated). */
76-
outputText?: string;
77-
/**
78-
* `true` when the isolated runner already handled the run's user-visible
79-
* delivery outcome. Cron-owned callers use this for cron delivery or
80-
* explicit suppression; shared callers may also use it for a matching
81-
* message-tool send that already reached the target.
82-
*/
83-
delivered?: boolean;
84-
/**
85-
* `true` when cron attempted announce/direct delivery for this run.
86-
* This is tracked separately from `delivered` because some announce paths
87-
* cannot guarantee a final delivery ack synchronously.
88-
*/
89-
deliveryAttempted?: boolean;
90-
} & CronRunOutcome &
91-
CronRunTelemetry;
75+
export type { RunCronAgentTurnResult } from "./run.types.js";
9276

9377
type ResolvedCronDeliveryTarget = Awaited<ReturnType<typeof resolveDeliveryTarget>>;
9478

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { CronRunOutcome, CronRunTelemetry } from "../types.js";
2+
3+
export type RunCronAgentTurnResult = {
4+
/** Last non-empty agent text output (not truncated). */
5+
outputText?: string;
6+
/**
7+
* `true` when the isolated runner already handled the run's user-visible
8+
* delivery outcome. Cron-owned callers use this for cron delivery or
9+
* explicit suppression; shared callers may also use it for a matching
10+
* message-tool send that already reached the target.
11+
*/
12+
delivered?: boolean;
13+
/**
14+
* `true` when cron attempted announce/direct delivery for this run.
15+
* This is tracked separately from `delivered` because some announce paths
16+
* cannot guarantee a final delivery ack synchronously.
17+
*/
18+
deliveryAttempted?: boolean;
19+
} & CronRunOutcome &
20+
CronRunTelemetry;

0 commit comments

Comments
 (0)