
























@@ -14,12 +14,8 @@ describe("openclaw plugin tool context", () => {
1414},
1515});
161617-expect(result.context).toEqual(
18-expect.objectContaining({
19-requesterSenderId: "trusted-sender",
20-senderIsOwner: true,
21-}),
22-);
17+expect(result.context.requesterSenderId).toBe("trusted-sender");
18+expect(result.context.senderIsOwner).toBe(true);
2319});
24202521it("forwards fs policy for plugin tool sandbox enforcement", () => {
@@ -30,11 +26,7 @@ describe("openclaw plugin tool context", () => {
3026},
3127});
322833-expect(result.context).toEqual(
34-expect.objectContaining({
35-fsPolicy: { workspaceOnly: true },
36-}),
37-);
29+expect(result.context.fsPolicy).toStrictEqual({ workspaceOnly: true });
3830});
39314032it("forwards ephemeral sessionId", () => {
@@ -46,12 +38,8 @@ describe("openclaw plugin tool context", () => {
4638},
4739});
484049-expect(result.context).toEqual(
50-expect.objectContaining({
51-sessionKey: "agent:main:telegram:direct:12345",
52-sessionId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
53-}),
54-);
41+expect(result.context.sessionKey).toBe("agent:main:telegram:direct:12345");
42+expect(result.context.sessionId).toBe("a1b2c3d4-e5f6-7890-abcd-ef1234567890");
5543});
56445745it("infers the default agent workspace when workspaceDir is omitted", () => {
@@ -74,12 +62,8 @@ describe("openclaw plugin tool context", () => {
7462} as never,
7563});
766477-expect(result.context).toEqual(
78-expect.objectContaining({
79-agentId: "main",
80- workspaceDir,
81-}),
82-);
65+expect(result.context.agentId).toBe("main");
66+expect(result.context.workspaceDir).toBe(workspaceDir);
8367});
84688569it("infers the session agent workspace when workspaceDir is omitted", () => {
@@ -101,12 +85,8 @@ describe("openclaw plugin tool context", () => {
10185resolvedConfig: config,
10286});
10387104-expect(result.context).toEqual(
105-expect.objectContaining({
106-agentId: "support",
107-workspaceDir: supportWorkspace,
108-}),
109-);
88+expect(result.context.agentId).toBe("support");
89+expect(result.context.workspaceDir).toBe(supportWorkspace);
11090});
1119111292it("uses requester agent override for synthetic embedded session keys", () => {
@@ -129,12 +109,8 @@ describe("openclaw plugin tool context", () => {
129109resolvedConfig: config,
130110});
131111132-expect(result.context).toEqual(
133-expect.objectContaining({
134-agentId: "recall",
135-workspaceDir: recallWorkspace,
136-}),
137-);
112+expect(result.context.agentId).toBe("recall");
113+expect(result.context.workspaceDir).toBe(recallWorkspace);
138114});
139115140116it("forwards browser session wiring", () => {
@@ -146,14 +122,10 @@ describe("openclaw plugin tool context", () => {
146122},
147123});
148124149-expect(result.context).toEqual(
150-expect.objectContaining({
151-browser: {
152-sandboxBridgeUrl: "http://127.0.0.1:9999",
153-allowHostControl: true,
154-},
155-}),
156-);
125+expect(result.context.browser).toStrictEqual({
126+sandboxBridgeUrl: "http://127.0.0.1:9999",
127+allowHostControl: true,
128+});
157129});
158130159131it("forwards gateway subagent binding", () => {
@@ -178,16 +150,12 @@ describe("openclaw plugin tool context", () => {
178150},
179151});
180152181-expect(result.context).toEqual(
182-expect.objectContaining({
183-deliveryContext: {
184-channel: "slack",
185-to: "channel:C123",
186-accountId: "work",
187-threadId: "1710000000.000100",
188-},
189-}),
190-);
153+expect(result.context.deliveryContext).toStrictEqual({
154+channel: "slack",
155+to: "channel:C123",
156+accountId: "work",
157+threadId: "1710000000.000100",
158+});
191159});
192160193161it("does not inject ambient thread defaults into plugin tools", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。