Skip to content

Commit f84460e

Browse files
committed
docs: document session services
1 parent 735587d commit f84460e

28 files changed

Lines changed: 135 additions & 40 deletions

src/agents/session-agent-binding.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Session-to-agent binding resolver.
3+
*
4+
* Derives the trusted active agent from explicit agent ids, agent session keys, or configured main-session aliases.
5+
*/
16
import {
27
normalizeLowercaseStringOrEmpty,
38
normalizeOptionalString,

src/agents/session-runtime-compat.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Session runtime compatibility helpers.
3+
*
4+
* Resolves persisted runtime overrides without leaking provider-specific CLI runtime bindings across model routes.
5+
*/
16
import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";
27
import type { SessionEntry } from "../config/sessions.js";
38
import { isDefaultAgentRuntimeId } from "./agent-runtime-id.js";

src/agents/session-suspension.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Session suspension and lane auto-resume helpers.
3+
*
4+
* Records quota/manual/circuit suspensions and temporarily lowers command-lane concurrency.
5+
*/
16
import path from "node:path";
27
import { resolveAgentMaxConcurrent, resolveSubagentMaxConcurrent } from "../config/agent-limits.js";
38
import { resolveCronMaxConcurrentRuns } from "../config/cron-limits.js";

src/agents/session-tool-result-guard-wrapper.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Session manager wrapper for tool-result transcript guards.
3+
*
4+
* Installs message-write hooks, input provenance handling, and pending tool-result flush behavior once per manager.
5+
*/
16
import type { OpenClawConfig } from "../config/types.openclaw.js";
27
import { getGlobalHookRunner } from "../plugins/hook-runner-global.js";
38
import {

src/agents/session-tool-result-guard.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Session transcript guard for tool-call/result consistency.
3+
*
4+
* Caps large tool results, repairs missing results, applies redaction, and emits transcript update events.
5+
*/
16
import { resolveIntegerOption } from "@openclaw/normalization-core/number-coercion";
27
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
38
import {

src/agents/session-transcript-repair.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Transcript repair helpers for tool-call replay.
3+
*
4+
* Normalizes raw tool-call blocks and synthesizes missing tool results without rewriting trusted local payloads.
5+
*/
16
import {
27
hasNonEmptyString as hasNonEmptyStringField,
38
normalizeOptionalString,

src/agents/session-write-lock.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Session write-lock implementation.
3+
*
4+
* Uses lock files with owner metadata, stale detection, signal cleanup, and watchdog checks to serialize writes.
5+
*/
16
import "../infra/fs-safe-defaults.js";
27
import type fsSync from "node:fs";
38
import fs from "node:fs/promises";

src/agents/sessions/agent-session-runtime.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Agent session runtime factory.
3+
*
4+
* Builds cwd-bound services, imports optional session history, and emits shutdown events for replaced sessions.
5+
*/
16
import { copyFileSync, existsSync, mkdirSync } from "node:fs";
27
import { basename, join, resolve } from "node:path";
38
import type {

src/agents/sessions/agent-session-services.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Agent session service factory.
3+
*
4+
* Creates cwd-bound auth, settings, model registry, resource loader, and session instances for the CLI runtime.
5+
*/
16
import { join } from "node:path";
27
import type { Model } from "../../llm/types.js";
38
import { getAgentDir } from "../config.js";

src/agents/sessions/auth-guidance.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { join } from "node:path";
2-
import { getDocsPath } from "../config.js";
3-
41
/**
52
* Shared user-facing auth guidance for session/model selection failures.
63
*
7-
* Messages include docs paths instead of provider-specific instructions so they
8-
* stay correct across OAuth/API-key providers.
4+
* Uses docs paths instead of provider-specific instructions so guidance stays correct across OAuth/API-key providers.
95
*/
6+
import { join } from "node:path";
7+
import { getDocsPath } from "../config.js";
8+
109
const UNKNOWN_PROVIDER = "unknown";
1110

1211
/** Returns the standard provider login help block. */

0 commit comments

Comments
 (0)