opencode-translate 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-translate",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "OpenCode plugin that lets the user chat in a configured source language while the main chat loop only sees English.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/activation.ts CHANGED
@@ -257,7 +257,11 @@ async function resolveSessionState(
257
257
  }),
258
258
  )
259
259
  const state = extractStoredState(storedMessages)
260
- sessionStateCache.set(sessionID, state ?? null)
260
+ if (state) {
261
+ sessionStateCache.set(sessionID, state)
262
+ } else if (storedMessages.length > 0) {
263
+ sessionStateCache.set(sessionID, null)
264
+ }
261
265
 
262
266
  return {
263
267
  sessionActive: Boolean(state),
@@ -306,6 +310,8 @@ export function createHooks(ctx: PluginInput, rawOptions: PluginOptions = {}, de
306
310
  }
307
311
  activatedThisTurn = true
308
312
  sessionStateCache.set(input.sessionID, activeState)
313
+ } else {
314
+ sessionStateCache.set(input.sessionID, null)
309
315
  }
310
316
  }
311
317