-
Notifications
You must be signed in to change notification settings - Fork 3
Config hot reload #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PATCH /config hot-reload w/ selective cache invalidation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| fetching = false | ||
| }) | ||
| } | ||
| refresh(cache) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Cache Corruption from Incomplete Updates
The refresh function passes the shared cache object directly to fetchEntries, which mutates it in-place by pushing files and directories. If fetchEntries fails partway through (e.g., due to file system errors), the cache is left in a partially-updated state, and subsequent code treats it as complete because the error is caught and fetching is set to false. The cache should be built in a temporary object and only assigned to cache on success.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@kcrommett I've opened a new pull request, #18, to work on those changes. Once the pull request is ready, I'll request review from you. |
Note
Introduces config hot-reload with PATCH /config, diff-based targeted invalidation, JSONC-preserving persistence with locking/backups, and migrates subsystems to a named state registry; adds plugin path handling, tests, and specs.
Config.Event.Updated; implement diff-based invalidation (config/invalidation.ts) targetingprovider,mcp,lsp,plugin,tool-registry,permission,command/agent/format,theme/instructions.persist.ts): file locking, backups, atomic writes, JSONC-preserving incremental edits, global/project scopes, and diffs for publish; new error types.plugin/*, and add global config file resolver.State.register("config"); addreadFreshConfig.PATCH /configwithscopeparam; return merged config; publish update events; enrich TUI toast messages; add spec (specs/config-spec.md).State.registerandState.invalidate(by name/key, wildcard); addInstance.invalidateandInstance.forEach; bootstrap subscribes to config updates.agent,command,provider,lsp,mcp,permission,plugin,format,filewatcher,tool/registry,filecache refresh tweaks.Written by Cursor Bugbot for commit 410fd58. This will update automatically on new commits. Configure here.