惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
S
SegmentFault 最新的问题
V
Visual Studio Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
美团技术团队
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
有赞技术团队
有赞技术团队
量子位
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
博客园 - 叶小钗
月光博客
月光博客
P
Proofpoint News Feed
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
Stack Overflow Blog
Stack Overflow Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(copilot): preserve compaction metadata · openclaw/ope...
vincentkoc · 2026-06-23 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1609,6 +1609,12 @@ describe("createCopilotAgentHarness", () => {

16091609

success: true,

16101610

tokensRemoved: 123,

16111611

messagesRemoved: 4,

1612+

summaryContent: "compacted summary",

1613+

contextWindow: {

1614+

tokenLimit: 1000,

1615+

currentTokens: 777,

1616+

messagesLength: 12,

1617+

},

16121618

}));

16131619

const disconnect = vi.fn(async () => {

16141620

throw new Error("disconnect failed");

@@ -1649,6 +1655,7 @@ describe("createCopilotAgentHarness", () => {

16491655

model: "gpt-4.1",

16501656

sessionKey: "agent:main:main",

16511657

sessionId: "oc-sess-compact-1",

1658+

currentTokenCount: 900,

16521659

workspaceDir: "/this\u0000is/illegal",

16531660

customInstructions: "Keep decisions.",

16541661

});

@@ -1684,6 +1691,25 @@ describe("createCopilotAgentHarness", () => {

16841691

ok: true,

16851692

compacted: true,

16861693

reason: "copilot-sdk-history-compacted",

1694+

result: {

1695+

summary: "compacted summary",

1696+

firstKeptEntryId: "",

1697+

tokensBefore: 900,

1698+

tokensAfter: 777,

1699+

details: {

1700+

success: true,

1701+

tokensRemoved: 123,

1702+

messagesRemoved: 4,

1703+

summaryContent: "compacted summary",

1704+

contextWindow: {

1705+

tokenLimit: 1000,

1706+

currentTokens: 777,

1707+

messagesLength: 12,

1708+

},

1709+

},

1710+

sessionId: "oc-sess-compact-1",

1711+

sessionFile: "/session.json",

1712+

},

16871713

});

16881714

});

16891715
Original file line numberDiff line numberDiff line change

@@ -62,6 +62,14 @@ interface CopilotHistoryCompactResult {

6262

tokensRemoved: number;

6363

messagesRemoved: number;

6464

summaryContent?: string;

65+

contextWindow?: {

66+

tokenLimit: number;

67+

currentTokens: number;

68+

messagesLength: number;

69+

systemTokens?: number;

70+

conversationTokens?: number;

71+

toolDefinitionsTokens?: number;

72+

};

6573

}

6674
6775

interface CopilotHistoryCompactSession {

@@ -872,6 +880,21 @@ export function createCopilotAgentHarness(

872880

ok: true,

873881

compacted,

874882

reason: compacted ? "copilot-sdk-history-compacted" : "already under target",

883+

...(compacted

884+

? {

885+

result: {

886+

summary: compactResult.summaryContent ?? "",

887+

firstKeptEntryId: "",

888+

tokensBefore:

889+

params.currentTokenCount ??

890+

(compactResult.contextWindow?.currentTokens ?? 0) + compactResult.tokensRemoved,

891+

tokensAfter: compactResult.contextWindow?.currentTokens,

892+

details: compactResult,

893+

sessionId: params.sessionId,

894+

sessionFile: params.sessionFile,

895+

},

896+

}

897+

: {}),

875898

};

876899

},

877900