Skip to content

Commit d5ce1ed

Browse files
committed
docs: document core agent tool tests
1 parent 5c71f21 commit d5ce1ed

4 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/agents/tools/message-tool.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Message tool tests cover channel action discovery, secret scoping, and
2+
// outbound message execution context.
13
import { Type } from "typebox";
24
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
35
import type { ChannelMessageAdapterShape } from "../../channels/message/types.js";
@@ -144,6 +146,8 @@ function latestSecretResolveCall(): {
144146
if (!call) {
145147
throw new Error("expected secret resolution call");
146148
}
149+
// Secret resolution is scoped to the active channel/account; tests inspect
150+
// the exact target set to avoid broad credential reads.
147151
return call[0] as {
148152
allowedPaths?: Set<string>;
149153
config?: unknown;

src/agents/tools/skill-workshop-tool.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// skill_workshop tests cover proposal creation/revision/listing without
2+
// applying generated skills to the workspace.
13
import fs from "node:fs/promises";
24
import path from "node:path";
35
import { afterEach, beforeEach, describe, expect, it } from "vitest";
@@ -63,6 +65,8 @@ describe("skill_workshop tool", () => {
6365
});
6466

6567
it("creates pending skill proposals without applying them", async () => {
68+
// Creation writes reviewable proposal artifacts under state, not live skill
69+
// files in the workspace.
6670
const workspaceDir = await tempDirs.make("openclaw-skill-workshop-tool-");
6771
const tool = createSkillWorkshopTool({
6872
workspaceDir,

src/agents/tools/subagents-tool.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
// Subagents tool tests cover requester-scoped listing guidance and numeric
2+
// status-window validation.
13
import { describe, expect, it } from "vitest";
24
import { createSubagentsTool } from "./subagents-tool.js";
35

46
describe("subagents tool", () => {
57
it("does not advertise sessions_yield as unconditionally available", () => {
8+
// sessions_yield is context-dependent; the model-facing description should
9+
// not promise it exists in every runtime.
610
const tool = createSubagentsTool();
711

812
expect(tool.description).toBe(

src/agents/tools/transcripts-tool.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Transcripts tool tests cover manual imports, live provider lifecycle, summary
2+
// artifacts, and date-qualified session selectors.
13
import fs from "node:fs/promises";
24
import os from "node:os";
35
import path from "node:path";
@@ -101,6 +103,8 @@ describe("transcripts tool", () => {
101103
});
102104

103105
it("bounds summary input while retaining the full transcript", async () => {
106+
// Summary generation uses a bounded utterance window, but the durable JSONL
107+
// transcript must retain every utterance.
104108
const stateDir = await makeStateDir();
105109
const { tool } = await createHarness(stateDir, { maxUtterances: 1 });
106110

@@ -159,6 +163,8 @@ describe("transcripts tool", () => {
159163
});
160164

161165
it("stops date-qualified active sessions with the canonical provider session id", async () => {
166+
// Date-qualified selectors disambiguate storage paths; providers still own
167+
// the original session id.
162168
const stateDir = await makeStateDir();
163169
const start = vi.fn(async (request) => {
164170
await request.onUtterance({

0 commit comments

Comments
 (0)