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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
B
Blog RSS Feed
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
D
Docker
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
H
Help Net Security
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
博客园 - Franky
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Blog — PlanetScale
Blog — PlanetScale
L
LangChain 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
test(line): trim outbound payload coverage · openclaw/ope...
steipete · 2026-04-23 · via Recent Commits to openclaw:main

@@ -1,6 +1,8 @@

11

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

22

import type { OpenClawConfig, PluginRuntime } from "../api.js";

3-

import { linePlugin } from "./channel.js";

3+

import { lineConfigAdapter } from "./config-adapter.js";

4+

import { resolveLineGroupRequireMention } from "./group-policy.js";

5+

import { lineOutboundAdapter } from "./outbound.js";

46

import { setLineRuntime } from "./runtime.js";

5768

type LineRuntimeMocks = {

@@ -87,43 +89,7 @@ function createRuntime(): { runtime: PluginRuntime; mocks: LineRuntimeMocks } {

8789

};

8890

}

899190-

describe("linePlugin outbound.sendPayload", () => {

91-

it("preserves resolved accountId when pairing notifications push directly", async () => {

92-

const { runtime, mocks } = createRuntime();

93-

setLineRuntime(runtime);

94-

const cfg = {

95-

channels: {

96-

line: {

97-

accounts: {

98-

primary: {

99-

channelAccessToken: "token-primary",

100-

},

101-

},

102-

},

103-

},

104-

} as OpenClawConfig;

105-

mocks.resolveLineAccount.mockReturnValue({

106-

accountId: "primary",

107-

channelAccessToken: "token-primary",

108-

config: {},

109-

});

110-111-

await linePlugin.pairing!.notifyApproval!({

112-

cfg,

113-

id: "line:user:1",

114-

});

115-116-

expect(mocks.pushMessageLine).toHaveBeenCalledWith(

117-

"line:user:1",

118-

"OpenClaw: your access has been approved.",

119-

{

120-

cfg,

121-

accountId: "primary",

122-

channelAccessToken: "token-primary",

123-

},

124-

);

125-

});

126-92+

describe("line outbound sendPayload", () => {

12793

it("sends flex message without dropping text", async () => {

12894

const { runtime, mocks } = createRuntime();

12995

setLineRuntime(runtime);

@@ -141,7 +107,7 @@ describe("linePlugin outbound.sendPayload", () => {

141107

},

142108

};

143109144-

await linePlugin.outbound!.sendPayload!({

110+

await lineOutboundAdapter.sendPayload!({

145111

to: "line:group:1",

146112

text: payload.text,

147113

payload,

@@ -178,7 +144,7 @@ describe("linePlugin outbound.sendPayload", () => {

178144

},

179145

};

180146181-

await linePlugin.outbound!.sendPayload!({

147+

await lineOutboundAdapter.sendPayload!({

182148

to: "line:user:1",

183149

text: payload.text,

184150

payload,

@@ -212,7 +178,7 @@ describe("linePlugin outbound.sendPayload", () => {

212178

},

213179

};

214180215-

await linePlugin.outbound!.sendPayload!({

181+

await lineOutboundAdapter.sendPayload!({

216182

to: "line:user:2",

217183

text: "",

218184

payload,

@@ -251,7 +217,7 @@ describe("linePlugin outbound.sendPayload", () => {

251217

},

252218

};

253219254-

await linePlugin.outbound!.sendPayload!({

220+

await lineOutboundAdapter.sendPayload!({

255221

to: "line:user:3",

256222

text: payload.text,

257223

payload,

@@ -285,7 +251,7 @@ describe("linePlugin outbound.sendPayload", () => {

285251

setLineRuntime(runtime);

286252

const cfg = { channels: { line: {} } } as OpenClawConfig;

287253288-

await linePlugin.outbound!.sendPayload!({

254+

await lineOutboundAdapter.sendPayload!({

289255

to: "line:user:4",

290256

text: "",

291257

payload: {

@@ -308,7 +274,7 @@ describe("linePlugin outbound.sendPayload", () => {

308274

setLineRuntime(runtime);

309275

const cfg = { channels: { line: {} } } as OpenClawConfig;

310276311-

await linePlugin.outbound!.sendPayload!({

277+

await lineOutboundAdapter.sendPayload!({

312278

to: "line:user:5",

313279

text: "",

314280

payload: {

@@ -354,7 +320,7 @@ describe("linePlugin outbound.sendPayload", () => {

354320

},

355321

};

356322357-

await linePlugin.outbound!.sendPayload!({

323+

await lineOutboundAdapter.sendPayload!({

358324

to: "line:user:3",

359325

text: payload.text,

360326

payload,

@@ -386,7 +352,7 @@ describe("linePlugin outbound.sendPayload", () => {

386352

},

387353

};

388354389-

await linePlugin.outbound!.sendPayload!({

355+

await lineOutboundAdapter.sendPayload!({

390356

to: "line:group:C123",

391357

text: payload.text,

392358

payload,

@@ -426,7 +392,7 @@ describe("linePlugin outbound.sendPayload", () => {

426392

},

427393

};

428394429-

await linePlugin.outbound!.sendPayload!({

395+

await lineOutboundAdapter.sendPayload!({

430396

to: "line:user:U123",

431397

text: payload.text,

432398

payload,

@@ -466,7 +432,7 @@ describe("linePlugin outbound.sendPayload", () => {

466432

};

467433468434

await expect(

469-

linePlugin.outbound!.sendPayload!({

435+

lineOutboundAdapter.sendPayload!({

470436

to: "line:user:U123",

471437

text: payload.text,

472438

payload,

@@ -479,7 +445,7 @@ describe("linePlugin outbound.sendPayload", () => {

479445480446

describe("linePlugin config.formatAllowFrom", () => {

481447

it("strips line:user: prefixes without lowercasing", () => {

482-

const formatted = linePlugin.config.formatAllowFrom!({

448+

const formatted = lineConfigAdapter.formatAllowFrom!({

483449

cfg: {} as OpenClawConfig,

484450

allowFrom: ["line:user:UABC", "line:UDEF"],

485451

});

@@ -509,7 +475,7 @@ describe("linePlugin groups.resolveRequireMention", () => {

509475

},

510476

} as OpenClawConfig;

511477512-

const requireMention = linePlugin.groups!.resolveRequireMention!({

478+

const requireMention = resolveLineGroupRequireMention({

513479

cfg,

514480

accountId: "primary",

515481

groupId: "group-1",