























@@ -6452,6 +6452,45 @@ describe("runCodexAppServerAttempt", () => {
64526452expect(savedBinding).toBeUndefined();
64536453});
645464546455+it("clears native rollouts at the configured byte limit", async () => {
6456+const sessionFile = path.join(tempDir, "session.jsonl");
6457+const workspaceDir = path.join(tempDir, "workspace");
6458+const agentDir = path.join(tempDir, "agent");
6459+await writeExistingBinding(sessionFile, workspaceDir, { dynamicToolsFingerprint: "[]" });
6460+await fs.writeFile(
6461+path.join(path.dirname(sessionFile), "sessions.json"),
6462+JSON.stringify({
6463+"agent:main:session-1": {
6464+ sessionFile,
6465+totalTokens: 12_000,
6466+},
6467+}),
6468+);
6469+const rolloutDir = path.join(agentDir, "codex-home", "sessions");
6470+await fs.mkdir(rolloutDir, { recursive: true });
6471+await fs.writeFile(path.join(rolloutDir, "rollout-thread-existing.jsonl"), "x".repeat(1_000));
6472+6473+const binding = await __testing.rotateOversizedCodexAppServerStartupBinding({
6474+binding: await readCodexAppServerBinding(sessionFile),
6475+ sessionFile,
6476+ agentDir,
6477+config: {
6478+agents: {
6479+defaults: {
6480+compaction: {
6481+truncateAfterCompaction: true,
6482+maxActiveTranscriptBytes: 1_000,
6483+},
6484+},
6485+},
6486+} as never,
6487+});
6488+6489+expect(binding).toBeUndefined();
6490+const savedBinding = await readCodexAppServerBinding(sessionFile);
6491+expect(savedBinding).toBeUndefined();
6492+});
6493+64556494it("resumes a bound Codex thread when only dynamic tool descriptions change", async () => {
64566495const sessionFile = path.join(tempDir, "session.jsonl");
64576496const workspaceDir = path.join(tempDir, "workspace");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。