Repository navigation
feat(compression): wire RTK comment-stripping config + honor preserveDocstrings - #4242
Merged
diegosouzapw merged 1 commit intoJun 19, 2026
Merged
Conversation
…Docstrings codeStripper has always supported removeComments + preserveDocstrings, but both were unreachable: the RTK engine called stripCode with no options (so comments were never removed through the runtime), and preserveDocstrings was folded into opts yet never honored by stripJsTsComments — it removed JSDoc too. - New RtkConfig fields stripCodeComments (default false) + preserveDocstrings (default true), threaded through the Zod schema, DB normalizer, and the applyToCodeBlocks pass in the RTK engine. - stripJsTsComments now keeps `/** ... */` JSDoc block comments when preserveDocstrings is on (skips those ranges). Default stays "preserve" — no silent production change. RTK still only processes tool/assistant messages (shouldCompressMessage), unchanged. Tests: stripCode JSDoc preserve/remove, runtime reachability via applyToCodeBlocks, schema accept, DB round-trip. Full compression suite 703/703 green; typecheck:core + lint + file-size gate clean.
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. |
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…Docstrings (cheaper-inference#4242) Integrated into release/v3.8.29
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.
Cauda longa do programa "compressão 100% funcional" — item 4/6
Problema
codeStrippersempre suportouremoveComments+preserveDocstrings, mas ambos eram inalcançáveis:stripCode(code, language)sem opções → comentários nunca eram removidos pelo runtime, mesmo comapplyToCodeBlocksligado.preserveDocstringsera dobrado emoptsmas nunca honrado porstripJsTsComments— que removia o JSDoc junto.Fix
RtkConfig:stripCodeComments(defaultfalse) +preserveDocstrings(defaulttrue), threaded pelo schema Zod, normalizer de DB e o passapplyToCodeBlocksdo engine.stripJsTsCommentsagora preserva blocos/** ... */(JSDoc) quandopreserveDocstringsestá ligado (pula esses ranges).Não-objetivos (escopo preservado)
tool/assistant(shouldCompressMessage) — não estendi parauser(seria mudança de comportamento, fora do escopo "reachability").Teste (TDD — RED→GREEN, 4 falhas iniciais)
tests/unit/compression/rtk-strip-comments.test.ts:stripCodepreserva JSDoc / remove linha+bloco quandopreserveDocstringson;applyToCodeBlocks+stripCodeCommentsremovem comentários no bloco cercado;stripCodeCommentsoff (default);⭐ Root cause durante o RED: o teste runtime usava role
user(RTK pula → passava trivial); corrigido paraassistant(path suportado), confirmando que o wiring de produção está certo.Validação: suíte de compressão 703/703 ✓ (testes existentes do codeStripper intactos) ·
typecheck:core✓ ·lint✓ ·check:file-size✓