You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Follow-up polish to v1.14.1's journal OOM fix (#114). Three independent
improvements surfaced by CR:
1. **Read-path non-mutation bug fix.**
`Journal.getFixtureMatchCount(fixture, testId)` was a read method that
silently inserted an empty Map + triggered FIFO eviction for unknown
testIds. Reads could evict live testIds. Now split into a read-only
public `getFixtureMatchCountsForTest` (returns transient empty Map on
miss) and private `getOrCreateFixtureMatchCountsForTest` (insert+evict
write path used only by `incrementFixtureMatchCount`).
2. **CLI validation hardening.** `--journal-max -5` was silently treated
as unbounded; now rejected with a clear error. Same for the new
`--fixture-counts-max` flag.
3. **`createServer()` default flip.** `journalMaxEntries` (1000) and
`fixtureCountsMaxTestIds` (500) now default to finite caps for
programmatic callers — long-running embedders no longer inherit the
original leak. Tests using `new Journal()` directly remain unbounded by
default (back-compat). Opt in to unbounded via `journalMaxEntries: 0`.
## Test plan
- [x] 3 new tests: read-non-mutation, CLI negative rejection,
`fixtureCountsMaxTestIds` cap FIFO eviction
- [x] Full suite: 2461 tests pass
- [x] Lint + build + prettier clean
- [x] CR R2 on combined diff: 0 blocking bugs
## Breaking change note
The `createServer()` default flip is a behavioral change for
programmatic embedders that relied on unbounded journal retention. Opt
back in with `createServer({ journalMaxEntries: 0 })` if needed.
Documented in `types.ts` JSDoc.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,20 @@
1
1
# @copilotkit/aimock
2
2
3
+
## 1.14.2
4
+
5
+
### Fixed
6
+
7
+
-`Journal.getFixtureMatchCount()` is now read-only: calling it with an unknown testId no longer inserts an empty map or triggers FIFO eviction of a live testId. Reads never mutate cache state.
8
+
- CLI rejects negative values for `--journal-max` and `--fixture-counts-max` with a clear error (previously silently treated as unbounded).
9
+
10
+
### Changed
11
+
12
+
-`createServer()` programmatic default: `journalMaxEntries` and `fixtureCountsMaxTestIds` now default to finite caps (1000 / 500) instead of unbounded. Long-running embedders that relied on unbounded retention must now opt in explicitly by passing `0`. Back-compat with test harnesses using `new Journal()` directly is preserved (they still default to unbounded).
13
+
14
+
### Added
15
+
16
+
- New `--fixture-counts-max <n>` CLI flag (default 500) to cap the fixture-match-counts map by testId.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@copilotkit/aimock",
3
-
"version": "1.14.1",
3
+
"version": "1.14.2",
4
4
"description": "Mock infrastructure for AI application testing — LLM APIs, image generation, text-to-speech, transcription, video generation, MCP tools, A2A agents, AG-UI event streams, vector databases, search, rerank, and moderation. One package, one port, zero dependencies.",
0 commit comments