






















@@ -31,6 +31,7 @@ import { shouldSuppressBuiltInModel } from "../agents/model-suppression.js";
3131import { ensureOpenClawModelsJson } from "../agents/models-config.js";
3232import { isRateLimitErrorMessage } from "../agents/pi-embedded-helpers/errors.js";
3333import { discoverAuthStorage, discoverModels } from "../agents/pi-model-discovery.js";
34+import { STREAM_ERROR_FALLBACK_TEXT } from "../agents/stream-message-shared.js";
3435import { clearRuntimeConfigSnapshot, loadConfig } from "../config/io.js";
3536import type { ModelsConfig, ModelProviderConfig, OpenClawConfig } from "../config/types.js";
3637import { isTruthyEnvValue } from "../infra/env.js";
@@ -736,6 +737,16 @@ describe("shouldSkipEmptyResponseForLiveModel", () => {
736737);
737738});
738739740+describe("isEmptyStreamText", () => {
741+it.each([
742+{ text: "request ended without sending any chunks", expected: true },
743+{ text: `not meaningful: ${STREAM_ERROR_FALLBACK_TEXT}`, expected: true },
744+{ text: "not meaningful: let me think", expected: false },
745+])("returns $expected for $text", ({ text, expected }) => {
746+expect(isEmptyStreamText(text)).toBe(expected);
747+});
748+});
749+739750describe("isPromptProbeMiss", () => {
740751it.each([
741752{ error: "not meaningful: let me think", expected: true },
@@ -763,7 +774,10 @@ function isMissingProfileError(error: string): boolean {
763774}
764775765776function isEmptyStreamText(text: string): boolean {
766-return text.includes("request ended without sending any chunks");
777+return (
778+text.includes("request ended without sending any chunks") ||
779+text.includes(STREAM_ERROR_FALLBACK_TEXT)
780+);
767781}
768782769783function buildAnthropicRefusalToken(): string {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。