fix(sse): explicit types for openai-responses pureHelpers — clears last failing core typecheck gate - #11567
Merged
diegosouzapw merged 2 commits intoAug 26, 2026
Conversation
typecheck:noimplicit:core failed with 36 TS7006 implicit-any errors, all isolated to open-sse/translator/response/openai-responses/pureHelpers.ts (helpers extracted verbatim from the host translator without annotations). Add a minimal ToolArgSchema structural type plus explicit signatures on every function; response/error extraction in normalizeUpstreamFailure and summary extraction in extractResponsesReasoningSummaryText are restructured with identical runtime semantics. Behavior unchanged; all 51 unit tests covering the leaf pass.
npm run lint:json --max-warnings 0 exits 2 on eslint-suppressions.json staleness enforcement. Verified pre-existing at origin/release/v3.8.51 tip (1078022): same exit 2 in a clean detached worktree of that ref, so it is not introduced by this branch. ESLint reports two entries whose violations no longer occur anywhere: - open-sse/executors/index.ts @typescript-eslint/no-unused-vars (1) - open-sse/services/autoCombo/routerStrategy.ts no-unused-vars (2) Pruned mechanically via --prune-suppressions; neither file is touched by this branch. Gates after: lint:json --max-warnings 0 = exit 0, npm run lint = exit 0.
jonlwheat2-gif
force-pushed
the
fix/typecheck-purehelpers-types
branch
from
August 26, 2026 01:11
7ca179f to
edaa079
Compare
diegosouzapw
merged commit Aug 26, 2026
6e96057
into
diegosouzapw:release/v3.8.51
11 of 16 checks passed
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…st failing core typecheck gate (diegosouzapw#11567) Merged via /merge-batch (lote 2026-08-26, v3.8.51). Boarded no worktree combinado junto com outras ~30 PRs; validação única: typecheck/complexity/cognitive-complexity/changelog-integrity verdes, file-size rebaseado onde necessário (crescimento legítimo), lint com os mesmos 228 achados pré-existentes confirmados via sonda contra o tip puro (não introduzidos por este lote), e ~370 testes focados (unit + vitest) passando. Obrigado pela contribuição.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
release/v3.8.51was already failing before this branch. None of those failures are touched here.Summary
Follow-up to audit
2026-08-25_bash-code-audit-v2.md§0 ("this checkout cannot verify itself"). Two commits, three distinct problems: one environmental (fixed with no code change), two real and fixed in code/config. The PR's theme throughout: make the verification gates verifiable again.9305a316aopen-sse/translator/response/openai-responses/pureHelpers.ts7ca179f4fconfig/quality/eslint-suppressions.jsonWhat was broken
1. Environment — checkout had no dependencies installed (root cause of §0)
node_moduleswas completely empty (0 packages) — the audit guessed "incomplete/stale install"; reality: never installed in this checkout.Cannot find module 'zod', plus a ~400+ error cascade of TS2591/TS2503/TS2304 (process,Buffer,NodeJS,setImmediate) from unresolved@types/node.2. Code — 36 genuine implicit-any errors hidden under that noise
typecheck:noimplicit:corestill failed (exit 2) with 36 × TS7006, all in one file:open-sse/translator/response/openai-responses/pureHelpers.ts.3. Config —
lint:json --max-warnings 0exits 2 on stale suppression enforcementorigin/release/v3.8.51tip (107802255), which this branch is cut from. Per-file lint results are independent, and neither affected file is touched by commit 1.open-sse/executors/index.ts(@typescript-eslint/no-unused-vars, count 1) andopen-sse/services/autoCombo/routerStrategy.ts(same rule, count 2).What was fixed
Fix 1 — Environment restore (no commit)
npm install→ 2,425 packages restored (zod@4.4.3,@types/node, etc.), 0 vulnerabilities.npm run typecheck:core: hundreds of errors → exit 0.Audit §0's six "possibly phantom" errors — confirmed PHANTOM
All six were inference cascades from zod resolving to
{}and vanished with the install, exactly as the audit predicted. Zero code changes made to these files:compositeTiersopen-sse/services/combo.ts:372rules/totalsettingsSchemas.ts:317–318modelSyncScheduler.ts:126,128cliRuntime.ts:567Fix 2 — explicit types in
pureHelpers.ts(commit9305a316a)Type-only, behavior-preserving, no
any(ESLintno-explicit-anyis an error inopen-sse/). All upstream call sites were checked first: every consumer usestypeof x === "string" ? x : JSON.stringify(x)patterns, sounknownreturns are safe.Edits in
open-sse/translator/response/openai-responses/pureHelpers.ts(line numbers are post-edit):interface ToolArgSchema— minimal structural view of the tool JSON-Schema subset; fields stayunknown, runtime guards remain the source of truthnormalizeToolName(:17),jsonValuesEqual(:30),hasUsableSchema(:40, now a type predicate),schemaProperties(:44),schemaRequiredSet(:49),isEmptyToolArgValue(:54),matchesSchemaDefault(:60),isDroppableEmptyEntry(:70),schemaTypeIncludes(:81),hasOmissionSentinel(:85),isDroppableNullEntry(:105),stripEmptyOptionalToolArgsObject(:118)stripEmptyOptionalToolArgs,normalizeOutputIndex,normalizeUpstreamFailure,extractResponsesReasoningSummaryText,getVisibleResponsesReasoningSummaryTextTwo bodies restructured for type narrowing with identical runtime semantics:
normalizeUpstreamFailure(:190):data?.response/error/message→ oneRecord<string, unknown>cast ofdata+root.*accesses. Same short-circuit outcomes for null/primitives/arrays.extractResponsesReasoningSummaryText(:238):item.summaryextracted through a cast before the existingArray.isArrayguard. Same""result for non-object input.No logic, ordering, or guard conditions changed anywhere else.
Fix 3 — prune the 2 stale suppressions (commit
7ca179f4f)Mechanical
--prune-suppressionsrun; nothing hand-edited beyond restoring the trailing newline. No allowlist semantics weakened — each removed entry suppressed a violation ESLint confirms no longer exists. This complies with the repo's own stale-enforcement policy (AGENTS.md → Quality Gates → Allowlist policy).Verification (all run this session)
npm run typecheck:corenpm run typecheck:noimplicit:corenpm run lint:json -- --max-warnings 0npm run lint(CI blocking variant)Inheritance proof for Fix 3: detached worktree at
origin/release/v3.8.51(107802255) + junctionednode_modules→npm run lint:json -- --max-warnings 0= exit 2, same message. Worktree torn down after.Test files for Fix 2:
repro-6951,repro-7023,repro-9500-reasoning-separator,encrypted-reasoning-summary-7243,openai-responses-opencode-subagent-sessionid,openai-responses-subagent-strip-2446,response-openai-responses-purehelpers-split.Not tested / honest caveats
noImplicitAnyCI job would do it — happy to add.test:unit/test:vitest/ e2e suites were not run in this session — out of scope for §0.npm installprunes one optional nested entry underlibxmljs2inpackage-lock.jsonon every fresh install here; that diff was reverted twice and is not part of this PR.