diff --git a/scripts/lib/session-cost-snapshot.js b/scripts/lib/session-cost-snapshot.js index f95ddc8cb..779f83328 100644 --- a/scripts/lib/session-cost-snapshot.js +++ b/scripts/lib/session-cost-snapshot.js @@ -500,6 +500,7 @@ module.exports = { COST_SNAPSHOT_SCHEMA_VERSION, COST_SNAPSHOT_DIRECTORY, COST_LOG_FILENAME, + MAX_SCAN_BYTES, getCostSnapshotPath, isValidCostRow, chooseNewerCumulativeRow, diff --git a/tests/lib/session-cost-snapshot.test.js b/tests/lib/session-cost-snapshot.test.js index 5e004b49a..f941f8920 100644 --- a/tests/lib/session-cost-snapshot.test.js +++ b/tests/lib/session-cost-snapshot.test.js @@ -8,6 +8,7 @@ const path = require('path'); const { appendSessionCostRow, getCostSnapshotPath, + MAX_SCAN_BYTES, maybePruneSessionCostSnapshots, readSessionCostSnapshot, refreshSessionCostSnapshot, @@ -199,7 +200,7 @@ try { if (test('bounds oversized unterminated rows and caches the discarded prefix', () => { const caseRoot = path.join(root, 'oversized-line'); fs.mkdirSync(caseRoot, { recursive: true }); - const oversizedBytes = 32 * 1024 * 1024; + const oversizedBytes = 2 * MAX_SCAN_BYTES; fs.writeFileSync( path.join(caseRoot, 'costs.jsonl'), Buffer.alloc(oversizedBytes, 0x78)