@codemcp/workflows-opencode 6.6.0 → 6.6.1

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -3
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -28358,6 +28358,7 @@ var WorkflowsPlugin = async (input) => {
28358
28358
  let cachedServerContext = null;
28359
28359
  let serverContextInitialized = false;
28360
28360
  let currentSessionId = null;
28361
+ let lastKnownSessionId = null;
28361
28362
  let bufferedInstructions = null;
28362
28363
  function setBufferedInstructions(result) {
28363
28364
  bufferedInstructions = {
@@ -28368,6 +28369,15 @@ var WorkflowsPlugin = async (input) => {
28368
28369
  };
28369
28370
  }
28370
28371
  async function getServerContext() {
28372
+ if (currentSessionId && currentSessionId !== lastKnownSessionId) {
28373
+ logger37.debug("Session ID changed, invalidating cached ServerContext", {
28374
+ oldSessionId: lastKnownSessionId,
28375
+ newSessionId: currentSessionId
28376
+ });
28377
+ cachedServerContext = null;
28378
+ serverContextInitialized = false;
28379
+ lastKnownSessionId = currentSessionId;
28380
+ }
28371
28381
  if (!cachedServerContext) {
28372
28382
  const sessionMetadata = currentSessionId ? {
28373
28383
  referenceId: currentSessionId,
@@ -28427,9 +28437,20 @@ var WorkflowsPlugin = async (input) => {
28427
28437
  * We add a synthetic part with phase instructions.
28428
28438
  */
28429
28439
  "chat.message": async (hookInput, output) => {
28430
- if (hookInput.sessionID && !currentSessionId) {
28431
- currentSessionId = hookInput.sessionID;
28432
- logger37.debug("Captured session ID", { sessionId: currentSessionId });
28440
+ if (hookInput.sessionID) {
28441
+ if (!currentSessionId) {
28442
+ currentSessionId = hookInput.sessionID;
28443
+ lastKnownSessionId = hookInput.sessionID;
28444
+ logger37.debug("Captured initial session ID", {
28445
+ sessionId: currentSessionId
28446
+ });
28447
+ } else if (currentSessionId !== hookInput.sessionID) {
28448
+ currentSessionId = hookInput.sessionID;
28449
+ logger37.info("Session ID changed", {
28450
+ oldSessionId: lastKnownSessionId,
28451
+ newSessionId: currentSessionId
28452
+ });
28453
+ }
28433
28454
  }
28434
28455
  if (!workflowsEnabled) {
28435
28456
  logger37.debug("chat.message: Workflows disabled, skipping hook");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-opencode",
3
- "version": "6.6.0",
3
+ "version": "6.6.1",
4
4
  "description": "OpenCode plugin for structured development workflows",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,8 +19,8 @@
19
19
  "rimraf": "^6.0.1",
20
20
  "tsup": "^8.0.0",
21
21
  "vitest": "4.0.18",
22
- "@codemcp/workflows-server": "6.6.0",
23
- "@codemcp/workflows-core": "6.6.0"
22
+ "@codemcp/workflows-core": "6.6.1",
23
+ "@codemcp/workflows-server": "6.6.1"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@anthropic-ai/sdk": "*"