fix(config): hint at removed fields instead of re-adding them - #4177
fix(config): hint at removed fields instead of re-adding them#4177aheritier wants to merge 1 commit into
Conversation
safer was intentionally dropped from the shell toolset in config v15 (PR #4169); a version-less config (the default/latest schema for ~17 releases) that still sets safer: true now fails to load with an unhelpful 'unknown field "safer"' error. Add removedFieldHint, which fires when newerVersionHint declines: it walks older config versions' schemas (derived by reflecting over each version's zero-value Config) and, if the unknown field used to be valid in one of them, tells the user to delete it rather than suggest lowering the top-level 'version' field. No behavior change: safer (and any other removed field) is still rejected. Documents the safer removal as a breaking change in CHANGELOG.md and corrects stale docs/tools/shell and docs/configuration/overview references. Fixes part 1 of #4175
|
🤖 Automated implementer agent — this comment was posted by the implementer bot from Docker Agentic Platform, not by a human developer Re: the earlier comment on CHANGELOG.md:10 ("CHANGELOG should never be manually modified, it's automatically generated") — that comment appears to have been retracted, but replying here for the record since the original inline thread is no longer reachable. This edit adds a retroactive breaking-change note under the existing, already-released |
🤖 Automated implementer agent — this comment was posted by the implementer bot from Docker Agentic Platform, not by a human developer
Fixes part 1 of #4175.
saferwas intentionally removed from the shell toolset in config v15 (#4169) — it had been a documented no-op since v1.117.0, superseded by session-wide safety modes. It stays removed here: this PR does not re-add it anywhere.The problem: v15 was the default/latest schema for ~17 releases, so any version-less config still carrying
safer: truenow fails to load with a bareunknown field "safer"and no guidance.Changes
removedFieldHintinpkg/config, wired intoLoadas a fallback to the existingnewerVersionHint. It derives each config version's field set by reflecting over the zero value its parser produces, and — when an unknown-field error names a key that used to be valid in an older version — tells the user to delete it, instead of implying aversion:downgrade would help.Load()pipeline.CHANGELOG.md: documents the breaking behavior (hard rejection ofsafer) under the existing[v1.133.0]entry.saferwording indocs/tools/shell/index.mdand a staleversion: 15reference indocs/configuration/overview/index.md(bumped to 16, with the new hint documented alongside the existing one).No
pkg/config/v0..v15(frozen) package was touched, andagent-schema.jsonhad no lingeringsaferreference to fix.Testing
go build ./...,go test ./...,golangci-lint run ./...,go run ./lint .,go mod tidy --diffall pass. The only test failure (pkg/rag/treesitter, needs CGO/gcc) is a pre-existing sandbox limitation unrelated to this change, reproduced identically on unmodifiedmain.Reviewed by the reviewer sub-agent (verdict: approve); one medium finding (untagged struct fields falling back to lowercase Go name in go-yaml, not mirrored by the reflection helper) was fixed before this push, along with a minor CHANGELOG redundancy.