From f6a307d9d1db22b8a3d758b47dd56aba13143a09 Mon Sep 17 00:00:00 2001 From: axisrow Date: Mon, 3 Aug 2026 10:33:27 +0800 Subject: [PATCH] fix: repair the tsc build broken by interruptAppServerTurn's JSDoc/param mismatch npm run build (tsc -p tsconfig.app-server.json) fails on main with: codex.mjs(1209,53): error TS2339: Property 'threadId' does not exist on type '{}'. codex.mjs(1209,63): error TS2339: Property 'turnId' does not exist on type '{}'. codex.mjs(1209,71): error TS2339: Property 'timeoutMs' does not exist on type '{}'. interruptAppServerTurn's second parameter is destructured directly in the signature (`{ threadId, turnId, timeoutMs } = {}`), while the JSDoc above it types a parameter named `options`. TS's JSDoc-to-signature binding matches by parameter position/name, not by shape, so the destructuring pattern doesn't pick up the JSDoc type -- TS instead infers the parameter's type from its `= {}` default, i.e. `{}`, and then rejects every property access on the destructured names. Fix: destructure inside the function body instead of the signature (same pattern already used by CodexAppServerClient#request in app-server.mjs), so the JSDoc-typed `options` parameter name lines up with the actual parameter. No behavior change -- same defaulting, same property reads, just moved one line down. Landed via db52e28/f67a09f without a build check catching it (npm test alone doesn't run tsc). Verified by reverting this change on a clean main checkout and reproducing the same three errors, then re-applying to confirm `npm run build` is clean. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01HbkiKZR4w8hZUmNNTdb6kB --- plugins/codex/scripts/lib/codex.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/codex/scripts/lib/codex.mjs b/plugins/codex/scripts/lib/codex.mjs index 4f5a95f6..1eeaa1fb 100644 --- a/plugins/codex/scripts/lib/codex.mjs +++ b/plugins/codex/scripts/lib/codex.mjs @@ -1206,7 +1206,12 @@ function resolveInterruptTimeoutMs(timeoutMs) { return DEFAULT_INTERRUPT_TIMEOUT_MS; } -export async function interruptAppServerTurn(cwd, { threadId, turnId, timeoutMs } = {}) { +/** + * @param {string} cwd + * @param {{ threadId?: string, turnId?: string, timeoutMs?: number }} [options] + */ +export async function interruptAppServerTurn(cwd, options = {}) { + const { threadId, turnId, timeoutMs } = options; if (!threadId || !turnId) { return { attempted: false,