Repository navigation
fix(config): honor the watch key in TOML config - #6
Merged
Merged
Conversation
`watch = true` in `.dunk/config.toml` (or the global config) was silently ignored: `readConfigPreferences` never read `source.watch`, and the final per-invocation override forced `watch: input.options.watch ?? false`, discarding any config-layer value. Read `watch` like the other booleans and fall back to the resolved config value when no `--watch` flag is given (`input.options.watch ?? resolvedOptions.watch ?? false`). The CLI still wins; layer precedence (repo over global) is preserved via the existing `mergeOptions` path. Backports modem-dev/hunk#279, adapted to dunk (no `vcs` field). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
amix
marked this pull request as ready for review
May 16, 2026 19:36
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.
Context
Backport of modem-dev/hunk#279. PR 2 of an expert-gated backport series.
watch = truein.dunk/config.toml(or~/.config/dunk/config.toml) was silently ignored.readConfigPreferencesnever readsource.watch, and the final per-invocation override forcedwatch: input.options.watch ?? false, discarding any config-layer value — so the only way to get watch mode was passing--watchevery time.What was changed
readConfigPreferencesreadswatch: normalizeBoolean(source.watch)— same pattern as the other booleans, returnsundefinedwhen absent somergeOptionspreserves layer precedence.input.options.watch ?? resolvedOptions.watch ?? false: CLI--watchstill wins, absence of it defers to the resolved config value.watchkey; CHANGELOG### Addedentry.vcsfield).Expert-reviewed: full resolution pipeline traced across all four precedence cases, verdict "correct, ship it"; incorporated the recommended repo-over-global test sub-case.
Verification
bun run typecheck,bun run lint: clean.config.test.ts: 7 pass. New case asserts: configtrue→ watched; CLI--watchover configfalse→ watched; no config → false; repo configfalseover global configtrue→ false (layer precedence).src/coresuite: 171 pass.🤖 Generated with Claude Code