Skip to content

fix(types): align web fallback contracts - #8819

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.49from
backryun:chore/ts7-types-web-fallback-contracts
Jul 28, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.49from
backryun:chore/ts7-types-web-fallback-contracts

Conversation

@backryun

@backryun backryun commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • declare the tools and tool_choice fields used by both fallback body transformers
  • align each native-bypass predicate with the optional targetFormat accepted by its caller
  • preserve all web-search and web-fetch transformation behavior

Root cause

Both structural-twin modules constrained their generic request body only as Record<string, unknown>. That permits indexed reads but does not guarantee a named tool_choice property on the generic result when the transformer rewrites it. Their preparation options also allowed an omitted targetFormat, while the bypass predicate receiving the same object declared that field as required.

Diagnostics

Re-measured after rebasing onto release/v3.8.49 at d6c06932e:

  • TypeScript 6: 141 → 137
  • TypeScript 7: 140 → 136
  • full canonicalized error-set diff: 4 removed, 0 added

Validation

  • npm run typecheck:core
  • npx eslint open-sse/services/webFetchInterception.ts open-sse/services/webSearchFallback.ts
  • npm run check:file-size
  • web-search, web-fetch, and chat-core interception tests (32/32)
  • Prettier run on both touched files
  • git diff --check

No new runtime test is needed because this is a type-only contract correction and the existing focused suites cover native bypass, flat/nested tool shapes, tool_choice rewriting, opt-in behavior, and byte-identical no-op paths.

CI note

The new release root includes the pack-artifact-policy.test.ts fixture fix, and that focused test now passes. The unrelated ProviderAccountRoutingCard.tsx:87 hook-dependency ESLint error still reproduces on the base; this PR does not touch that area.

@backryun
backryun marked this pull request as ready for review July 27, 2026 23:59
@backryun
backryun requested a review from diegosouzapw as a code owner July 27, 2026 23:59
@backryun
backryun force-pushed the chore/ts7-types-web-fallback-contracts branch from 5cc23ad to 0c6a540 Compare July 28, 2026 01:51
@diegosouzapw
diegosouzapw merged commit 6133939 into cheaper-inference:release/v3.8.49 Jul 28, 2026
14 of 16 checks passed
@backryun
backryun deleted the chore/ts7-types-web-fallback-contracts branch July 28, 2026 03:19
@diegosouzapw diegosouzapw mentioned this pull request Jul 28, 2026
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants