Repository navigation
refactor(chatCore): extrai decisão de Background Task Redirect (T41) (#3501) - #4526
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
diegosouzapw
force-pushed
the
refactor/qg-chatcore-effort
branch
from
June 21, 2026 17:19
946d51a to
ac25ec1
Compare
diegosouzapw
force-pushed
the
refactor/qg-chatcore-bgredirect
branch
from
June 21, 2026 17:19
b8f0352 to
848f333
Compare
diegosouzapw
force-pushed
the
refactor/qg-chatcore-effort
branch
from
June 21, 2026 17:21
ac25ec1 to
36b2f7f
Compare
diegosouzapw
changed the base branch from
refactor/qg-chatcore-effort
to
release/v3.8.33
June 21, 2026 17:21
…3501) Move a decisão do Background Task Redirection (T41) do topo de handleChatCore para o novo leaf open-sse/handlers/chatCore/backgroundRedirect.ts (resolveBackgroundTaskRedirect). Retorna { backgroundReason, redirect }: backgroundReason é o sinal de detecção (truthy quando a request parece tarefa de background), threadado adiante na injeção de memory/skills; redirect é o downgrade de modelo a aplicar (enabled + background + modelo com mapeamento diferente), ou null. O handler mantém os efeitos byte-idênticos: log BACKGROUND, mutação de model + body.model, e o audit routing.background_task_redirect. Imports órfãos (getBackgroundDegradationConfig / getBackgroundTaskReason / getDegradedModel) migram para o leaf; logAuditEvent permanece (usado em vários pontos). chatCore.ts 4978->4974 (shrink -4); baseline file-size ratchetado. complexity 1905=1905 (neutro). Coberto por tests/unit/chatcore-background-redirect.test.ts (5 casos via setBackgroundDegradationConfig).
diegosouzapw
force-pushed
the
refactor/qg-chatcore-bgredirect
branch
from
June 21, 2026 17:23
848f333 to
1773868
Compare
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…heaper-inference#4526, cheaper-inference#3501) Rebuilt onto release/v3.8.33 (base was the now-merged cheaper-inference#4511 branch). Integrated into release/v3.8.33.
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.
O quê
6º incremento da decomposição do god-file
chatCore.ts(QG v2 Fase 9 T5, #3501). Move a decisão do Background Task Redirection (T41) do topo dehandleChatCorepara o novo leafopen-sse/handlers/chatCore/backgroundRedirect.ts(resolveBackgroundTaskRedirect).Como (preservação de comportamento)
{ backgroundReason, redirect }:backgroundReason— o sinal de detecção (truthy quando a request parece tarefa de background), threadado adiante na injeção de memory/skills (a const original era reusada na chamada de injeção downstream).redirect— o downgrade de modelo a aplicar (enabled+ background + modelo com mapeamento diferente), ounull.BACKGROUND, a mutação demodel+body.model, e o auditrouting.background_task_redirect.getBackgroundDegradationConfig/getBackgroundTaskReason/getDegradedModel) migram para o leaf;logAuditEventpermanece (usado em vários pontos).A 1ª versão do leaf retornava só o
redirect— mas a suíte completa (chatcore-sanitizationetc., não só o leaf-test) quebrou comReferenceError: backgroundReason is not defined: a constbackgroundReasonoriginal também é consumida mais adiante (injeção de memory/skills), independente do redirect. (Otypecheckpassou apesar disso — provável cache incremental do tsc; foi rodar a suíte inteira que pegou, conforme a regra de auditoria pós-subagente.) Corrigido retornando os dois campos.Gates
chatCore.ts4978→4974 (shrink −4); baseline ratchetado.tests/unit/chatcore-background-redirect.test.ts— 5 casos viasetBackgroundDegradationConfig(disabled no-op, low-max-tokens + header triggers, non-background no-op, modelo sem mapeamento = detecta mas não redireciona).chatcore-imports-cleanly✓ + 158/158 na suíte chatcore (excluído só otranslation-pathsflaky pré-existente).Extração de god-file sem mudança de comportamento em runtime.