test: align exec event routing proof (#83743) (thanks @Kaspre) · openclaw/openclaw@7b48956
steipete
·
2026-05-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -33,6 +33,7 @@ Docs: https://docs.openclaw.ai
|
33 | 33 | - Plugins/discovery: strip `-plugin` package suffixes when deriving plugin id hints so package names line up with manifest ids. (#85170) Thanks @JulyanXu. |
34 | 34 | - Telegram: preserve fenced code block languages through Markdown rendering so Telegram receives `language-*` code classes. (#85209) Thanks @leno23. |
35 | 35 | - fix(integrations): enforce channel read target allowlists [AI]. (#84982) Thanks @pgondhi987. |
| 36 | +- Agents/heartbeat: route single-owner `session.dmScope=main` direct-message exec and cron event wakes back to the agent main session so async completions no longer strand context in orphan direct-DM queues. Fixes #71581. (#83743) Thanks @Kaspre. |
36 | 37 | - Agents/code-mode: expose outer code-mode `exec` source through the `command` hook alias with `toolKind`/`toolInputKind` discriminators so exec-shaped policies can distinguish code-mode cells. (#83483) Thanks @Kaspre. |
37 | 38 | - QA-Lab: isolate multi-scenario suite workers when scenarios need startup config patches, preventing message-routing config from leaking into unrelated scenarios. |
38 | 39 | - QA-Lab: make the commitments heartbeat-target-none scenario request an immediate heartbeat instead of waiting for the next scheduled heartbeat. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -560,8 +560,6 @@ describe("emitExecSystemEvent", () => {
|
560 | 560 | channel: "telegram", |
561 | 561 | to: "123", |
562 | 562 | }, |
563 | | -forceSenderIsOwnerFalse: true, |
564 | | -trusted: false, |
565 | 563 | }); |
566 | 564 | expect(requestHeartbeatMock).toHaveBeenCalledTimes(1); |
567 | 565 | const heartbeat = requireHeartbeatCall(); |
@@ -760,7 +758,9 @@ describe("runExecProcess POSIX command wrapper", () => {
|
760 | 758 | const spawnCall = supervisorMock.spawn.mock.calls[0][0]; |
761 | 759 | |
762 | 760 | const commandStr = spawnCall.argv.join(" "); |
763 | | -expect(commandStr).toContain('export PATH="${OPENCLAW_PREPEND_PATH}${PATH:+:$PATH}"; unset OPENCLAW_PREPEND_PATH; echo test'); |
| 761 | +expect(commandStr).toContain( |
| 762 | +'export PATH="${OPENCLAW_PREPEND_PATH}${PATH:+:$PATH}"; unset OPENCLAW_PREPEND_PATH; echo test', |
| 763 | +); |
764 | 764 | }); |
765 | 765 | |
766 | 766 | it("does not wrap command on Windows", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -594,7 +594,11 @@ export function buildExecRuntimeErrorOutcome(params: {
|
594 | 594 | * This ensures our paths take precedence even if user RC files (e.g. ~/.zshenv) |
595 | 595 | * prepend their own entries to PATH during shell startup. |
596 | 596 | */ |
597 | | -function wrapPosixCommandWithPathPrepend(command: string, env: Record<string, string>, pathPrepend?: string[]): string { |
| 597 | +function wrapPosixCommandWithPathPrepend( |
| 598 | +command: string, |
| 599 | +env: Record<string, string>, |
| 600 | +pathPrepend?: string[], |
| 601 | +): string { |
598 | 602 | if (process.platform === "win32") { |
599 | 603 | return command; |
600 | 604 | } |
@@ -808,9 +812,13 @@ export async function runExecProcess(opts: {
|
808 | 812 | }; |
809 | 813 | } |
810 | 814 | const { shell, args: shellArgs } = getShellConfig(); |
811 | | - |
| 815 | + |
812 | 816 | // Wrap the command to enforce PATH prepend precedence over shell RC overrides. |
813 | | -const commandWithPathPrepend = wrapPosixCommandWithPathPrepend(execCommand, shellRuntimeEnv, opts.pathPrepend); |
| 817 | +const commandWithPathPrepend = wrapPosixCommandWithPathPrepend( |
| 818 | +execCommand, |
| 819 | +shellRuntimeEnv, |
| 820 | +opts.pathPrepend, |
| 821 | +); |
814 | 822 | |
815 | 823 | const childArgv = [shell, ...shellArgs, commandWithPathPrepend]; |
816 | 824 | if (opts.usePty) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -138,8 +138,6 @@ describe("runHeartbeatOnce", () => {
|
138 | 138 | ); |
139 | 139 | enqueueSystemEvent("Exec completed (run-dm, code 0)", { |
140 | 140 | sessionKey: mainSessionKey, |
141 | | -forceSenderIsOwnerFalse: true, |
142 | | -trusted: false, |
143 | 141 | }); |
144 | 142 | replySpy.mockResolvedValue({ text: "NO_REPLY" }); |
145 | 143 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。