Repository navigation
fix(compression): honor the Auto-Clarity toggle on the output-styles path - #14551
Merged
diegosouzapw merged 2 commits intoSep 24, 2026
Conversation
…path The dashboard stores cavemanOutputMode.autoClarity and shows it on two settings pages. The only code that reads it is the gate in applyCavemanOutputMode, which chatCore stopped calling in cheaper-inference#4694 (v3.8.35). applyOutputStyles, the path chatCore uses, runs shouldBypassCavemanOutputMode unconditionally, so with Auto-Clarity off a security, irreversible-action, clarification, or order-sensitive turn still dropped every selected style. applyOutputStyles takes { autoClarity } and skips the content bypass when it is false, the same test outputMode.ts applies; chatCore passes the stored toggle. The default is on, so installs that leave the toggle alone keep today's behavior.
Changelog entry for the Auto-Clarity toggle fix on the output-styles path, named by PR number per changelog.d/README.md.
This was referenced Sep 22, 2026
Collaborator
|
Verified the gate matches |
diegosouzapw
merged commit Sep 24, 2026
8fc648b
into
cheaper-inference:release/v3.8.51
9 of 16 checks passed
diegosouzapw
added a commit
that referenced
this pull request
Sep 24, 2026
… ceilings and stryker coverage The release tip crossed eight frozen file-size ceilings and one new test file (#14551) passed the 1200 test cap; four new covering tests were missing from stryker tap.testFiles. Documented rebaseline entries carry the measured sizes and the PRs that grew each file; nothing in this commit changes behavior. Refs #14496
This was referenced Sep 30, 2026
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.
Summary
This PR connects the dashboard's Auto-Clarity Bypass toggle to the output-styles path. With the toggle on, which is the default, every style keeps its content bypass. With it off, the selected styles stay in the system prompt on security, irreversible-action, clarification, and order-sensitive turns.
Installs that already turned the toggle off get that behavior once this lands. Their stored setting has gone unread since v3.8.35.
This is Defect 3 from #13938, split into its own PR.
The defect
Two dashboard pages show the toggle and save it to
cavemanOutputMode.autoClarity(CompressionSettingsTab.tsx:577,CavemanContextPageClient.tsx:258). The only code that reads it is the gate inapplyCavemanOutputMode(outputMode.ts:183), andchatCorestopped calling that function in #4694 (Phase 4A, shipped in v3.8.35).chatCoreshapes output throughapplyOutputStyles, which callsshouldBypassCavemanOutputModeunconditionally (outputStyles/apply.ts:176on the base).So with Auto-Clarity off, a turn that mentions a credential leak or a
DROP TABLEstill drops every selected style.The fix
outputStyles/apply.ts:applyOutputStylestakes{ autoClarity }and runs the content bypass unless it isfalse, the same test asoutputMode.ts:183.handlers/chatCore.ts: passesconfig.cavemanOutputMode?.autoClarity, and its comment says where the toggle comes from.One switch covers every style on the path, whether the selection comes from the Output Styles panel or from the back-compat shim (
outputStyles/backCompat.ts) mappingcavemanOutputModetoterse-prose. The switch sits on the settings tab under the caveman output-mode heading, and on the caveman context page. The fix reads the setting the dashboard already stores.With the toggle off, every injection ends with the shared boundary clause (
apply.ts:140, defined atoutputMode.ts:28): "Security warnings, irreversible action confirmations, multi-step ordered sequences: write normal." Turning Auto-Clarity off replaces the hard skip with that instruction.Responses-API bodies (
instructions,input) take the styles unconditionally on both injectors (apply.ts:144-163,outputMode.ts:151-169), so the toggle governs chatmessagesbodies.One question for you
The bypass applies to all selected styles at once, and it came from the caveman prose mode. Should a style be able to set its own Auto-Clarity, the way
boundarieslets it set its own carve-out? That would be anautoClarity?: booleanonOutputStyle(outputStyles/catalog.ts:9). Which styles keep the bypass is a product call, so it's yours. If you want it, I'll send it as a follow-up.Testing
The Auto-Clarity-off cases fail against the base code and pass with the fix:
tests/unit/compression/output-styles-apply.test.ts:autoClarity: falsekeeps both selected styles on a security-topic turn. On the base coder.appliedcomes backfalse. With only the guard line replaced byif (true), it fails again, so the guard is what makes it pass.tests/integration/chatcore-compression-integration.test.ts: with Auto-Clarity off in the stored settings, a security-topic request reaches the upstream carrying the output-style instruction, through the legacy caveman switch and with styles picked in the Output Styles panel. On the base code the instruction stays out of the upstream request in both cases.chatCorepasses a hard-codedfalse.On this branch:
npm run test:unitnpm run test:vitestnpm run typecheck:corenpm run check:open-sse-typecheckopen-sse/executors/auggie.tserrors #14496 lists; the files this PR touches are cleannpm run lint--pass-on-unpruned-suppressionschatcore-compression-integration.test.tsmessages[0]testsInherited from the base tip
ea3c12264b, reproduced on a clean checkout of it:api/v1/relay-completions-errors,binaryManager,call-log-file-rotation,check-deps,check-env-doc-sync,hard-session-lease-bypass-inventory,issue-7793-env-doc-sync-repro,models-catalog-route,runner-janitor,server-owned-tool-loop-flag,services/portProbePid,uc-video;lib/warmupScheduler/circuitBreakerFactory*files, which hang there ("Promise resolution is still pending but the event loop has already resolved");chatcore-compression-integration.test.tsthat expect the output-style instruction atmessages[0]; fix(compression): place output-style instruction in top-level system, not messages[0] #13383 moved it to a trailing system message.