Skip to content

Commit 04406a8

Browse files
committed
Bugfix for PR (This code will make roo save nothing, and make vscode.ExtensionContext wasted)
1 parent 89c5d87 commit 04406a8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/core/contextProxy.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,18 @@ export class ContextProxy {
141141
for (const key of GLOBAL_STATE_KEYS) {
142142
try {
143143
if (this.isWindowSpecificKey(key)) {
144-
// For window-specific keys, get the value using the window-specific key
144+
// For window-specific keys, first try to get the value using the window-specific key
145145
const windowKey = this.getWindowSpecificKey(key)
146-
const value = this.originalContext.globalState.get(windowKey)
146+
let value = this.originalContext.globalState.get(windowKey)
147+
148+
// If no window-specific value exists, try to get a global value as fallback
149+
if (value === undefined) {
150+
value = this.originalContext.globalState.get(key)
151+
logger.debug(
152+
`No window-specific value found for ${windowKey}, using global value for ${key}: ${value}`,
153+
)
154+
}
155+
147156
this.stateCache.set(key, value)
148157
logger.debug(`Loaded window-specific key ${key} as ${windowKey} with value: ${value}`)
149158
} else {

0 commit comments

Comments
 (0)