Problem
Parallel mode in Roo Code lacks a durable per-view state foundation. When multiple webview instances run simultaneously (parallel tabs), there is no mechanism to:
- Assign stable identities to each view instance
- Persist non-secret selection state (
mode, currentApiConfigName) across reloads
- Merge global and per-view state in the
getState() layer
- Maintain a stable webview state ID for persistence lookups
This is the root mechanism that old Issue #908 identified, and was partially addressed by PR #909 but lacked proper per-view isolation.
Solution
Introduce a registered global setting key viewStates in globalSettingsSchema that stores only non-secret selection state:
mode: current parallel mode
currentApiConfigName: selected API configuration name (not full secrets)
updatedAt: timestamp for bounded cleanup (keep most recent 50 entries)
This fixes the limitation from Issue #967 where persistence relied on scattered dynamic __view_state_* keys. Now all per-view state is properly registered in GLOBAL_STATE_KEYS, loaded via ContextProxy.initialize(), and hydrated through loadViewState() which resolves profile settings via ProviderSettingsManager.getProfile().
Scope
- Per-view identity with stable webview state ID plumbing
viewLocalState buffer for transient per-view data
getState() merge layer combining global + view-local state
- Durable
viewStates persistence in registered global settings
- No-op compatibility: existing single-tab behavior unchanged
Tests
Targeted tests passed. Full core run: 129 files passed / 2184 passed / 9 skipped.
Notes
Problem
Parallel mode in Roo Code lacks a durable per-view state foundation. When multiple webview instances run simultaneously (parallel tabs), there is no mechanism to:
mode,currentApiConfigName) across reloadsgetState()layerThis is the root mechanism that old Issue #908 identified, and was partially addressed by PR #909 but lacked proper per-view isolation.
Solution
Introduce a registered global setting key
viewStatesinglobalSettingsSchemathat stores only non-secret selection state:mode: current parallel modecurrentApiConfigName: selected API configuration name (not full secrets)updatedAt: timestamp for bounded cleanup (keep most recent 50 entries)This fixes the limitation from Issue #967 where persistence relied on scattered dynamic
__view_state_*keys. Now all per-view state is properly registered inGLOBAL_STATE_KEYS, loaded viaContextProxy.initialize(), and hydrated throughloadViewState()which resolves profile settings viaProviderSettingsManager.getProfile().Scope
viewLocalStatebuffer for transient per-view datagetState()merge layer combining global + view-local stateviewStatespersistence in registered global settingsTests
Targeted tests passed. Full core run: 129 files passed / 2184 passed / 9 skipped.
Notes
apiConfigurationor API keys are stored inviewStates— only non-secret selections