Skip to content

Honor spec-style daemon and cache config keys#35

Merged
CoreyRDean merged 1 commit into
mainfrom
align/sectioned-config-keys
May 21, 2026
Merged

Honor spec-style daemon and cache config keys#35
CoreyRDean merged 1 commit into
mainfrom
align/sectioned-config-keys

Conversation

@CoreyRDean
Copy link
Copy Markdown
Owner

Non-technical summary

intent now honors the daemon/cache config keys exactly where the spec says they live, so users can edit config.toml with sectioned TOML keys and have those settings actually take effect. This matters now because the previous behavior silently ignored spec-shaped keys like [daemon] enabled = false, which turns a valid-looking config edit into a no-op.

Technical summary

  • taught internal/config to parse both legacy flat aliases (daemon_enabled, cache_enabled) and spec-style sectioned keys (daemon.enabled, cache.enabled plus daemon.idle_unload_after)
  • updated config writing to emit spec-style dotted section keys for the known daemon/cache settings while still preserving unknown raw keys
  • extended i config get/set known-key handling so daemon.enabled, daemon.idle_unload_after, and cache.enabled round-trip through the CLI instead of only through raw file edits
  • added config tests covering sectioned TOML reads, legacy alias compatibility, and emitted config shape
  • added a CLI smoke test proving config set/get daemon.enabled persists the spec-style key end to end
  • validation: go test ./internal/config/... ./internal/cli/..., go test ./..., go vet ./..., make build
  • breaking changes: none intended; legacy flat aliases remain readable for compatibility

Additional notes

Trade-off: generated config now uses dotted TOML keys (daemon.enabled = false) rather than the older underscore aliases, which is semantically equivalent to the sectioned TOML shown in the spec and keeps the file machine-editable without widening this change into a broader config-format rewrite.

Deferred: I did not normalize every raw dotted key into explicit TOML table blocks; the only goal here was to close the spec/implementation gap for the known daemon/cache settings without risking unrelated config churn.

@CoreyRDean CoreyRDean marked this pull request as ready for review May 21, 2026 13:16
@CoreyRDean CoreyRDean merged commit a22fe78 into main May 21, 2026
8 checks passed
@CoreyRDean CoreyRDean deleted the align/sectioned-config-keys branch May 21, 2026 13:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff13365bcf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cli/config.go
Comment on lines +136 to +137
if d, err := time.ParseDuration(value); err == nil {
c.DaemonIdleUnloadAfter = d
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject invalid daemon idle_unload_after values

i config set daemon.idle_unload_after <value> now treats this key as known, but an invalid duration is silently ignored because parse errors are dropped. In that case the command still exits successfully, and config.Write persists the previous value for this known field, so users think the setting was applied when it was not. This is a behavior regression for the newly supported key and should return a validation error (or otherwise surface failure) when time.ParseDuration fails.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant