Skip to content

fix(compression): honor the Auto-Clarity toggle on the output-styles path - #14551

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
woodsonl:fix/output-styles-auto-clarity
Sep 24, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
woodsonl:fix/output-styles-auto-clarity

Conversation

@woodsonl

@woodsonl woodsonl commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #14547, #14496

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 in applyCavemanOutputMode (outputMode.ts:183), and chatCore stopped calling that function in #4694 (Phase 4A, shipped in v3.8.35). chatCore shapes output through applyOutputStyles, which calls shouldBypassCavemanOutputMode unconditionally (outputStyles/apply.ts:176 on the base).

So with Auto-Clarity off, a turn that mentions a credential leak or a DROP TABLE still drops every selected style.

The fix

  • outputStyles/apply.ts: applyOutputStyles takes { autoClarity } and runs the content bypass unless it is false, the same test as outputMode.ts:183.
  • handlers/chatCore.ts: passes config.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) mapping cavemanOutputMode to terse-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 at outputMode.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 chat messages bodies.

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 boundaries lets it set its own carve-out? That would be an autoClarity?: boolean on OutputStyle (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: false keeps both selected styles on a security-topic turn. On the base code r.applied comes back false. With only the guard line replaced by if (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.
  • The mirror case, Auto-Clarity on keeping the styles off that turn, passes on both, and fails when chatCore passes a hard-coded false.
node --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts \
  --test --test-force-exit --test-concurrency=1 --test-name-pattern="security-topic turn" \
  tests/integration/chatcore-compression-integration.test.ts

On this branch:

Check Result
npm run test:unit 42,208 pass, 27 skipped, 33 fail of 42,268. All 33 failures are inherited (below). Dashboard stage 129/129, serial stage 23/23.
npm run test:vitest pass
npm run typecheck:core clean
npm run check:open-sse-typecheck the open-sse/executors/auggie.ts errors #14496 lists; the files this PR touches are clean
npm run lint exits 2 on "There are suppressions left that do not occur anymore", as on the base; 0 problems with --pass-on-unpruned-suppressions
output-style unit files 67/67: the base's 66 plus the new case
chatcore-compression-integration.test.ts 11 pass, 1 skipped, 3 fail of 15; the 3 are the inherited messages[0] tests

Inherited from the base tip ea3c12264b, reproduced on a clean checkout of it:

…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.
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Verified the gate matches outputMode.ts:183's existing config.autoClarity !== false
pattern exactly — this isn't new logic, just applying the same rule the sibling injector
already uses. Ran the full compression + integration suites at your HEAD: 32 pass, 3 fail,
1 skip. The 3 failures are pre-existing and unrelated to your diff — I confirmed by running
the same unmodified test file directly against the release/v3.8.51 tip and got the identical
3 failures (a base-red from #12584/#13383's placeSystemInstruction rewrite that a few old
tests never caught up with). Your new Auto-Clarity tests are all green. Merge-ready.

@diegosouzapw
diegosouzapw merged commit 8fc648b into cheaper-inference:release/v3.8.51 Sep 24, 2026
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
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