@alignfirst/openclaw-test 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copies the gateway's file log into the cell's artifact dir as `gateway.log`.
3
+ * Under `--reuse-stack` the gateway outlives the cell, so the copy also holds
4
+ * earlier cells' lines. Best-effort: a failure is reported, never fatal.
5
+ */
6
+ export declare function archiveGatewayLog(outDir: string): Promise<void>;
@@ -0,0 +1,36 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { copyFileSync, rmSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { execInGateway, IPC_DIR } from "./exec-rpc.js";
5
+ // OpenClaw's rolling file log, `openclaw-<date>.log` under its temp root. It lives in
6
+ // the gateway container, which the per-cell stack recreation destroys. Provider
7
+ // failures such as an HTTP 401 are recorded there and nowhere in the transcripts.
8
+ const GATEWAY_LOG_GLOB = "/tmp/openclaw/openclaw-*.log";
9
+ /**
10
+ * Copies the gateway's file log into the cell's artifact dir as `gateway.log`.
11
+ * Under `--reuse-stack` the gateway outlives the cell, so the copy also holds
12
+ * earlier cells' lines. Best-effort: a failure is reported, never fatal.
13
+ */
14
+ export async function archiveGatewayLog(outDir) {
15
+ const ipcPath = `${IPC_DIR}/${randomUUID()}.gateway.log`;
16
+ try {
17
+ const result = await execInGateway([
18
+ "sh",
19
+ "-c",
20
+ `cat ${GATEWAY_LOG_GLOB} > "$1"`,
21
+ "sh",
22
+ ipcPath,
23
+ ]);
24
+ if (result.exitCode !== 0) {
25
+ console.warn(`openclaw-test: gateway log copy failed (exit ${result.exitCode}): ${result.stderr}`);
26
+ return;
27
+ }
28
+ copyFileSync(ipcPath, join(outDir, "gateway.log"));
29
+ }
30
+ catch (err) {
31
+ console.warn(`openclaw-test: gateway log copy failed: ${String(err)}`);
32
+ }
33
+ finally {
34
+ rmSync(ipcPath, { force: true });
35
+ }
36
+ }
package/dist/runner.js CHANGED
@@ -5,6 +5,7 @@ import { basename, join } from "node:path";
5
5
  import { cellLeafName, writeCellResult } from "./cell-result.js";
6
6
  import { createContext, } from "./context.js";
7
7
  import { judgeCostUsd } from "./cost.js";
8
+ import { archiveGatewayLog } from "./gateway-log.js";
8
9
  import { aggregateAgentToolCalls, fetchTranscriptSnapshot, readTranscriptCost, waitForTranscriptQuiescence, } from "./transcript-log.js";
9
10
  import { startMockCliServer } from "./mock-cli-server.js";
10
11
  import { parseArgs } from "./runner-args.js";
@@ -49,6 +50,7 @@ async function runCell(args) {
49
50
  // The per-session store dies with the stack recreation, so keep the raw
50
51
  // transcripts as a cell artifact for post-mortems.
51
52
  writeFileSync(join(outDir, "transcripts.json"), JSON.stringify(snapshot.sessions));
53
+ await archiveGatewayLog(outDir);
52
54
  const agentCalls = aggregateAgentToolCalls(snapshot.sessions);
53
55
  pairAgentCallsWithCliMocks(agentCalls, entries);
54
56
  if (agentCalls.length === 0 && (snapshot.error !== undefined || snapshot.databases === 0)) {
package/exec-watcher.mjs CHANGED
@@ -12,6 +12,7 @@ const STALE_SUFFIXES = [
12
12
  ".res.json.tmp",
13
13
  ".transcript.json",
14
14
  ".transcript.json.tmp",
15
+ ".gateway.log",
15
16
  ];
16
17
 
17
18
  mkdirSync(IPC_DIR, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alignfirst/openclaw-test",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Dockerised regression-test framework for OpenClaw workspaces: bus, scenario driver, judge, Compose stack.",
5
5
  "keywords": [
6
6
  "openclaw",
@@ -44,15 +44,15 @@
44
44
  "openclaw": "*"
45
45
  },
46
46
  "dependencies": {
47
- "@alignfirst/openclaw-channel-mock-core": "0.10.2",
48
- "@alignfirst/openclaw-discord-mock": "0.6.2",
49
- "@alignfirst/openclaw-slack-mock": "0.6.2",
47
+ "@alignfirst/openclaw-channel-mock-core": "0.10.3",
48
+ "@alignfirst/openclaw-discord-mock": "0.6.3",
49
+ "@alignfirst/openclaw-slack-mock": "0.6.3",
50
50
  "@anthropic-ai/sdk": "~0.127.0",
51
51
  "openai": "~7.8.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "~26.5.0",
55
- "openclaw": "~2026.9.3",
55
+ "openclaw": "~2026.9.8",
56
56
  "rimraf": "~6.1.3",
57
57
  "typescript": "~7.0.2",
58
58
  "vitest": "~5.0.1"