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

推荐订阅源

博客园 - 聂微东
GbyAI
GbyAI
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
B
Blog
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
雷峰网
雷峰网
爱范儿
爱范儿
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
P
Proofpoint News Feed
A
About on SuperTechFans
I
InfoQ
F
Fortinet All Blogs
L
LangChain Blog
T
Tailwind CSS 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: preserve plugin LLM command auth (#85936) · openclaw...
jalehman · 2026-05-27 · via Recent Commits to openclaw:main

@@ -13,6 +13,7 @@ import {

1313

setActivePluginRegistry,

1414

} from "openclaw/plugin-sdk/plugin-test-runtime";

1515

import { dispatchReplyWithDispatcher } from "openclaw/plugin-sdk/reply-dispatch-runtime";

16+

import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";

1617

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

1718

import { defineThrowingDiscordChannelGetter } from "../test-support/partial-channel.js";

1819

import { resolveDiscordNativeInteractionRouteState } from "./native-command-route.js";

@@ -29,6 +30,7 @@ const runtimeModuleMocks = vi.hoisted(() => ({

2930

executePluginCommand: vi.fn(),

3031

dispatchReplyWithDispatcher: vi.fn(),

3132

resolveDirectStatusReplyForSession: vi.fn(),

33+

getSessionEntry: vi.fn(),

3234

}));

33353436

function createConfig(): OpenClawConfig {

@@ -408,6 +410,7 @@ describe("Discord native plugin command dispatch", () => {

408410

discordNativeCommandTesting.setResolveDiscordNativeInteractionRouteState(

409411

resolveDiscordNativeInteractionRouteState,

410412

);

413+

discordNativeCommandTesting.setGetSessionEntry(getSessionEntry);

411414

});

412415413416

beforeEach(() => {

@@ -430,6 +433,8 @@ describe("Discord native plugin command dispatch", () => {

430433

runtimeModuleMocks.resolveDirectStatusReplyForSession.mockResolvedValue({

431434

text: "status reply",

432435

});

436+

runtimeModuleMocks.getSessionEntry.mockReset();

437+

runtimeModuleMocks.getSessionEntry.mockReturnValue(undefined);

433438

discordNativeCommandTesting.setMatchPluginCommand(

434439

runtimeModuleMocks.matchPluginCommand as typeof import("openclaw/plugin-sdk/plugin-runtime").matchPluginCommand,

435440

);

@@ -450,6 +455,9 @@ describe("Discord native plugin command dispatch", () => {

450455

accountId: params.accountId,

451456

}),

452457

);

458+

discordNativeCommandTesting.setGetSessionEntry(

459+

runtimeModuleMocks.getSessionEntry as typeof import("openclaw/plugin-sdk/session-store-runtime").getSessionEntry,

460+

);

453461

});

454462455463

it("executes plugin commands from the real registry through the native Discord command path", async () => {

@@ -476,6 +484,43 @@ describe("Discord native plugin command dispatch", () => {

476484

});

477485

});

478486487+

it("passes the active auth profile to Discord plugin commands", async () => {

488+

const cfg = createConfig();

489+

const interaction = createInteraction();

490+

runtimeModuleMocks.getSessionEntry.mockReturnValue({

491+

sessionId: "discord-session",

492+

authProfileOverride: "openai-codex:owner@example.com",

493+

updatedAt: Date.now(),

494+

});

495+496+

registerPairPlugin();

497+

const command = await createPluginCommand({

498+

cfg,

499+

name: "pair",

500+

});

501+

const executeSpy = runtimeModuleMocks.executePluginCommand.mockResolvedValue({

502+

text: "paired:now",

503+

});

504+505+

await (command as { run: (interaction: unknown) => Promise<void> }).run(

506+

Object.assign(interaction, {

507+

options: {

508+

getString: () => "now",

509+

getBoolean: () => null,

510+

getFocused: () => "",

511+

},

512+

}) as unknown,

513+

);

514+515+

expectPluginCommandExecution({

516+

mock: executeSpy,

517+

commandName: "pair",

518+

expected: {

519+

authProfileId: "openai-codex:owner@example.com",

520+

},

521+

});

522+

});

523+479524

it("does not treat Discord DM allowlist users as scoped plugin command owners", async () => {

480525

const cfg = {

481526

channels: {