Hide CAD code in chat by default behind CHAMFER_SHOW_CAD_CODE#14
Merged
Conversation
Chat now collapses CAD code bodies (run_build123d tool blocks and python fences in assistant prose) to a label-and-actions row - Copy and Render 3D stay functional. Setting CHAMFER_SHOW_CAD_CODE=1 (or the showCadCode settings override) renders the bodies as before. The flag follows the maxCadRuns plumbing: SettingsDto field, envSettings mapping with junk-value warning, settings store key, GET /api/settings. CONTEXT.md pins the vocabulary (CAD code vs dev-panel script).
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.
Chat now collapses CAD code bodies to a one-line "CAD code" row with Copy and Render 3D still working. Set
CHAMFER_SHOW_CAD_CODE=1(or theshowCadCodesettings override) to render the bodies as before.What changed
run_build123dblock in the tool card and ```python fences in assistant prose, via a sharedCadCodeBlockcomponent. Measurements, verify gate, errors, and the view sheet are untouched.maxCadRuns:SettingsDto.showCadCode,envSettings()mapping (1on,0silently off, junk warns), settings store key,GET /api/settings. No settings-dialog UI yet; the dialog can gain a toggle later with zero protocol change.CONTEXT.mdpins the vocabulary: "CAD code" is the agent-written build123d program, distinct from the dev-panel script.Testing
cad-code-visibility.spec.tsasserts the hidden default (placeholder row, no code text) and the enabled state. The enabled state flips via the settings DB override rather than the env var - restarting the shared e2e server per-env isn't practical; db>env precedence makes it a faithful proxy. Full battery green locally.Validation to eyeball: run a prompt with the flag unset (code collapsed, Copy/Render 3D work) and with
CHAMFER_SHOW_CAD_CODE=1in.env.local(code visible). Codex review (gpt-5.6-sol) came back clean twice.