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

推荐订阅源

博客园 - 叶小钗
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
量子位
月光博客
月光博客
人人都是产品经理
人人都是产品经理
U
Unit 42
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
美团技术团队
P
Proofpoint News Feed
Apple Machine Learning Research
Apple Machine Learning Research
D
Docker
B
Blog
大猫的无限游戏
大猫的无限游戏
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers 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(telegram): pass rich text prompts to cli backends · o...
obviyus · 2026-06-14 · via Recent Commits to openclaw:main

@@ -5,6 +5,7 @@ import os from "node:os";

55

import path from "node:path";

66

import { CURRENT_SESSION_VERSION } from "openclaw/plugin-sdk/agent-sessions";

77

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

8+

import type { ChannelPlugin } from "../../channels/plugins/types.plugin.js";

89

import type { OpenClawConfig } from "../../config/types.openclaw.js";

910

import { registerLegacyContextEngine } from "../../context-engine/legacy.registration.js";

1011

import {

@@ -14,6 +15,11 @@ import {

1415

import type { ContextEngine } from "../../context-engine/types.js";

1516

import { getGlobalHookRunner } from "../../plugins/hook-runner-global.js";

1617

import { clearMemoryPluginState, registerMemoryPromptSection } from "../../plugins/memory-state.js";

18+

import { setActivePluginRegistry } from "../../plugins/runtime.js";

19+

import {

20+

createChannelTestPluginBase,

21+

createTestRegistry,

22+

} from "../../test-utils/channel-plugins.js";

1723

import { captureEnv, setTestEnvValue } from "../../test-utils/env.js";

1824

import { testing as cliBackendsTesting } from "../cli-backends.js";

1925

import { hashCliSessionText } from "../cli-session.js";

@@ -276,6 +282,7 @@ describe("shouldSkipLocalCliCredentialEpoch", () => {

276282

ensureSandboxWorkspaceForSessionMock.mockReset();

277283

resetContextWindowCacheForTest();

278284

clearMemoryPluginState();

285+

setActivePluginRegistry(createTestRegistry());

279286

vi.unstubAllEnvs();

280287

sessionFileEnvSnapshot?.restore();

281288

sessionFileEnvSnapshot = undefined;

@@ -1012,6 +1019,45 @@ describe("shouldSkipLocalCliCredentialEpoch", () => {

10121019

}

10131020

});

101410211022+

it("passes Telegram rich text capabilities into CLI system prompts", async () => {

1023+

const { dir, sessionFile } = createSessionFile();

1024+

setActivePluginRegistry(

1025+

createTestRegistry([

1026+

{

1027+

pluginId: "telegram",

1028+

source: "test",

1029+

plugin: {

1030+

...createChannelTestPluginBase({ id: "telegram", label: "Telegram" }),

1031+

agentPrompt: {

1032+

messageToolCapabilities: () => ["richText"],

1033+

},

1034+

} satisfies ChannelPlugin,

1035+

},

1036+

]),

1037+

);

1038+1039+

try {

1040+

const context = await prepareCliRunContext({

1041+

sessionId: "session-test",

1042+

sessionFile,

1043+

workspaceDir: dir,

1044+

prompt: "latest ask",

1045+

provider: "test-cli",

1046+

model: "test-model",

1047+

timeoutMs: 1_000,

1048+

runId: "run-test-telegram-rich-text",

1049+

messageChannel: "telegram",

1050+

config: createCliBackendConfig(),

1051+

});

1052+1053+

expect(context.systemPrompt).toContain("channel=telegram");

1054+

expect(context.systemPrompt).toContain("Telegram rich text is available");

1055+

expect(context.systemPrompt).toContain("This is not legacy MarkdownV2/parse_mode");

1056+

} finally {

1057+

fs.rmSync(dir, { recursive: true, force: true });

1058+

}

1059+

});

1060+10151061

it("ignores volatile prompt text when static prompt text matches", async () => {

10161062

const { dir, sessionFile } = createSessionFile();

10171063

try {