opencode-completion-gate 1.2.0 → 1.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.0](https://github.com/PauloDevelo/opencode-completion-gate/compare/v1.2.0...v1.3.0) (2026-09-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * 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))
9
+
3
10
  ## [1.2.0](https://github.com/PauloDevelo/opencode-completion-gate/compare/v1.1.1...v1.2.0) (2026-09-06)
4
11
 
5
12
 
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,7 +979,10 @@ 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 }) => {
@@ -1071,10 +1075,11 @@ var plugin = async ({ client }) => {
1071
1075
  throw new Error(applied.notice);
1072
1076
  }
1073
1077
  },
1074
- "chat.message": async ({ sessionID }, output) => {
1078
+ "chat.message": async ({ sessionID, agent }, output) => {
1075
1079
  try {
1076
1080
  const state = sessions.get(sessionID);
1077
1081
  if (!state || state.deleted) return;
1082
+ if (typeof agent === "string" && agent.trim() !== "") state.currentAgent = agent;
1078
1083
  if (!Array.isArray(output?.parts) || output.parts.length === 0) return;
1079
1084
  const textPart = output.parts.find((p) => p?.type === "text");
1080
1085
  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.0",
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",