From 119bb5762714771fafec14b8cc345dbc679da849 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 4 Jun 2026 02:39:10 -0400 Subject: [PATCH] docs: document auto reply command gates --- src/auto-reply/reply/acp-projector.test.ts | 1 + src/auto-reply/reply/command-gates.ts | 1 + src/auto-reply/reply/commands-filesystem.test-support.ts | 1 + src/auto-reply/reply/commands-handlers.runtime.ts | 1 + src/auto-reply/reply/commands-info.tools.test.ts | 1 + src/auto-reply/reply/commands-session-abort.ts | 1 + src/auto-reply/reply/commands-session-usage.test.ts | 1 + src/auto-reply/reply/commands-status.thinking-default.test.ts | 1 + src/auto-reply/reply/commands-subagents-status.test.ts | 1 + src/auto-reply/reply/conversation-label-generator.ts | 1 + src/auto-reply/reply/debug-commands.ts | 1 + src/auto-reply/reply/dispatch-acp.ts | 1 + src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts | 1 + src/auto-reply/reply/get-reply.fast-path.runtime.test.ts | 1 + src/auto-reply/reply/get-reply.types.ts | 1 + src/auto-reply/reply/group-id-simple.ts | 1 + src/auto-reply/reply/mentions.test.ts | 1 + src/auto-reply/reply/plugins-commands.ts | 1 + src/auto-reply/reply/provider-dispatcher.types.ts | 1 + src/auto-reply/reply/queue-policy.test.ts | 1 + src/auto-reply/reply/reply-media-paths.test.ts | 1 + src/auto-reply/reply/reply-state.test.ts | 1 + src/auto-reply/reply/session-hooks-context.test.ts | 1 + src/auto-reply/reply/typing-mode.ts | 1 + 24 files changed, 24 insertions(+) diff --git a/src/auto-reply/reply/acp-projector.test.ts b/src/auto-reply/reply/acp-projector.test.ts index cd1b601c190b..6fca9ea88f6b 100644 --- a/src/auto-reply/reply/acp-projector.test.ts +++ b/src/auto-reply/reply/acp-projector.test.ts @@ -1,3 +1,4 @@ +// Tests ACP event projection into session updates and reply payloads. import { describe, expect, it, vi } from "vitest"; import { prefixSystemMessage } from "../../infra/system-message.js"; import { createAcpReplyProjector } from "./acp-projector.js"; diff --git a/src/auto-reply/reply/command-gates.ts b/src/auto-reply/reply/command-gates.ts index 9e0f7d8dffc8..ab5136b5fe15 100644 --- a/src/auto-reply/reply/command-gates.ts +++ b/src/auto-reply/reply/command-gates.ts @@ -1,3 +1,4 @@ +// Applies command feature gates before command handlers execute. import { isCommandFlagEnabled, type CommandFlagKey } from "../../config/commands.flags.js"; import { logVerbose } from "../../globals.js"; import { redactIdentifier } from "../../logging/redact-identifier.js"; diff --git a/src/auto-reply/reply/commands-filesystem.test-support.ts b/src/auto-reply/reply/commands-filesystem.test-support.ts index 8e355a203f7d..3cff471d19cb 100644 --- a/src/auto-reply/reply/commands-filesystem.test-support.ts +++ b/src/auto-reply/reply/commands-filesystem.test-support.ts @@ -1,3 +1,4 @@ +// Shared filesystem fixtures for command tests that write session artifacts. import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; diff --git a/src/auto-reply/reply/commands-handlers.runtime.ts b/src/auto-reply/reply/commands-handlers.runtime.ts index abcbff27074a..ad828d15fd51 100644 --- a/src/auto-reply/reply/commands-handlers.runtime.ts +++ b/src/auto-reply/reply/commands-handlers.runtime.ts @@ -1,3 +1,4 @@ +// Loads command handlers behind a runtime boundary for the command dispatcher. import { handleAcpCommand } from "./commands-acp.js"; import { handleAllowlistCommand } from "./commands-allowlist.js"; import { handleApproveCommand } from "./commands-approve.js"; diff --git a/src/auto-reply/reply/commands-info.tools.test.ts b/src/auto-reply/reply/commands-info.tools.test.ts index b3f33ce32316..a46fd7420cc1 100644 --- a/src/auto-reply/reply/commands-info.tools.test.ts +++ b/src/auto-reply/reply/commands-info.tools.test.ts @@ -1,3 +1,4 @@ +// Tests tool listing in info command responses. import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import type { EffectiveToolInventoryResult } from "../../agents/tools-effective-inventory.types.js"; import type { OpenClawConfig } from "../../config/config.js"; diff --git a/src/auto-reply/reply/commands-session-abort.ts b/src/auto-reply/reply/commands-session-abort.ts index da2c38c2bb16..97e8d8b925c6 100644 --- a/src/auto-reply/reply/commands-session-abort.ts +++ b/src/auto-reply/reply/commands-session-abort.ts @@ -1,3 +1,4 @@ +// Implements session abort commands and active-run stop targeting. import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; import type { SessionEntry } from "../../config/sessions.js"; import { logVerbose } from "../../globals.js"; diff --git a/src/auto-reply/reply/commands-session-usage.test.ts b/src/auto-reply/reply/commands-session-usage.test.ts index e6df3c93c652..132e0d421a1f 100644 --- a/src/auto-reply/reply/commands-session-usage.test.ts +++ b/src/auto-reply/reply/commands-session-usage.test.ts @@ -1,3 +1,4 @@ +// Tests session usage command output and token accounting summaries. import { beforeEach, describe, expect, it, vi } from "vitest"; import type { OpenClawConfig } from "../../config/config.js"; import type { diff --git a/src/auto-reply/reply/commands-status.thinking-default.test.ts b/src/auto-reply/reply/commands-status.thinking-default.test.ts index 5fdb9aa7b94a..97b6dc8d91b0 100644 --- a/src/auto-reply/reply/commands-status.thinking-default.test.ts +++ b/src/auto-reply/reply/commands-status.thinking-default.test.ts @@ -1,3 +1,4 @@ +// Tests status command defaults for thinking and reasoning display. import { beforeAll, describe, expect, it, vi } from "vitest"; import type { OpenClawConfig } from "../../config/config.js"; diff --git a/src/auto-reply/reply/commands-subagents-status.test.ts b/src/auto-reply/reply/commands-subagents-status.test.ts index c8007b341beb..aaa8ee163f86 100644 --- a/src/auto-reply/reply/commands-subagents-status.test.ts +++ b/src/auto-reply/reply/commands-subagents-status.test.ts @@ -1,3 +1,4 @@ +// Tests subagent status command output and active run summaries. import { beforeEach, describe, expect, it } from "vitest"; import { subagentRuns } from "../../agents/subagent-registry-memory.js"; import { diff --git a/src/auto-reply/reply/conversation-label-generator.ts b/src/auto-reply/reply/conversation-label-generator.ts index d4e26ca2e2ec..9516da431b63 100644 --- a/src/auto-reply/reply/conversation-label-generator.ts +++ b/src/auto-reply/reply/conversation-label-generator.ts @@ -1,3 +1,4 @@ +// Generates short labels for sessions from conversation context. import { resolveModelAsync } from "../../agents/embedded-agent-runner/model.js"; import { requireApiKey } from "../../agents/model-auth.js"; import { resolveDefaultModelForAgent } from "../../agents/model-selection.js"; diff --git a/src/auto-reply/reply/debug-commands.ts b/src/auto-reply/reply/debug-commands.ts index f95467b2808d..673e25c4ab09 100644 --- a/src/auto-reply/reply/debug-commands.ts +++ b/src/auto-reply/reply/debug-commands.ts @@ -1,3 +1,4 @@ +// Implements debug command toggles used by maintainers during reply runs. import { parseStandardSetUnsetSlashCommand } from "./commands-setunset-standard.js"; export type DebugCommand = diff --git a/src/auto-reply/reply/dispatch-acp.ts b/src/auto-reply/reply/dispatch-acp.ts index f8fa2bdc74df..7f9657f38db3 100644 --- a/src/auto-reply/reply/dispatch-acp.ts +++ b/src/auto-reply/reply/dispatch-acp.ts @@ -1,3 +1,4 @@ +// Dispatches reply turns through ACP runtimes and projects their events. import { formatAcpRuntimeErrorText } from "@openclaw/acp-core/runtime/error-text"; import { resolveAcpThreadSessionDetailLines } from "@openclaw/acp-core/runtime/session-identifiers"; import { diff --git a/src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts b/src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts index d2b3477ed9ad..8035ed23d9d0 100644 --- a/src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts +++ b/src/auto-reply/reply/dispatch-from-config.shared.test-harness.ts @@ -1,3 +1,4 @@ +// Shared harness for dispatch-from-config tests and mocked runtimes. import { vi } from "vitest"; import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { SessionBindingRecord } from "../../infra/outbound/session-binding-service.js"; diff --git a/src/auto-reply/reply/get-reply.fast-path.runtime.test.ts b/src/auto-reply/reply/get-reply.fast-path.runtime.test.ts index 185eb97d3811..960c5c0e1bd3 100644 --- a/src/auto-reply/reply/get-reply.fast-path.runtime.test.ts +++ b/src/auto-reply/reply/get-reply.fast-path.runtime.test.ts @@ -1,3 +1,4 @@ +// Tests runtime-loaded fast-path command behavior for get-reply. import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import type { OpenClawConfig } from "../../config/config.js"; import { diff --git a/src/auto-reply/reply/get-reply.types.ts b/src/auto-reply/reply/get-reply.types.ts index a42589c36091..18616197180a 100644 --- a/src/auto-reply/reply/get-reply.types.ts +++ b/src/auto-reply/reply/get-reply.types.ts @@ -1,3 +1,4 @@ +// Shared get-reply type contracts for command, directive, and runtime layers. import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { GetReplyOptions } from "../get-reply-options.types.js"; import type { ReplyPayload } from "../reply-payload.js"; diff --git a/src/auto-reply/reply/group-id-simple.ts b/src/auto-reply/reply/group-id-simple.ts index 89ea4caf7ca6..17e11542bdaf 100644 --- a/src/auto-reply/reply/group-id-simple.ts +++ b/src/auto-reply/reply/group-id-simple.ts @@ -1,3 +1,4 @@ +// Derives stable group ids from simple channel and conversation facts. import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; /** Extracts a simple group/channel id from stable group-like source ids. */ diff --git a/src/auto-reply/reply/mentions.test.ts b/src/auto-reply/reply/mentions.test.ts index 676a96b759a4..df9fa54d2571 100644 --- a/src/auto-reply/reply/mentions.test.ts +++ b/src/auto-reply/reply/mentions.test.ts @@ -1,3 +1,4 @@ +// Tests mention detection and command trigger matching. import { describe, expect, it } from "vitest"; import { stripStructuralPrefixes } from "./mentions.js"; diff --git a/src/auto-reply/reply/plugins-commands.ts b/src/auto-reply/reply/plugins-commands.ts index 251c4235ddbe..75f8e24e0265 100644 --- a/src/auto-reply/reply/plugins-commands.ts +++ b/src/auto-reply/reply/plugins-commands.ts @@ -1,3 +1,4 @@ +// Provides plugin command discovery and handler registration helpers. import { normalizeOptionalLowercaseString, normalizeOptionalString, diff --git a/src/auto-reply/reply/provider-dispatcher.types.ts b/src/auto-reply/reply/provider-dispatcher.types.ts index dec7abfc401b..538ab93192b0 100644 --- a/src/auto-reply/reply/provider-dispatcher.types.ts +++ b/src/auto-reply/reply/provider-dispatcher.types.ts @@ -1,3 +1,4 @@ +// Shared provider dispatch type contracts for reply runtime execution. import type { OpenClawConfig } from "../../config/types.openclaw.js"; import type { GetReplyOptions } from "../get-reply-options.types.js"; import type { FinalizedMsgContext, MsgContext } from "../templating.js"; diff --git a/src/auto-reply/reply/queue-policy.test.ts b/src/auto-reply/reply/queue-policy.test.ts index df6b7f46c3b9..8e54280975a5 100644 --- a/src/auto-reply/reply/queue-policy.test.ts +++ b/src/auto-reply/reply/queue-policy.test.ts @@ -1,3 +1,4 @@ +// Tests queue policy parsing and admission decisions. import { describe, expect, it } from "vitest"; import { resolveActiveRunQueueAction } from "./queue-policy.js"; diff --git a/src/auto-reply/reply/reply-media-paths.test.ts b/src/auto-reply/reply/reply-media-paths.test.ts index ba58f6d7a5cd..e46fdbd7e938 100644 --- a/src/auto-reply/reply/reply-media-paths.test.ts +++ b/src/auto-reply/reply/reply-media-paths.test.ts @@ -1,3 +1,4 @@ +// Tests media path normalization and attachment metadata generation. import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; diff --git a/src/auto-reply/reply/reply-state.test.ts b/src/auto-reply/reply/reply-state.test.ts index ce199f00afa2..eb4ec4f88a9f 100644 --- a/src/auto-reply/reply/reply-state.test.ts +++ b/src/auto-reply/reply/reply-state.test.ts @@ -1,3 +1,4 @@ +// Tests reply state persistence and recovery across process restarts. import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; diff --git a/src/auto-reply/reply/session-hooks-context.test.ts b/src/auto-reply/reply/session-hooks-context.test.ts index 42d0e85502ad..c5ae457bec35 100644 --- a/src/auto-reply/reply/session-hooks-context.test.ts +++ b/src/auto-reply/reply/session-hooks-context.test.ts @@ -1,3 +1,4 @@ +// Tests context passed to session lifecycle hooks. import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; diff --git a/src/auto-reply/reply/typing-mode.ts b/src/auto-reply/reply/typing-mode.ts index d17e053208e5..39e667078e19 100644 --- a/src/auto-reply/reply/typing-mode.ts +++ b/src/auto-reply/reply/typing-mode.ts @@ -1,3 +1,4 @@ +// Normalizes typing indicator modes from config and directives. import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; import type { TypingMode } from "../../config/types.js"; import type { SourceReplyDeliveryMode } from "../get-reply-options.types.js";