@codemcp/workflows-opencode 6.11.1 → 6.12.0

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 (3) hide show
  1. package/README.md +12 -0
  2. package/dist/index.js +19 -11
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -90,6 +90,18 @@ When the env var is set, workflow hooks are skipped and tools throw a clear erro
90
90
 
91
91
  **When unset**, workflows are active for all agents (default behavior).
92
92
 
93
+ ### Auto-Compaction
94
+
95
+ When transitioning to a new phase via `proceed_to_phase`, the plugin automatically triggers a session compaction (summarize) to clear prior-phase context from the LLM window. This is enabled by default.
96
+
97
+ Set `WORKFLOW_AUTO_COMPACT=false` to disable this behavior:
98
+
99
+ ```bash
100
+ WORKFLOW_AUTO_COMPACT=false npx opencode
101
+ ```
102
+
103
+ **When unset or any value other than `false`**, compaction runs on every successful phase transition (default behavior).
104
+
93
105
  ### Per-Agent Behavior
94
106
 
95
107
  - **Agent in filter**: Workflow instructions are injected on every message, tools work normally
package/dist/index.js CHANGED
@@ -28202,17 +28202,25 @@ function createProceedToPhaseTool(getServerContext, setBufferedInstructions, cli
28202
28202
  plan_file_path: data.plan_file_path,
28203
28203
  allowed_file_patterns: data.allowed_file_patterns
28204
28204
  });
28205
- const model = getModel();
28206
- client.session.summarize({
28207
- path: { id: context.sessionID },
28208
- ...model ? { body: model } : {}
28209
- }).catch(() => {
28210
- });
28211
- logger37.info("Triggered compaction after phase transition", {
28212
- phase: data.phase,
28213
- sessionID: context.sessionID,
28214
- hasModel: !!model
28215
- });
28205
+ const autoCompact = process.env["WORKFLOW_AUTO_COMPACT"]?.trim()?.toLowerCase();
28206
+ if (autoCompact !== "false") {
28207
+ const model = getModel();
28208
+ client.session.summarize({
28209
+ path: { id: context.sessionID },
28210
+ ...model ? { body: model } : {}
28211
+ }).catch(() => {
28212
+ });
28213
+ logger37.info("Triggered compaction after phase transition", {
28214
+ phase: data.phase,
28215
+ sessionID: context.sessionID,
28216
+ hasModel: !!model
28217
+ });
28218
+ } else {
28219
+ logger37.debug("Skipped compaction: WORKFLOW_AUTO_COMPACT=false", {
28220
+ phase: data.phase,
28221
+ sessionID: context.sessionID
28222
+ });
28223
+ }
28216
28224
  const lines = [];
28217
28225
  lines.push(`Transitioned to: ${data.phase}`);
28218
28226
  if (data.transition_reason) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-opencode",
3
- "version": "6.11.1",
3
+ "version": "6.12.0",
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.11.1",
23
- "@codemcp/workflows-core": "6.11.1"
22
+ "@codemcp/workflows-core": "6.12.0",
23
+ "@codemcp/workflows-server": "6.12.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@anthropic-ai/sdk": "*"