Skip to content

Commit 59fc6a5

Browse files
committed
sync(bfmono): fix(gambit): preserve shared references in safe session serialization (+19 more) (bfmono@13c4c8c22)
This PR is an automated gambitmono sync of bfmono Gambit packages. - Source: `packages/gambit/` - Core: `packages/gambit/packages/gambit-core/` - bfmono rev: 13c4c8c22 Changes: - 13c4c8c22 fix(gambit): preserve shared references in safe session serialization - ae392aa24 feat(gambit-simulator-ui): add grader error chips to workbench chat - 1de6b335c fix(gambit): clamp deck-level maxTurns bounds in test run selection - 01d7abbb9 fix(gambit): default verify tab bootstrap flag to enabled - f3d186c7b fix(gambit): include extension schemas in exports and default serve to restored workspace - a83b7cbe7 fix(gambit): move unbounded build timeout to deck opt-in - acb2de627 fix(gambit): avoid strict json_schema 400s in openrouter responses - 8aba573b6 fix(gambit-simulator-ui): treat errored calibrate runs as failed - ca2028cf8 fix(gambit): prevent circular trace crashes in workspace test run API - 7e41517e5 fix(gambit): make build assistant run timeout unbounded - 24341143d feat(gambit): add deterministic verify fixture seeding - ff2c2d33d feat(gambit): add verify tab consistency UI - 91f0c93bb feat(gambit): add feature-flagged verify routing - 1392f8b65 feat(gambit): support deck-level maxTurns override - f5920ef86 chore(gambit): cut 0.8.5-rc.10 - 073c84d0e chore(gambit): cut 0.8.5-rc.10 - 2c669ba51 fix(gambit-core): ship builtin snippets/decks in npm runtime layouts - 498708844 docs(gambit): retire synthetic respond/end guidance and align deck authoring surfaces - 35ad1d5b5 feat(gambit-core): add OpenResponses convergence runtime, extensions, and async action semantics - b2d78cfb3 chore(gambit): cut 0.8.5-rc.9 Do not edit this repo directly; make changes in bfmono and re-run the sync.
1 parent 3969375 commit 59fc6a5

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/server_session_store.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,20 @@ const normalizeEventType = (
196196
};
197197

198198
const safeStringify = (value: unknown, space?: number): string => {
199-
const seen = new WeakSet<object>();
199+
const stack: Array<unknown> = [];
200200
return JSON.stringify(
201201
value,
202-
(_key, candidate) => {
202+
function (_key, candidate) {
203203
if (!candidate || typeof candidate !== "object") {
204204
return candidate;
205205
}
206-
if (seen.has(candidate as object)) {
206+
while (stack.length > 0 && stack[stack.length - 1] !== this) {
207+
stack.pop();
208+
}
209+
if (stack.includes(candidate)) {
207210
return "[Circular]";
208211
}
209-
seen.add(candidate as object);
212+
stack.push(candidate);
210213
return candidate;
211214
},
212215
space,

0 commit comments

Comments
 (0)