Skip to content

Commit 33e527d

Browse files
committed
refactor: trim subagent helper exports
1 parent 9045a7c commit 33e527d

6 files changed

Lines changed: 11 additions & 32 deletions

src/agents/session-transcript-repair.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import {
1313
normalizeAllowedToolNames,
1414
} from "./tool-call-shared.js";
1515

16-
export { isRedactedSessionsSpawnAttachment } from "./tool-call-shared.js";
17-
1816
type RawToolCallBlock = {
1917
type?: unknown;
2018
id?: unknown;
@@ -285,7 +283,7 @@ export function stripToolResultDetails(messages: AgentMessage[]): AgentMessage[]
285283
return touched ? out : messages;
286284
}
287285

288-
export function repairToolCallInputs(
286+
function repairToolCallInputs(
289287
messages: AgentMessage[],
290288
options?: ToolCallInputRepairOptions,
291289
): ToolCallInputRepairReport {

src/agents/subagent-announce-delivery.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ import { getSubagentDepthFromSessionStore } from "./subagent-depth.js";
4747
import { resolveRequesterStoreKey } from "./subagent-requester-store-key.js";
4848
import type { SpawnSubagentMode } from "./subagent-spawn.types.js";
4949

50-
export { resolveAnnounceOrigin } from "./subagent-announce-origin.js";
51-
5250
const DEFAULT_SUBAGENT_ANNOUNCE_TIMEOUT_MS = 120_000;
5351
const MAX_TIMER_SAFE_TIMEOUT_MS = 2_147_000_000;
5452

src/agents/subagent-announce-dispatch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
export type SubagentDeliveryPath =
1+
type SubagentDeliveryPath =
22
| "queued"
33
| "steered"
44
| "direct"
55
| "direct-fallback"
66
| "direct-thread-fallback"
77
| "none";
88

9-
export type SubagentAnnounceQueueOutcome = "steered" | "queued" | "none" | "dropped";
9+
type SubagentAnnounceQueueOutcome = "steered" | "queued" | "none" | "dropped";
1010

1111
export type SubagentAnnounceDeliveryResult = {
1212
delivered: boolean;
@@ -15,9 +15,9 @@ export type SubagentAnnounceDeliveryResult = {
1515
phases?: SubagentAnnounceDispatchPhaseResult[];
1616
};
1717

18-
export type SubagentAnnounceDispatchPhase = "queue-primary" | "direct-primary" | "queue-fallback";
18+
type SubagentAnnounceDispatchPhase = "queue-primary" | "direct-primary" | "queue-fallback";
1919

20-
export type SubagentAnnounceDispatchPhaseResult = {
20+
type SubagentAnnounceDispatchPhaseResult = {
2121
phase: SubagentAnnounceDispatchPhase;
2222
delivered: boolean;
2323
path: SubagentDeliveryPath;

src/agents/subagent-control.ts

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,7 @@ import {
2121
waitForAgentRunAndReadUpdatedAssistantReply,
2222
} from "./run-wait.js";
2323
import { resolveStoredSubagentCapabilities } from "./subagent-capabilities.js";
24-
import {
25-
buildLatestSubagentRunIndex,
26-
buildSubagentList,
27-
createPendingDescendantCounter,
28-
isActiveSubagentRun,
29-
resolveSessionEntryForKey,
30-
type BuiltSubagentList,
31-
type SessionEntryResolution,
32-
type SubagentListItem,
33-
} from "./subagent-list.js";
24+
import { buildLatestSubagentRunIndex, resolveSessionEntryForKey } from "./subagent-list.js";
3425
import { subagentRuns } from "./subagent-registry-memory.js";
3526
import {
3627
getLatestSubagentRunByChildSessionKey,
@@ -50,8 +41,8 @@ import { resolveInternalSessionKey, resolveMainSessionAlias } from "./tools/sess
5041
export const DEFAULT_RECENT_MINUTES = 30;
5142
export const MAX_RECENT_MINUTES = 24 * 60;
5243
export const MAX_STEER_MESSAGE_CHARS = 4_000;
53-
export const STEER_RATE_LIMIT_MS = 2_000;
54-
export const STEER_ABORT_SETTLE_TIMEOUT_MS = 5_000;
44+
const STEER_RATE_LIMIT_MS = 2_000;
45+
const STEER_ABORT_SETTLE_TIMEOUT_MS = 5_000;
5546
const SUBAGENT_REPLY_HISTORY_LIMIT = 50;
5647

5748
const steerRateLimit = new Map<string, number>();
@@ -104,14 +95,6 @@ export type ResolvedSubagentController = {
10495
callerIsSubagent: boolean;
10596
controlScope: "children" | "none";
10697
};
107-
export type { BuiltSubagentList, SessionEntryResolution, SubagentListItem };
108-
export {
109-
buildSubagentList,
110-
createPendingDescendantCounter,
111-
isActiveSubagentRun,
112-
resolveSessionEntryForKey,
113-
};
114-
11598
export function resolveSubagentController(params: {
11699
cfg: OpenClawConfig;
117100
agentSessionKey?: string;

src/agents/subagent-recovery-state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { SessionEntry } from "../config/sessions.js";
22

3-
export const SUBAGENT_RECOVERY_MAX_AUTOMATIC_ATTEMPTS = 2;
4-
export const SUBAGENT_RECOVERY_REWEDGE_WINDOW_MS = 2 * 60_000;
3+
const SUBAGENT_RECOVERY_MAX_AUTOMATIC_ATTEMPTS = 2;
4+
const SUBAGENT_RECOVERY_REWEDGE_WINDOW_MS = 2 * 60_000;
55

66
export type SubagentRecoveryGate =
77
| {

src/agents/subagent-registry-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export {
2929
} from "./subagent-session-metrics.js";
3030

3131
export const MIN_ANNOUNCE_RETRY_DELAY_MS = 1_000;
32-
export const MAX_ANNOUNCE_RETRY_DELAY_MS = 8_000;
32+
const MAX_ANNOUNCE_RETRY_DELAY_MS = 8_000;
3333
export const MAX_ANNOUNCE_RETRY_COUNT = 3;
3434
export const ANNOUNCE_EXPIRY_MS = 5 * 60_000;
3535
export const ANNOUNCE_COMPLETION_HARD_EXPIRY_MS = 30 * 60_000;

0 commit comments

Comments
 (0)