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

推荐订阅源

D
Docker
人人都是产品经理
人人都是产品经理
小众软件
小众软件
博客园 - Franky
WordPress大学
WordPress大学
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Fortinet All Blogs
博客园 - 【当耐特】
IT之家
IT之家
G
Google Developers Blog
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
V
Visual Studio Blog
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
GbyAI
GbyAI
雷峰网
雷峰网

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: align tool-result guard budget · openclaw/openclaw@1...
steipete · 2026-04-30 · via Recent Commits to openclaw:main

File tree

  • src/agents/pi-embedded-runner/run

Original file line numberDiff line numberDiff line change

@@ -11,6 +11,7 @@ Docs: https://docs.openclaw.ai

1111
1212

### Fixes

1313
14+

- Agents/tool-result guard: use the resolved runtime context token budget for non-context-engine tool-result overflow checks, so long tool-heavy sessions no longer compact early when `contextTokens` is larger than native `contextWindow`. Fixes #74917. Thanks @kAIborg24.

1415

- Gateway/systemd: exit with sysexits 78 for supervised lock and `EADDRINUSE` conflicts so `RestartPreventExitStatus=78` stops `Restart=always` restart loops instead of repeatedly reloading plugins against an occupied port. Fixes #75115. Thanks @yhyatt.

1516

- Plugins/runtime-deps: replace stale symlinked mirror target roots before writing runtime-mirror temp files and skip rewriting already materialized hardlinks, so cross-version container upgrades no longer crash-loop on read-only image-layer paths while warm mirrors do less churn. Fixes #75108; refs #75069. Thanks @coletebou and @xiaohuaxi.

1617

- Auto-reply/group chats: fall back to automatic source delivery when a channel precomputes message-tool-only replies but the `message` tool is unavailable, so Discord/Slack-style group turns do not silently complete without a visible reply. Fixes #74868. Thanks @kagura-agent.

Original file line numberDiff line numberDiff line change

@@ -869,3 +869,43 @@ describe("runEmbeddedAttempt context engine mid-turn precheck integration", () =

869869

expect(result.messagesSnapshot).toEqual([seedMessage]);

870870

});

871871

});

872+
873+

describe("runEmbeddedAttempt tool-result guard budget wiring", () => {

874+

const sessionKey = "agent:main:guildchat:channel:tool-result-guard-budget";

875+

const tempPaths: string[] = [];

876+
877+

beforeEach(() => {

878+

resetEmbeddedAttemptHarness();

879+

clearMemoryPluginState();

880+

});

881+
882+

afterEach(async () => {

883+

await cleanupTempPaths(tempPaths);

884+

clearMemoryPluginState();

885+

vi.restoreAllMocks();

886+

});

887+
888+

it("uses the resolved contextTokenBudget before model contextWindow", async () => {

889+

await createContextEngineAttemptRunner({

890+

contextEngine: createContextEngineBootstrapAndAssemble(),

891+

sessionKey,

892+

tempPaths,

893+

attemptOverrides: {

894+

contextTokenBudget: 1_000_000,

895+

model: {

896+

api: "openai-completions",

897+

provider: "openai",

898+

compat: {},

899+

contextWindow: 200_000,

900+

input: ["text"],

901+

} as never,

902+

},

903+

});

904+
905+

expect(hoisted.installToolResultContextGuardMock).toHaveBeenCalledWith(

906+

expect.objectContaining({

907+

contextWindowTokens: 1_000_000,

908+

}),

909+

);

910+

});

911+

});

Original file line numberDiff line numberDiff line change

@@ -1528,7 +1528,12 @@ export async function runEmbeddedAttempt(

15281528

};

15291529

const contextTokenBudgetForGuard = Math.max(

15301530

1,

1531-

Math.floor(params.contextTokenBudget ?? DEFAULT_CONTEXT_TOKENS),

1531+

Math.floor(

1532+

params.contextTokenBudget ??

1533+

params.model.contextWindow ??

1534+

params.model.maxTokens ??

1535+

DEFAULT_CONTEXT_TOKENS,

1536+

),

15321537

);

15331538

const toolResultMaxCharsForGuard = resolveLiveToolResultMaxChars({

15341539

contextWindowTokens: contextTokenBudgetForGuard,

@@ -1544,12 +1549,7 @@ export async function runEmbeddedAttempt(

15441549

if (!activeContextEngine || activeContextEngine.info.ownsCompaction !== true) {

15451550

removeToolResultContextGuard = installToolResultContextGuard({

15461551

agent: activeSession.agent,

1547-

contextWindowTokens: Math.max(

1548-

1,

1549-

Math.floor(

1550-

params.model.contextWindow ?? params.model.maxTokens ?? DEFAULT_CONTEXT_TOKENS,

1551-

),

1552-

),

1552+

contextWindowTokens: contextTokenBudgetForGuard,

15531553

...(midTurnPrecheckEnabled

15541554

? {

15551555

midTurnPrecheck: {