fix(environment): own JSON fields across capture, state and replay

This commit is contained in:
morluto committed 2026-10-26 18:27:30 +08:00
1 parent cc5a96933a
commit e54bf1006e
57 files changed
+1019 -389

No files matched your search

@@ -28,8 +28,10 @@ export const pinnedRequest = (
);
if (!query.ok) return err(refused(tool, `Tool ${tool.name} ${query.error}`));
const names = environmentToolArguments(tool).query;
const filled = { ...args };
for (const [name, value] of query.value)
filled[names.get(name) ?? name] ??= value;
return ok({ ...request, args: filled });
const filled = new Map(Object.entries(args));
for (const [name, value] of query.value) {
const argument = names.get(name) ?? name;
if (filled.get(argument) == null) filled.set(argument, value);
}
return ok({ ...request, args: Object.fromEntries(filled) });
};