aboutsummaryrefslogtreecommitdiff
path: root/src/integration/assets/opencode/herdr-agent-state.js
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-11 16:13:17 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-11 16:13:17 +0300
commit55cdf2e8f8af2dd3feebb4bb7d44c9cb7e23b384 (patch)
tree91feb43a39812d63e19fc5068f95dbe0c896e118 /src/integration/assets/opencode/herdr-agent-state.js
parente201a647635905a5141bfce335619b0e232b396d (diff)
fix: stabilize integration agent state reports
Diffstat (limited to 'src/integration/assets/opencode/herdr-agent-state.js')
-rw-r--r--src/integration/assets/opencode/herdr-agent-state.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/integration/assets/opencode/herdr-agent-state.js b/src/integration/assets/opencode/herdr-agent-state.js
index 6d5e3c87..0fb96217 100644
--- a/src/integration/assets/opencode/herdr-agent-state.js
+++ b/src/integration/assets/opencode/herdr-agent-state.js
@@ -1,6 +1,17 @@
+// installed by herdr
+// safe to edit. this plugin only activates inside herdr-managed panes.
+// HERDR_INTEGRATION_ID=opencode
+// HERDR_INTEGRATION_VERSION=1
+
import net from "node:net";
const SOURCE = "herdr:opencode";
+let reportSeq = Date.now() * 1000;
+
+function nextReportSeq() {
+ reportSeq += 1;
+ return reportSeq;
+}
function reportState(action) {
const paneId = process.env.HERDR_PANE_ID;
@@ -22,12 +33,14 @@ function reportState(action) {
pane_id: paneId,
source: SOURCE,
agent: "opencode",
+ seq: nextReportSeq(),
}
: {
pane_id: paneId,
source: SOURCE,
agent: "opencode",
state: action,
+ seq: nextReportSeq(),
},
};