Repository navigation
chore(combo): extract pure error predicates and quota status helpers to comboPredicates - #8548
Conversation
|
Thanks for this — I verified the extraction end-to-end in an isolated worktree: typecheck, lint and One correction to the framing, so the record is accurate: on the current tip The thing worth settling before any of these merge: you have three open PRs extracting the same predicates from the same hunk of
Only one of the two designs should land — they touch the identical hunk. My read is that this one is the better target: it reuses a module that already has mutation coverage wired up, and it extracts more. But you know the reasoning behind splitting out Could you also add a |
a13cc25 to
1841844
Compare
…to comboPredicates
1841844 to
31d5107
Compare
|
Agreed on both counts — going with this PR's design, and #8555 is closed. On the framing correction: you're right and my reading was the stale one. changelog.d: already in — Rebased onto Merge ordering is no longer a concern. With #8555 dropped, the |
|
Correction to my comment above: I measured it on pristine detached checkouts with an empty working tree: The gate is in |
|
Thanks @MumuTW — merged into |
…to comboPredicates (diegosouzapw#8548)
…to comboPredicates (diegosouzapw#8548)
Summary
Extract 8 pure helper/predicate functions (
clampPercent,quotaRemainingPercentFromQuota,normalizeConnectionStatus,hasFutureRateLimitUntil,getConnectionStatusQuotaCutoffReason,isContextOverflow400,isParamValidation400,isModelScoped400) fromopen-sse/services/combo.tstoopen-sse/services/combo/comboPredicates.ts.Re-export them from
combo.tsfor backward compatibility.Changes
open-sse/services/combo/comboPredicates.ts: Added pure implementations and required regex pattern imports (CONTEXT_OVERFLOW_PATTERNS,MODEL_ACCESS_DENIED_PATTERNS).open-sse/services/combo.ts: Removed inline predicates and re-exported fromcomboPredicates.ts(file size reduced from 3,629 to 3,546 lines).Verification
npm run typecheck:corepassed with 0 errors.npm run check:cyclespassed.combo-strategies.test.ts,combo-param-validation-fallback-4519.test.ts,repro-6637-kimi-token-limit.test.ts) passed.