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

推荐订阅源

博客园_首页
H
Help Net Security
腾讯CDC
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
D
Docker
V
V2EX
Last Week in AI
Last Week in AI
G
Google Developers Blog
IT之家
IT之家
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东

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(agents): expose session status route context · opencl...
nxmxbbd · 2026-06-01 · via Recent Commits to openclaw:main

@@ -617,6 +617,165 @@ describe("session_status tool", () => {

617617

expect(details.statusText).toContain("OpenClaw");

618618

});

619619620+

it("reports origin, active, and persisted delivery route metadata for semantic current", async () => {

621+

const sessionKey = "agent:main:discord:channel:1489550370136129537";

622+

resetSessionStore({

623+

[sessionKey]: {

624+

sessionId: "s-discord-origin-webchat-active",

625+

updatedAt: 10,

626+

origin: { provider: "discord", accountId: "bot-primary" },

627+

deliveryContext: {

628+

channel: "discord",

629+

to: "channel:1489550370136129537",

630+

accountId: "bot-primary",

631+

threadId: "thread-origin",

632+

},

633+

},

634+

});

635+636+

const tool = createSessionStatusTool({

637+

agentSessionKey: sessionKey,

638+

runSessionKey: sessionKey,

639+

activeDeliveryContext: {

640+

channel: "webchat",

641+

to: "control-ui-conversation",

642+

accountId: "browser",

643+

threadId: "webchat-thread",

644+

},

645+

config: mockConfig as never,

646+

});

647+648+

const result = await tool.execute("call-current-route-context", { sessionKey: "current" });

649+

const details = result.details as {

650+

ok?: boolean;

651+

sessionKey?: string;

652+

statusText?: string;

653+

origin?: { provider?: string; accountId?: string };

654+

active?: { channel?: string; to?: string; accountId?: string; threadId?: string };

655+

deliveryContext?: {

656+

channel?: string;

657+

to?: string;

658+

accountId?: string;

659+

threadId?: string;

660+

};

661+

};

662+

expect(details.ok).toBe(true);

663+

expect(details.sessionKey).toBe(sessionKey);

664+

expect(details.origin).toEqual({ provider: "discord", accountId: "bot-primary" });

665+

expect(details.active).toEqual({

666+

channel: "webchat",

667+

to: "control-ui-conversation",

668+

accountId: "browser",

669+

threadId: "webchat-thread",

670+

});

671+

expect(details.deliveryContext).toEqual({

672+

channel: "discord",

673+

to: "channel:1489550370136129537",

674+

accountId: "bot-primary",

675+

threadId: "thread-origin",

676+

});

677+

const text =

678+

result.content.find((item): item is { type: "text"; text: string } => item.type === "text")

679+

?.text ?? "";

680+

expect(text).toContain("Route context:");

681+

expect(text).toContain('"origin"');

682+

expect(text).toContain('"active"');

683+

expect(text).toContain('"deliveryContext"');

684+

expect(details.statusText).toContain('"active"');

685+

});

686+687+

it("does not report an active route for explicit non-live session lookups", async () => {

688+

const currentKey = "agent:main:main";

689+

const targetKey = "agent:main:discord:channel:1489550370136129537";

690+

resetSessionStore({

691+

[currentKey]: {

692+

sessionId: "s-main",

693+

updatedAt: 5,

694+

},

695+

[targetKey]: {

696+

sessionId: "s-target",

697+

updatedAt: 10,

698+

deliveryContext: {

699+

channel: "discord",

700+

to: "channel:1489550370136129537",

701+

},

702+

},

703+

});

704+

mockConfig = {

705+

...mockConfig,

706+

tools: { sessions: { visibility: "all" }, agentToAgent: { enabled: true, allow: ["*"] } },

707+

};

708+709+

const tool = createSessionStatusTool({

710+

agentSessionKey: currentKey,

711+

runSessionKey: currentKey,

712+

activeDeliveryContext: {

713+

channel: "webchat",

714+

to: "control-ui-conversation",

715+

},

716+

config: mockConfig as never,

717+

});

718+719+

const result = await tool.execute("call-explicit-non-live-route-context", {

720+

sessionKey: targetKey,

721+

});

722+

const details = result.details as {

723+

origin?: { provider?: string };

724+

active?: { channel?: string };

725+

deliveryContext?: { channel?: string; to?: string };

726+

};

727+

expect(details.origin).toEqual({ provider: "discord" });

728+

expect(details.active).toBeUndefined();

729+

expect(details.deliveryContext).toEqual({

730+

channel: "discord",

731+

to: "channel:1489550370136129537",

732+

});

733+

});

734+735+

it("does not report an active route for an explicit stale policy-key lookup", async () => {

736+

const policyKey = "agent:main:telegram:default:direct:1234";

737+

const runKey = "agent:main:main";

738+

resetSessionStore({

739+

[policyKey]: {

740+

sessionId: "s-policy",

741+

updatedAt: 5,

742+

deliveryContext: {

743+

channel: "telegram",

744+

to: "telegram:direct:1234",

745+

},

746+

},

747+

[runKey]: {

748+

sessionId: "s-run",

749+

updatedAt: 10,

750+

},

751+

});

752+753+

const tool = createSessionStatusTool({

754+

agentSessionKey: policyKey,

755+

runSessionKey: runKey,

756+

activeDeliveryContext: {

757+

channel: "webchat",

758+

to: "control-ui-conversation",

759+

},

760+

config: mockConfig as never,

761+

});

762+763+

const result = await tool.execute("call-explicit-stale-policy-key-route-context", {

764+

sessionKey: policyKey,

765+

});

766+

const details = result.details as {

767+

sessionKey?: string;

768+

active?: { channel?: string };

769+

deliveryContext?: { channel?: string; to?: string };

770+

};

771+

expect(details.sessionKey).toBe(policyKey);

772+

expect(details.active).toBeUndefined();

773+

expect(details.deliveryContext).toEqual({

774+

channel: "telegram",

775+

to: "telegram:direct:1234",

776+

});

777+

});

778+620779

it("rejects explicit cross-session key under tree visibility even when it equals runSessionKey (#76708)", async () => {

621780

resetSessionStore({

622781

"agent:main:telegram:default:direct:1234": {