refactor: trim subagent helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 21:55:01 +01:00
parent 9045a7c644
commit 33e527d1fc
6 changed files with 11 additions and 32 deletions

View File

@@ -13,8 +13,6 @@ import {
normalizeAllowedToolNames,
} from "./tool-call-shared.js";
export { isRedactedSessionsSpawnAttachment } from "./tool-call-shared.js";
type RawToolCallBlock = {
type?: unknown;
id?: unknown;
@@ -285,7 +283,7 @@ export function stripToolResultDetails(messages: AgentMessage[]): AgentMessage[]
return touched ? out : messages;
}
export function repairToolCallInputs(
function repairToolCallInputs(
messages: AgentMessage[],
options?: ToolCallInputRepairOptions,
): ToolCallInputRepairReport {

View File

@@ -47,8 +47,6 @@ import { getSubagentDepthFromSessionStore } from "./subagent-depth.js";
import { resolveRequesterStoreKey } from "./subagent-requester-store-key.js";
import type { SpawnSubagentMode } from "./subagent-spawn.types.js";
export { resolveAnnounceOrigin } from "./subagent-announce-origin.js";
const DEFAULT_SUBAGENT_ANNOUNCE_TIMEOUT_MS = 120_000;
const MAX_TIMER_SAFE_TIMEOUT_MS = 2_147_000_000;

View File

@@ -1,4 +1,4 @@
export type SubagentDeliveryPath =
type SubagentDeliveryPath =
| "queued"
| "steered"
| "direct"
@@ -6,7 +6,7 @@ export type SubagentDeliveryPath =
| "direct-thread-fallback"
| "none";
export type SubagentAnnounceQueueOutcome = "steered" | "queued" | "none" | "dropped";
type SubagentAnnounceQueueOutcome = "steered" | "queued" | "none" | "dropped";
export type SubagentAnnounceDeliveryResult = {
delivered: boolean;
@@ -15,9 +15,9 @@ export type SubagentAnnounceDeliveryResult = {
phases?: SubagentAnnounceDispatchPhaseResult[];
};
export type SubagentAnnounceDispatchPhase = "queue-primary" | "direct-primary" | "queue-fallback";
type SubagentAnnounceDispatchPhase = "queue-primary" | "direct-primary" | "queue-fallback";
export type SubagentAnnounceDispatchPhaseResult = {
type SubagentAnnounceDispatchPhaseResult = {
phase: SubagentAnnounceDispatchPhase;
delivered: boolean;
path: SubagentDeliveryPath;

View File

@@ -21,16 +21,7 @@ import {
waitForAgentRunAndReadUpdatedAssistantReply,
} from "./run-wait.js";
import { resolveStoredSubagentCapabilities } from "./subagent-capabilities.js";
import {
buildLatestSubagentRunIndex,
buildSubagentList,
createPendingDescendantCounter,
isActiveSubagentRun,
resolveSessionEntryForKey,
type BuiltSubagentList,
type SessionEntryResolution,
type SubagentListItem,
} from "./subagent-list.js";
import { buildLatestSubagentRunIndex, resolveSessionEntryForKey } from "./subagent-list.js";
import { subagentRuns } from "./subagent-registry-memory.js";
import {
getLatestSubagentRunByChildSessionKey,
@@ -50,8 +41,8 @@ import { resolveInternalSessionKey, resolveMainSessionAlias } from "./tools/sess
export const DEFAULT_RECENT_MINUTES = 30;
export const MAX_RECENT_MINUTES = 24 * 60;
export const MAX_STEER_MESSAGE_CHARS = 4_000;
export const STEER_RATE_LIMIT_MS = 2_000;
export const STEER_ABORT_SETTLE_TIMEOUT_MS = 5_000;
const STEER_RATE_LIMIT_MS = 2_000;
const STEER_ABORT_SETTLE_TIMEOUT_MS = 5_000;
const SUBAGENT_REPLY_HISTORY_LIMIT = 50;
const steerRateLimit = new Map<string, number>();
@@ -104,14 +95,6 @@ export type ResolvedSubagentController = {
callerIsSubagent: boolean;
controlScope: "children" | "none";
};
export type { BuiltSubagentList, SessionEntryResolution, SubagentListItem };
export {
buildSubagentList,
createPendingDescendantCounter,
isActiveSubagentRun,
resolveSessionEntryForKey,
};
export function resolveSubagentController(params: {
cfg: OpenClawConfig;
agentSessionKey?: string;

View File

@@ -1,7 +1,7 @@
import type { SessionEntry } from "../config/sessions.js";
export const SUBAGENT_RECOVERY_MAX_AUTOMATIC_ATTEMPTS = 2;
export const SUBAGENT_RECOVERY_REWEDGE_WINDOW_MS = 2 * 60_000;
const SUBAGENT_RECOVERY_MAX_AUTOMATIC_ATTEMPTS = 2;
const SUBAGENT_RECOVERY_REWEDGE_WINDOW_MS = 2 * 60_000;
export type SubagentRecoveryGate =
| {

View File

@@ -29,7 +29,7 @@ export {
} from "./subagent-session-metrics.js";
export const MIN_ANNOUNCE_RETRY_DELAY_MS = 1_000;
export const MAX_ANNOUNCE_RETRY_DELAY_MS = 8_000;
const MAX_ANNOUNCE_RETRY_DELAY_MS = 8_000;
export const MAX_ANNOUNCE_RETRY_COUNT = 3;
export const ANNOUNCE_EXPIRY_MS = 5 * 60_000;
export const ANNOUNCE_COMPLETION_HARD_EXPIRY_MS = 30 * 60_000;