fix(codex): cover side-question native hooks (#82559) · openclaw/openclaw@69a0c92
Kaspre
·
2026-05-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -118,6 +118,7 @@ Docs: https://docs.openclaw.ai
|
118 | 118 | |
119 | 119 | ### Fixes |
120 | 120 | |
| 121 | +- Codex/app-server: cover `/btw` side-question native hooks and app-server command approvals without relying on unsupported turn-scoped hook config. (#82559) Thanks @Kaspre. |
121 | 122 | - Gateway/Docker: fail closed for non-loopback gateway starts without explicit shared-secret or trusted-proxy auth, and stop the image default command from bypassing config validation. Fixes #82865. (#82866) Thanks @coygeek. |
122 | 123 | - Agents/followups: route queued followup turns through CLI runtime backends instead of embedded harness lookup, preventing `claude-cli`/`google-gemini-cli` followups from failing before delivery. Fixes #82847. (#82857) Thanks @hclsys. |
123 | 124 | - CLI/sessions: let `openclaw sessions cleanup --fix-missing` prune malformed rows with unresolvable transcript metadata instead of throwing. Fixes #80970. (#82745) Thanks @IWhatsskill. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -45,7 +45,10 @@ export function createCodexAppServerAgentHarness(options?: {
|
45 | 45 | }, |
46 | 46 | runSideQuestion: async (params) => { |
47 | 47 | const { runCodexAppServerSideQuestion } = await import("./src/app-server/side-question.js"); |
48 | | -return runCodexAppServerSideQuestion(params, { pluginConfig: options?.pluginConfig }); |
| 48 | +return runCodexAppServerSideQuestion(params, { |
| 49 | +pluginConfig: options?.pluginConfig, |
| 50 | +nativeHookRelay: { enabled: true }, |
| 51 | +}); |
49 | 52 | }, |
50 | 53 | compact: async (params) => { |
51 | 54 | const { maybeCompactCodexAppServerSession } = await import("./src/app-server/compact.js"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,10 +5,14 @@ import { createCodexAppServerAgentHarness } from "./harness.js";
|
5 | 5 | import plugin from "./index.js"; |
6 | 6 | |
7 | 7 | const runCodexAppServerAttemptMock = vi.hoisted(() => vi.fn()); |
| 8 | +const runCodexAppServerSideQuestionMock = vi.hoisted(() => vi.fn()); |
8 | 9 | |
9 | 10 | vi.mock("./src/app-server/run-attempt.js", () => ({ |
10 | 11 | runCodexAppServerAttempt: runCodexAppServerAttemptMock, |
11 | 12 | })); |
| 13 | +vi.mock("./src/app-server/side-question.js", () => ({ |
| 14 | +runCodexAppServerSideQuestion: runCodexAppServerSideQuestionMock, |
| 15 | +})); |
12 | 16 | |
13 | 17 | function mockCall(mock: { mock: { calls: unknown[][] } }, index = 0) { |
14 | 18 | return mock.mock.calls.at(index); |
@@ -145,4 +149,24 @@ describe("codex plugin", () => {
|
145 | 149 | }, |
146 | 150 | ); |
147 | 151 | }); |
| 152 | + |
| 153 | +it("enables the native hook relay for public Codex side questions", async () => { |
| 154 | +const harness = createCodexAppServerAgentHarness({ pluginConfig: { appServer: {} } }); |
| 155 | +const runSideQuestion = harness.runSideQuestion; |
| 156 | +const result = { text: "ok" }; |
| 157 | +runCodexAppServerSideQuestionMock.mockResolvedValueOnce(result); |
| 158 | + |
| 159 | +if (!runSideQuestion) { |
| 160 | +throw new Error("Expected Codex harness to expose side questions"); |
| 161 | +} |
| 162 | +await expect(runSideQuestion({ question: "btw" } as never)).resolves.toBe(result); |
| 163 | + |
| 164 | +expect(runCodexAppServerSideQuestionMock).toHaveBeenCalledWith( |
| 165 | +{ question: "btw" }, |
| 166 | +{ |
| 167 | +pluginConfig: { appServer: {} }, |
| 168 | +nativeHookRelay: { enabled: true }, |
| 169 | +}, |
| 170 | +); |
| 171 | +}); |
148 | 172 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。