Repository navigation
Commit 138b147
committed
fix(extension): drop a caller-supplied viewStates map from setConfiguration
RooCodeApi.setConfiguration takes a whole RooCodeSettings object and writes it at src/extension/api.ts:643
through contextProxy.setValues, which walks past ClineProvider.setValues, and then hands the same object to
providerSettingsManager.saveConfig at :644. The registered viewStates map is host-owned - ClineProvider
rewrites it from a full read of storage (savePersistedViewState, clearPersistedViewState,
prunePersistedViewStates) - so an API caller that handed one in replaced every other view's durable entry in
globalState and in the profile file, and an explicit unset erased it: globalState.update(key, undefined)
deletes, which the repo itself relies on at ContextProxy.ts:173, :280-282, :305 and :346, and the secrets
path deletes explicitly at :464-466. The pre-filter cannot catch the key either:
withoutInvalidDisplaySettings validates timeFormat, dateFormat, showRelativeTimes and language, and states at
displaySettings.ts:14 that any other key is never invalid there. The key is now dropped, with the same
host-ownership rationale the two webview doors use; the rest of the settings object is the caller's to set.
Door inventory for this boundary, so that two guards are not read as a closed boundary:
1. webview message handler - the per-key updateSettings loop wrote contextProxy.setValue directly
(webviewMessageHandler.ts:894) and bypassed setValues; closed at 75add35.
2. ClineProvider.setValues - closed at 75add35; this is also the door the API startNewTask path reaches,
whose configuration goes to provider.createTask at src/extension/api.ts:256.
3. API setConfiguration - the door this commit closes. The read side stays open on purpose:
getConfiguration (:626-629) returns getValues() minus secrets, and reading the registered map is not the
hazard the finding names; a read guard would change what existing callers see for no shown defect.
Test: api-configuration.spec.ts pins that setConfiguration({ viewStates: {...}, soundEnabled: true }) calls
contextProxy.setValues and saveConfig with { soundEnabled: true } only, and logs the ignore. Control: red at
75add35 without the drop - setValues received the crafted map - and green with it.
Lanes at this head: api-configuration 10, api-delegation-events 6, api-delete-queued-message 3,
api-has-task-ui-message-text 8, api-send-message 6, api-start-new-task 6, api-start-task-logging 8,
api-task-conversation-history-length 23, api-terminal-profile 1, api-theme-fixture 2, displaySettings 22,
ClineProvider 475, webviewMessageHandler 175, all passing; src tsc --noEmit exit 0. Compile-job command list
in job order: lint, check-types, code-qa-ci, solheim-smoke check-types, agent-evals unit and check-types,
lifecycle model-check, webview-recovery check-types and model-check and the mcp integration check are green;
format:check is red locally on 2004 files and none of them is touched here (working-tree CRLF, every blob
CR=0, and the touched files re-checked after LF normalisation pass prettier --check), and the two solheim
record.sh suites need ffprobe (absent on this box) and POSIX path separators. ESLint suppressions unchanged
at 3298; neither touched file carries an entry.1 parent 75add35 commit 138b147
2 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
71 | 103 | | |
72 | 104 | | |
73 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
638 | 640 | | |
639 | 641 | | |
640 | 642 | | |
641 | 643 | | |
642 | 644 | | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
643 | 657 | | |
644 | 658 | | |
645 | 659 | | |
| |||
0 commit comments