修 #84857:于压缩时,略过 CLI 运行时框架之预检 (#85… · openclaw/openclaw@fa39bef)
clawsweeper
·
2026-05-24
·
via Recent Commits to openclaw:main
| 原文行号 | 差异行号 | 差异行变 |
|---|
@@ -62,6 +62,7 @@ Docs: https://docs.openclaw.ai
|
62 | 62 | |
63 | 63 | ### Fixes |
64 | 64 | |
| 65 | +- Agents/compaction: skip agent-harness preflight for provider-owned CLI runtime sessions so over-threshold Claude CLI sessions continue through normal compaction instead of failing on a missing harness. Fixes #84857. (#84878) Thanks @zhangguiping-xydt. |
65 | 66 | - WebChat: summarize internal message-tool source replies so tool cards no longer duplicate the visible reply body. (#84773) Thanks @jason-allen-oneal. |
66 | 67 | - WebChat: scope the visible attachment button to its own composer file input so clicking Upload reliably opens the file picker. (#83952, fixes #47983) Thanks @jason-allen-oneal. |
67 | 68 | - Gateway: preserve deferred lifecycle-error cleanup across later non-terminal events so provider timeouts can persist failed session state instead of leaving sessions stuck running. (#85256, fixes #63819) Thanks @samzong. |
|
| 原文行号 | 差异行号 | 差异行变 |
|---|
@@ -429,15 +429,19 @@ describe("meeting-notes plugin", () => {
|
429 | 429 | ], |
430 | 430 | }); |
431 | 431 | const logger = { debug: vi.fn(), error: vi.fn(), info: vi.fn(), warn: vi.fn() }; |
| 432 | +const service = services[0]; |
| 433 | +if (!service?.stop) { |
| 434 | +throw new Error("Expected meeting notes service with stop hook"); |
| 435 | +} |
432 | 436 | |
433 | | -await services[0]?.start({ config: {}, logger, stateDir }); |
| 437 | +await service.start({ config: {}, logger, stateDir }); |
434 | 438 | await vi.waitFor(() => { |
435 | 439 | expect(start).toHaveBeenCalledOnce(); |
436 | 440 | }); |
437 | 441 | const request = start.mock.calls[0]?.[0]; |
438 | 442 | expect(request.abortSignal?.aborted).toBe(false); |
439 | 443 | |
440 | | -await services[0]?.stop({ config: {}, logger, stateDir }); |
| 444 | +await service.stop({ config: {}, logger, stateDir }); |
441 | 445 | |
442 | 446 | expect(request.abortSignal?.aborted).toBe(true); |
443 | 447 | expect(stop).not.toHaveBeenCalled(); |
|
| 原文行号 | 差异行号 | 差异行变 |
|---|
@@ -106,7 +106,7 @@ async function waitForPendingAutoStartsToSettle(
|
106 | 106 | let timeout: ReturnType<typeof setTimeout> | undefined; |
107 | 107 | try { |
108 | 108 | return await Promise.race([ |
109 | | -Promise.allSettled([...pendingStarts]).then(() => true), |
| 109 | +Promise.allSettled(pendingStarts).then(() => true), |
110 | 110 | new Promise<boolean>((resolve) => { |
111 | 111 | timeout = setTimeout(() => resolve(false), AUTO_START_STOP_TIMEOUT_MS); |
112 | 112 | timeout.unref?.(); |
|
| 原文行号 | 差异行号 | 差异行变更 |
|---|
@@ -639,6 +639,34 @@ describe("selectAgentHarness", () => {
|
639 | 639 | ).toBe("codex"); |
640 | 640 | }); |
641 | 641 | |
| 642 | +it("skips harness compaction preflight for claude-cli runtime sessions", async () => { |
| 643 | +await expect( |
| 644 | +maybeCompactAgentHarnessSession({ |
| 645 | +sessionId: "session-1", |
| 646 | +sessionKey: "agent:main:main", |
| 647 | +sessionFile: "/tmp/session.jsonl", |
| 648 | +workspaceDir: "/tmp/workspace", |
| 649 | +provider: "anthropic", |
| 650 | +model: "claude-opus-4-7", |
| 651 | +config: agentModelRuntimeConfig("anthropic/claude-opus-4-7", "claude-cli"), |
| 652 | +}), |
| 653 | +).resolves.toBeUndefined(); |
| 654 | +}); |
| 655 | + |
| 656 | +it("skips harness compaction preflight for claude-cli provider sessions", async () => { |
| 657 | +await expect( |
| 658 | +maybeCompactAgentHarnessSession({ |
| 659 | +sessionId: "session-1", |
| 660 | +sessionKey: "agent:main:main", |
| 661 | +sessionFile: "/tmp/session.jsonl", |
| 662 | +workspaceDir: "/tmp/workspace", |
| 663 | +provider: "claude-cli", |
| 664 | +model: "claude-opus-4-7", |
| 665 | +config: providerRuntimeConfig("claude-cli", "claude-cli"), |
| 666 | +}), |
| 667 | +).resolves.toBeUndefined(); |
| 668 | +}); |
| 669 | + |
642 | 670 | it("ignores stale plugin pins during compaction when the provider no longer matches", async () => { |
643 | 671 | registerFailingCodexHarness(); |
644 | 672 | |
|
| 原文件行号 | 差异行号 | 差异行变更 |
|---|
|
1 | 1 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
2 | 2 | import { formatErrorMessage } from "../../infra/errors.js"; |
3 | 3 | import { createSubsystemLogger } from "../../logging/subsystem.js"; |
4 | | -import { isCliRuntimeAliasForProvider } from "../model-runtime-aliases.js"; |
| 4 | +import { isCliRuntimeAliasForProvider, isCliRuntimeProvider } from "../model-runtime-aliases.js"; |
5 | 5 | import type { CompactEmbeddedPiSessionParams } from "../pi-embedded-runner/compact.types.js"; |
6 | 6 | import type { |
7 | 7 | EmbeddedRunAttemptParams, |
@@ -459,6 +459,18 @@ function logAgentHarnessSelection(
|
459 | 459 | export async function maybeCompactAgentHarnessSession( |
460 | 460 | params: CompactEmbeddedPiSessionParams, |
461 | 461 | ): Promise<EmbeddedPiCompactResult | undefined> { |
| 462 | +if (params.provider && isCliRuntimeProvider(params.provider)) { |
| 463 | +return undefined; |
| 464 | +} |
| 465 | +const runtime = resolveConfiguredAgentHarnessPolicy({ |
| 466 | +provider: params.provider, |
| 467 | +modelId: params.model, |
| 468 | +config: params.config, |
| 469 | +sessionKey: params.sessionKey, |
| 470 | +}).runtime; |
| 471 | +if (isCliRuntimeAliasForProvider({ runtime, provider: params.provider })) { |
| 472 | +return undefined; |
| 473 | +} |
462 | 474 | const harness = selectAgentHarness({ |
463 | 475 | provider: params.provider ?? "", |
464 | 476 | modelId: params.model, |
|
| 原文件行号 | 差异行号 | 差异行变更 |
|---|
@@ -6,10 +6,11 @@ import type {
|
6 | 6 | PluginHookGatewayContext, |
7 | 7 | PluginHookGatewayStartEvent, |
8 | 8 | } from "../plugins/hook-types.js"; |
| 9 | +import type { PluginServicesHandle } from "../plugins/services.js"; |
9 | 10 | import { withEnvAsync } from "../test-utils/env.js"; |
10 | 11 | |
11 | 12 | const hoisted = vi.hoisted(() => { |
12 | | -const startPluginServices = vi.fn(async () => null); |
| 13 | +const startPluginServices = vi.fn<() => Promise<PluginServicesHandle | null>>(async () => null); |
13 | 14 | const startGmailWatcherWithLogs = vi.fn(async () => {}); |
14 | 15 | const loadInternalHooks = vi.fn(async () => 0); |
15 | 16 | const setInternalHooksEnabled = vi.fn(); |
|
此內容由慣性聚合(RSS閱讀器)自動聚合整理,僅供閱讀參考。 原文來自 — 版權歸原作者所有。