mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:30:42 +00:00
test(status): update reaction lifecycle snapshots
This commit is contained in:
@@ -5,6 +5,9 @@ import {
|
||||
type StatusReactionAdapter,
|
||||
} from "./status-reactions.js";
|
||||
|
||||
const EXEC_TOOL_EMOJI = "🛠️";
|
||||
const WEB_SEARCH_TOOL_EMOJI = "🔎";
|
||||
|
||||
function createSlackMockAdapter() {
|
||||
const active = new Set<string>();
|
||||
const log: string[] = [];
|
||||
@@ -60,12 +63,12 @@ describe("Slack status reaction lifecycle", () => {
|
||||
|
||||
void ctrl.setTool("web_search");
|
||||
await vi.advanceTimersByTimeAsync(10);
|
||||
expect(active.has(DEFAULT_EMOJIS.web)).toBe(true);
|
||||
expect(active.has(WEB_SEARCH_TOOL_EMOJI)).toBe(true);
|
||||
expect(active.has(DEFAULT_EMOJIS.thinking)).toBe(true);
|
||||
|
||||
await ctrl.setDone();
|
||||
expect(active.has(DEFAULT_EMOJIS.done)).toBe(true);
|
||||
expect(active.has(DEFAULT_EMOJIS.web)).toBe(false);
|
||||
expect(active.has(WEB_SEARCH_TOOL_EMOJI)).toBe(false);
|
||||
expect(active.has(DEFAULT_EMOJIS.thinking)).toBe(false);
|
||||
|
||||
await ctrl.clear();
|
||||
@@ -179,14 +182,14 @@ describe("Slack status reaction lifecycle", () => {
|
||||
|
||||
void ctrl.setTool("web_search");
|
||||
await vi.advanceTimersByTimeAsync(25);
|
||||
expect(active.has(DEFAULT_EMOJIS.web)).toBe(true);
|
||||
expect(active.has(WEB_SEARCH_TOOL_EMOJI)).toBe(true);
|
||||
expect(active.has("eyes")).toBe(true);
|
||||
|
||||
void ctrl.setThinking();
|
||||
await ctrl.restoreInitial();
|
||||
|
||||
expect(active.has("eyes")).toBe(true);
|
||||
expect(active.has(DEFAULT_EMOJIS.web)).toBe(false);
|
||||
expect(active.has(WEB_SEARCH_TOOL_EMOJI)).toBe(false);
|
||||
expect(adapter.setReaction).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
@@ -257,7 +260,7 @@ describe("Slack status reaction lifecycle", () => {
|
||||
|
||||
void ctrl.setTool("exec");
|
||||
await vi.advanceTimersByTimeAsync(10);
|
||||
expect(active.has(DEFAULT_EMOJIS.coding)).toBe(true);
|
||||
expect(active.has(EXEC_TOOL_EMOJI)).toBe(true);
|
||||
expect(active.has("eyes")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1034,6 +1034,14 @@
|
||||
"topic": {
|
||||
"type": "string"
|
||||
},
|
||||
"track_tool_calls": {
|
||||
"description": "snake_case alias of trackToolCalls.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"trackToolCalls": {
|
||||
"description": "When true for a reaction to the current inbound message, use that reacted message as the status-reaction target for subsequent tool progress when the channel supports it.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "number"
|
||||
},
|
||||
|
||||
@@ -1034,6 +1034,14 @@
|
||||
"topic": {
|
||||
"type": "string"
|
||||
},
|
||||
"track_tool_calls": {
|
||||
"description": "snake_case alias of trackToolCalls.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"trackToolCalls": {
|
||||
"description": "When true for a reaction to the current inbound message, use that reacted message as the status-reaction target for subsequent tool progress when the channel supports it.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "number"
|
||||
},
|
||||
|
||||
@@ -1034,6 +1034,14 @@
|
||||
"topic": {
|
||||
"type": "string"
|
||||
},
|
||||
"track_tool_calls": {
|
||||
"description": "snake_case alias of trackToolCalls.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"trackToolCalls": {
|
||||
"description": "When true for a reaction to the current inbound message, use that reacted message as the status-reaction target for subsequent tool progress when the channel supports it.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "number"
|
||||
},
|
||||
|
||||
@@ -201,8 +201,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
||||
"roughTokens": 158
|
||||
},
|
||||
"dynamicToolsJson": {
|
||||
"chars": 50058,
|
||||
"roughTokens": 12515
|
||||
"chars": 50457,
|
||||
"roughTokens": 12615
|
||||
},
|
||||
"openClawDeveloperInstructions": {
|
||||
"chars": 8604,
|
||||
@@ -213,8 +213,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
||||
"roughTokens": 7939
|
||||
},
|
||||
"totalWithDynamicToolsJson": {
|
||||
"chars": 81816,
|
||||
"roughTokens": 20454
|
||||
"chars": 82215,
|
||||
"roughTokens": 20554
|
||||
},
|
||||
"userInputText": {
|
||||
"chars": 870,
|
||||
@@ -963,6 +963,14 @@ Full JSON: `codex-dynamic-tools.discord-group.json`
|
||||
"topic": {
|
||||
"type": "string"
|
||||
},
|
||||
"track_tool_calls": {
|
||||
"description": "snake_case alias of trackToolCalls.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"trackToolCalls": {
|
||||
"description": "When true for a reaction to the current inbound message, use that reacted message as the status-reaction target for subsequent tool progress when the channel supports it.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "number"
|
||||
},
|
||||
|
||||
@@ -201,8 +201,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
||||
"roughTokens": 158
|
||||
},
|
||||
"dynamicToolsJson": {
|
||||
"chars": 49749,
|
||||
"roughTokens": 12438
|
||||
"chars": 50148,
|
||||
"roughTokens": 12537
|
||||
},
|
||||
"openClawDeveloperInstructions": {
|
||||
"chars": 7733,
|
||||
@@ -213,8 +213,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
||||
"roughTokens": 7597
|
||||
},
|
||||
"totalWithDynamicToolsJson": {
|
||||
"chars": 80136,
|
||||
"roughTokens": 20034
|
||||
"chars": 80535,
|
||||
"roughTokens": 20134
|
||||
},
|
||||
"userInputText": {
|
||||
"chars": 370,
|
||||
@@ -940,6 +940,14 @@ Full JSON: `codex-dynamic-tools.telegram-direct.json`
|
||||
"topic": {
|
||||
"type": "string"
|
||||
},
|
||||
"track_tool_calls": {
|
||||
"description": "snake_case alias of trackToolCalls.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"trackToolCalls": {
|
||||
"description": "When true for a reaction to the current inbound message, use that reacted message as the status-reaction target for subsequent tool progress when the channel supports it.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "number"
|
||||
},
|
||||
|
||||
@@ -202,8 +202,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
||||
"roughTokens": 158
|
||||
},
|
||||
"dynamicToolsJson": {
|
||||
"chars": 50872,
|
||||
"roughTokens": 12718
|
||||
"chars": 51271,
|
||||
"roughTokens": 12818
|
||||
},
|
||||
"openClawDeveloperInstructions": {
|
||||
"chars": 7733,
|
||||
@@ -214,8 +214,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
||||
"roughTokens": 7656
|
||||
},
|
||||
"totalWithDynamicToolsJson": {
|
||||
"chars": 81497,
|
||||
"roughTokens": 20375
|
||||
"chars": 81896,
|
||||
"roughTokens": 20474
|
||||
},
|
||||
"userInputText": {
|
||||
"chars": 608,
|
||||
@@ -942,6 +942,14 @@ Full JSON: `codex-dynamic-tools.heartbeat-turn.json`
|
||||
"topic": {
|
||||
"type": "string"
|
||||
},
|
||||
"track_tool_calls": {
|
||||
"description": "snake_case alias of trackToolCalls.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"trackToolCalls": {
|
||||
"description": "When true for a reaction to the current inbound message, use that reacted message as the status-reaction target for subsequent tool progress when the channel supports it.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"type": {
|
||||
"type": "number"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user