Skip to content

Commit ceb110c

Browse files
committed
fix: keep trajectory export cap compatible
1 parent 1594736 commit ceb110c

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

docs/tools/trajectory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ OpenClaw redacts sensitive values before writing export files:
181181

182182
The exporter also bounds input size:
183183

184-
- runtime sidecar files: 10 MiB; capture stops at the cap and records a truncation event when space remains
184+
- runtime sidecar files: live capture stops at 10 MiB and records a truncation event when space remains; export accepts existing runtime sidecars up to 50 MiB
185185
- session files: 50 MiB
186186
- runtime events: 200,000
187187
- total exported events: 250,000

src/trajectory/paths.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import fs from "node:fs";
22
import path from "node:path";
33
import { resolveHomeRelativePath } from "../infra/home-dir.js";
44

5-
export const TRAJECTORY_RUNTIME_FILE_MAX_BYTES = 10 * 1024 * 1024;
5+
export const TRAJECTORY_RUNTIME_CAPTURE_MAX_BYTES = 10 * 1024 * 1024;
6+
export const TRAJECTORY_RUNTIME_FILE_MAX_BYTES = 50 * 1024 * 1024;
67
export const TRAJECTORY_RUNTIME_EVENT_MAX_BYTES = 256 * 1024;
78

89
type TrajectoryPointerOpenFlagConstants = Pick<

src/trajectory/runtime.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
66
import { parseBooleanValue } from "../utils/boolean.js";
77
import { safeJsonStringify } from "../utils/safe-json.js";
88
import {
9+
TRAJECTORY_RUNTIME_CAPTURE_MAX_BYTES,
910
TRAJECTORY_RUNTIME_EVENT_MAX_BYTES,
1011
TRAJECTORY_RUNTIME_FILE_MAX_BYTES,
1112
resolveTrajectoryFilePath,
@@ -15,6 +16,7 @@ import {
1516
import type { TrajectoryEvent, TrajectoryToolDefinition } from "./types.js";
1617

1718
export {
19+
TRAJECTORY_RUNTIME_CAPTURE_MAX_BYTES,
1820
TRAJECTORY_RUNTIME_EVENT_MAX_BYTES,
1921
TRAJECTORY_RUNTIME_FILE_MAX_BYTES,
2022
resolveTrajectoryFilePath,
@@ -244,7 +246,7 @@ export function createTrajectoryRuntimeRecorder(
244246
}
245247
const maxRuntimeFileBytes = Math.max(
246248
1,
247-
Math.floor(params.maxRuntimeFileBytes ?? TRAJECTORY_RUNTIME_FILE_MAX_BYTES),
249+
Math.floor(params.maxRuntimeFileBytes ?? TRAJECTORY_RUNTIME_CAPTURE_MAX_BYTES),
248250
);
249251
const writer =
250252
params.writer ??

0 commit comments

Comments
 (0)