opencode-completion-gate 1.2.0 → 1.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.1](https://github.com/PauloDevelo/opencode-completion-gate/compare/v1.3.0...v1.3.1) (2026-09-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * honor bootstrap retry override before session creation ([#10](https://github.com/PauloDevelo/opencode-completion-gate/issues/10)) ([8cccd1e](https://github.com/PauloDevelo/opencode-completion-gate/commit/8cccd1ede29ead0325c18f6923e22d920353615d))
9
+
10
+ ## [1.3.0](https://github.com/PauloDevelo/opencode-completion-gate/compare/v1.2.0...v1.3.0) (2026-09-09)
11
+
12
+
13
+ ### Features
14
+
15
+ * preserve active agent after feedback in completion gate ([#8](https://github.com/PauloDevelo/opencode-completion-gate/issues/8)) ([77814c9](https://github.com/PauloDevelo/opencode-completion-gate/commit/77814c98685e9babc8a30d413b81ebac8781a8a9))
16
+
3
17
  ## [1.2.0](https://github.com/PauloDevelo/opencode-completion-gate/compare/v1.1.1...v1.2.0) (2026-09-06)
4
18
 
5
19
 
package/README.md CHANGED
@@ -55,3 +55,12 @@ Config lives per project at `<project-root>/.opencode/completion-gate.json` (re-
55
55
  ```
56
56
 
57
57
  Assertion types: `command`, `ado-pr`, `opencode-review`. See [completion-gate-plugin.md](completion-gate-plugin.md) for the full schema, ADO PR polling, review sessions, diagnostics (`gate-diag.log`), and troubleshooting.
58
+
59
+ Orchestration launchers can arm the first session without a chat message by
60
+ setting `OPENCODE_GATE_BOOTSTRAP_COMMAND_B64` (or
61
+ `OPENCODE_GATE_BOOTSTRAP_COMMAND`) and optionally
62
+ `OPENCODE_GATE_BOOTSTRAP_MAX_RETRIES`. The retry override is honored for
63
+ command-only bootstrap sessions and takes precedence over the project's
64
+ `maxRetries`; combined mode uses the project value. Bootstrap settings are
65
+ captured during plugin initialization, with a fallback read when the first
66
+ session is created, and are consumed once.
package/dist/plugin.js CHANGED
@@ -940,6 +940,7 @@ async function runGateTurnEnd(client, state) {
940
940
  await client.session.promptAsync({
941
941
  path: { id: state.sessionID },
942
942
  body: {
943
+ ...state.currentAgent ? { agent: state.currentAgent } : {},
943
944
  parts: [
944
945
  {
945
946
  type: "text",
@@ -978,10 +979,15 @@ async function runGateTurnEnd(client, state) {
978
979
  );
979
980
  await client.session.promptAsync({
980
981
  path: { id: state.sessionID },
981
- body: { parts: [{ type: "text", text: injectFailureText(state, last, cap.value) }] }
982
+ body: {
983
+ ...state.currentAgent ? { agent: state.currentAgent } : {},
984
+ parts: [{ type: "text", text: injectFailureText(state, last, cap.value) }]
985
+ }
982
986
  }).catch((err) => logDiag(`retry prompt error: ${describeSdkError(err)}`));
983
987
  }
984
988
  var plugin = async ({ client }) => {
989
+ let pendingBootstrap = readBootstrapGateCommand();
990
+ if (pendingBootstrap) consumeBootstrapGateCommand();
985
991
  return {
986
992
  event: async ({ event }) => {
987
993
  try {
@@ -1013,7 +1019,8 @@ var plugin = async ({ client }) => {
1013
1019
  const created = createGateSessionState(validated.sessionID, validated.directory);
1014
1020
  sessions.set(created.sessionID, created);
1015
1021
  logDiag(`registered session ${created.sessionID} (${created.directory})`);
1016
- const bootstrap = readBootstrapGateCommand();
1022
+ const bootstrap = pendingBootstrap ?? readBootstrapGateCommand();
1023
+ pendingBootstrap = null;
1017
1024
  if (bootstrap) {
1018
1025
  consumeBootstrapGateCommand();
1019
1026
  created.extraCommand = bootstrap.command;
@@ -1071,10 +1078,11 @@ var plugin = async ({ client }) => {
1071
1078
  throw new Error(applied.notice);
1072
1079
  }
1073
1080
  },
1074
- "chat.message": async ({ sessionID }, output) => {
1081
+ "chat.message": async ({ sessionID, agent }, output) => {
1075
1082
  try {
1076
1083
  const state = sessions.get(sessionID);
1077
1084
  if (!state || state.deleted) return;
1085
+ if (typeof agent === "string" && agent.trim() !== "") state.currentAgent = agent;
1078
1086
  if (!Array.isArray(output?.parts) || output.parts.length === 0) return;
1079
1087
  const textPart = output.parts.find((p) => p?.type === "text");
1080
1088
  if (!textPart) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-completion-gate",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "OpenCode plugin: per-session quality gate that blocks declaring done until configured assertions pass",
5
5
  "type": "module",
6
6
  "main": "dist/plugin.js",