mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-13 20:56:07 +00:00
docs: document runner attempt helpers
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* AbortSignal-aware promise racing helper for embedded-agent attempts.
|
||||
*/
|
||||
function getAbortReason(signal: AbortSignal): unknown {
|
||||
return "reason" in signal ? (signal as { reason?: unknown }).reason : undefined;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Handles assistant-stage failover decisions during embedded-agent attempts.
|
||||
*/
|
||||
import { sanitizeForLog } from "../../../../packages/terminal-core/src/ansi.js";
|
||||
import type { OpenClawConfig } from "../../../config/types.openclaw.js";
|
||||
import type { AssistantMessage } from "../../../llm/types.js";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Releases attempt resources when an embedded-agent run aborts.
|
||||
*/
|
||||
import type { EmbeddedAttemptSessionLockController } from "./attempt.session-lock.js";
|
||||
|
||||
type AbortLockReleaseLog = {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Resolves bootstrap context targets for one embedded-agent attempt.
|
||||
*/
|
||||
import type { BootstrapMode } from "../../bootstrap-mode.js";
|
||||
import { resolveBootstrapMode } from "../../bootstrap-mode.js";
|
||||
import { DEFAULT_BOOTSTRAP_FILENAME, type WorkspaceBootstrapFile } from "../../workspace.js";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Configures HTTP timeout defaults for embedded-agent attempt runtime calls.
|
||||
*/
|
||||
import {
|
||||
DEFAULT_UNDICI_STREAM_TIMEOUT_MS,
|
||||
ensureGlobalUndiciDispatcherStreamTimeouts,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Creates embedded-agent sessions with the runner resource loader installed.
|
||||
*/
|
||||
import type { CreateAgentSessionOptions } from "../../sessions/index.js";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Builds the system prompt inputs for a single embedded-agent attempt.
|
||||
*/
|
||||
import type { OpenClawConfig } from "../../../config/types.openclaw.js";
|
||||
import type { ProviderTransformSystemPromptContext } from "../../../plugins/types.js";
|
||||
import { buildEmbeddedSystemPrompt } from "../system-prompt.js";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Plans which core, bundle MCP, and bundle LSP tools an attempt should build.
|
||||
*/
|
||||
import { TOOL_NAME_SEPARATOR } from "../../agent-bundle-mcp-names.js";
|
||||
import type { OpenClawCodingToolConstructionPlan } from "../../agent-tools.js";
|
||||
import { isToolAllowedByPolicyName } from "../../tool-policy-match.js";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Flushes attempt trajectory recorders during cleanup.
|
||||
*/
|
||||
import { runAgentCleanupStep } from "../../run-cleanup-timeout.js";
|
||||
|
||||
/** Minimal recorder surface needed to flush trajectory data during run cleanup. */
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Resolves terminal attempt trajectory status and assistant-visible text.
|
||||
*/
|
||||
import {
|
||||
hasAcceptedSessionSpawn,
|
||||
type AcceptedSessionSpawn,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Resolves how long aborted attempts wait for cleanup to settle.
|
||||
*/
|
||||
import { parseStrictPositiveInteger } from "../../../infra/parse-finite-number.js";
|
||||
|
||||
type AbortSettleTimeoutEnv = Partial<
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Waits for completion-required async tasks before finalizing an attempt.
|
||||
*/
|
||||
import { isCronRunSessionKey } from "../../../sessions/session-key-utils.js";
|
||||
import { isTerminalTaskStatus } from "../../../tasks/task-executor-policy.js";
|
||||
import type { TaskRecord } from "../../../tasks/task-registry.types.js";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Maps bootstrap context files into the attempt workspace.
|
||||
*/
|
||||
import path from "node:path";
|
||||
import { isAcpSessionKey, isSubagentSessionKey } from "../../../routing/session-key.js";
|
||||
import type { EmbeddedContextFile } from "../../embedded-agent-helpers.js";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Bridges attempt bootstrap/history data to context-engine prompt-cache helpers.
|
||||
*/
|
||||
import type { ContextEngine } from "../../../context-engine/types.js";
|
||||
import type { AssistantMessage } from "../../../llm/types.js";
|
||||
import type { BootstrapMode } from "../../bootstrap-mode.js";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Installs runtime-context and prompt-transform boundaries before LLM calls.
|
||||
*/
|
||||
import { stripInboundMetadata } from "../../../auto-reply/reply/strip-inbound-meta.js";
|
||||
import { stripHistoricalRuntimeContextCustomMessages } from "../../internal-runtime-context.js";
|
||||
import type { AgentMessage } from "../../runtime/index.js";
|
||||
|
||||
Reference in New Issue
Block a user