Skip to content

Commit dbd6520

Browse files
committed
refactor(agents): keep run-entry contracts module-local
1 parent 58e2e57 commit dbd6520

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

‎src/agents/embedded-agent-runner/run-entry.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export type EmbeddedAgentRunEntryTerminal = {
5454
metadata: Record<string, unknown>;
5555
};
5656

57-
export type EmbeddedAgentRunEntryResult<T extends EmbeddedAgentRunResult> = {
57+
type EmbeddedAgentRunEntryResult<T extends EmbeddedAgentRunResult> = {
5858
outcome: "completed" | "exhausted";
5959
result: T;
6060
provider: string;
@@ -64,7 +64,7 @@ export type EmbeddedAgentRunEntryResult<T extends EmbeddedAgentRunResult> = {
6464
settleSessionOverride: () => Promise<void>;
6565
};
6666

67-
export type EmbeddedAgentRunEntryParams<T extends EmbeddedAgentRunResult> = {
67+
type EmbeddedAgentRunEntryParams<T extends EmbeddedAgentRunResult> = {
6868
selection: {
6969
cfg: OpenClawConfig;
7070
provider: string;

‎src/agents/runtime-plan/build.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export function buildAgentRuntimeDeliveryPlan(
133133
}
134134

135135
/** Build run-outcome classification hooks for model fallback decisions. */
136-
export function buildAgentRuntimeOutcomePlan(): AgentRuntimeOutcomePlan {
136+
function buildAgentRuntimeOutcomePlan(): AgentRuntimeOutcomePlan {
137137
return {
138138
classifyRunResult: classifyEmbeddedAgentRunResultForModelFallback,
139139
};

‎src/auto-reply/reply/agent-runner-execution.test-support.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
import { afterEach, beforeEach, expect, vi } from "vitest";
33
import { testing as cliBackendsTesting } from "../../agents/cli-backends.test-support.js";
44
import { AUTH_INVALID_TOKEN_USER_TEXT } from "../../agents/embedded-agent-helpers/errors.js";
5-
import type {
6-
EmbeddedAgentRunEntryParams,
7-
EmbeddedAgentRunEntryResult,
8-
} from "../../agents/embedded-agent-runner/run-entry.js";
5+
import type { runEmbeddedAgentEntry } from "../../agents/embedded-agent-runner/run-entry.js";
96
import type { EmbeddedAgentRunResult } from "../../agents/embedded-agent-runner/types.js";
107
import type { ModelDefinitionConfig } from "../../config/types.models.js";
118
import type { ReplyOptionsWithHeartbeatRunScope } from "../../infra/heartbeat-run-scope.js";
@@ -20,8 +17,8 @@ import type { FollowupRun } from "./queue.js";
2017
import type { ReplyOperation } from "./reply-run-registry.js";
2118
import type { TypingSignaler } from "./typing-mode.js";
2219

23-
type RunEntryParams = EmbeddedAgentRunEntryParams<EmbeddedAgentRunResult>;
24-
type RunEntryResult = EmbeddedAgentRunEntryResult<EmbeddedAgentRunResult>;
20+
type RunEntryParams = Parameters<typeof runEmbeddedAgentEntry<EmbeddedAgentRunResult>>[0];
21+
type RunEntryResult = Awaited<ReturnType<typeof runEmbeddedAgentEntry<EmbeddedAgentRunResult>>>;
2522
type RunEntryDelegate = (params: RunEntryParams) => Promise<RunEntryResult>;
2623

2724
export const PROVIDER_AUTHENTICATION_ERROR_USER_MESSAGE = `⚠️ ${AUTH_INVALID_TOKEN_USER_TEXT}`;

0 commit comments

Comments
 (0)