refactor(config): rename thinking to effort with struct-tag deprecation framework#897
Merged
cpcloud merged 4 commits intomicasa-dev:mainfrom Apr 2, 2026
Merged
Conversation
Design for struct-tag-driven config key deprecation: a `deprecated`
struct tag on the new field is the single source of truth. A shared
Deprecations() function walks Config{} via reflection; init() derives
removedKeys and deprecatedEnvVars maps. A code generator produces Hugo
data for docs. First use case: rename `thinking` to `effort`.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…on framework
Add a struct-tag-driven deprecation system: a `deprecated` tag on the
new config field declares the old TOML key name. A shared Deprecations()
function walks Config{} via reflection; package-level var initialization
derives removedKeys and deprecatedEnvVars maps from it. Both TOML and
env var paths produce hard errors pointing to the replacement.
- Rename Thinking to Effort in ChatLLM, ExtractionLLM, llm.Client,
app types, and CLI wiring
- Add deprecated:"thinking" tags to both Effort fields
- Migrate cache_ttl_days removal onto the same framework with
deprecated:"cache_ttl_days" and deprecated_transform:"days_to_duration"
- Remove hand-maintained removedKeys map from validate.go
- Remove empty deprecatedPaths map and rendering logic from show.go
- Add checkDeprecatedEnvVars() pre-scan before canonical env overrides
- Comprehensive tests: tag walker, env var detection, deterministic
ordering, panic paths, wire-level reasoning_effort assertion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rename in docs
- gendeprecations walks Config struct tags and writes
docs/data/deprecations.json with old/new paths and transform hints
- {{< replaces >}} Hugo shortcode renders inline badges from hugo.Data
with old key name, deprecated env var, and optional transform hint
- Replace thinking with effort + replaces badge in chat.llm and
extraction.llm config tables
- Replace hard-coded cache_ttl_days deprecation text with shortcode
- Extend go-generate-check to cover internal/config and the JSON output
- Add docs/data/*.json to biome includes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a655e7f to
945cd98
Compare
Procedural checklist for deprecating config keys using the struct-tag framework: add deprecated tag, update ExampleTOML, regenerate docs data, add Hugo shortcode, update references and tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
deprecatedtag on the new field is the single source of truth, runtimeinit()derives error maps via reflectionthinkingtoeffortin both LLM pipeline configs (ChatLLM,ExtractionLLM), the LLM client, app layer, and CLI wiringcache_ttl_daysremoval onto the same framework withdeprecated_transformhint supportcheckDeprecatedEnvVars()pre-scan with deterministic ordering, transform hints, and validation (duplicate paths, env var collisions)gendeprecationscode generator producingdocs/data/deprecations.jsonfrom struct tags{{< replaces >}}Hugo shortcode rendering inline deprecation badges with old key name, env var, and optional transform hintgo-generate-checkpre-push hook to coverinternal/config/and the generated JSONremovedKeysanddeprecatedPathsmaps