From be0551f52fdd0b59736ffd74086228f5ba5e12c4 Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Thu, 20 Aug 2026 12:33:15 +0800 Subject: [PATCH] fix(code-runtime-python): suppress no-unnecessary-condition on the late-rejection settled guard --- packages/code-runtime/code-runtime-python/src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/code-runtime/code-runtime-python/src/index.ts b/packages/code-runtime/code-runtime-python/src/index.ts index abcc0a0efa..be7e4bfe03 100644 --- a/packages/code-runtime/code-runtime-python/src/index.ts +++ b/packages/code-runtime/code-runtime-python/src/index.ts @@ -1425,9 +1425,13 @@ export class PythonCodeRuntime extends CodeRuntime { // before `sendReply` peeks at `settled`. Dropping the framed // reply early spares the host heap and time for a run whose // outcome is already fixed. - // oxlint-disable-next-line typescript/no-unnecessary-condition -- the run can settle while this binding is awaited. + // (oxlint block-disable so both `v8 ignore next` and the rule + // suppression land on the `if`: `settled` flips true mid-wait, + // invisible to the type-aware lint, which narrows it to false.) + /* oxlint-disable typescript/no-unnecessary-condition */ /* v8 ignore next -- a rejection arriving after settlement is not schedulable from a test. */ if (settled) return + /* oxlint-enable typescript/no-unnecessary-condition */ sendReply({ type: 'reply', id: message.id, ok: false, message: messageOf(error) }) } })()