the runtime your coding agents live on
Rust agentagent-orchestrationaiai-agentsclaude-codeclicodexcoding-agentsdeveloper-toolsdevtoolsmultiplexerrustterminalterminal-multiplexerterminal-uitmuxtuiworkspace-manager
fix: preserve opencode working state
Ogulcan Celik6b9b092228a6
diff --git a/docs/next/CHANGELOG.md b/docs/next/CHANGELOG.mdindex 03bae0975..20f396583 100644--- a/docs/next/CHANGELOG.md+++ b/docs/next/CHANGELOG.md@@ -2,6 +2,9 @@## Unreleased+### Fixed+- The OpenCode integration no longer treats `session.created` or `session.updated` plugin events as idle signals, so active sessions stay marked working until OpenCode reports `session.status` or `session.idle`. (#351)+## [0.6.5] - 2026-05-29### Addeddiff --git a/src/integration/assets/opencode/herdr-agent-state.js b/src/integration/assets/opencode/herdr-agent-state.jsindex 17eb5ad94..ed0958fdd 100644--- a/src/integration/assets/opencode/herdr-agent-state.js+++ b/src/integration/assets/opencode/herdr-agent-state.js@@ -2,7 +2,7 @@// managed by herdr; reinstalling or updating the integration overwrites this file.// add custom hooks/plugins beside this file instead of editing it.// HERDR_INTEGRATION_ID=opencode-// HERDR_INTEGRATION_VERSION=2+// HERDR_INTEGRATION_VERSION=3import net from "node:net";@@ -111,9 +111,8 @@ export const HerdrAgentStatePlugin = async () => {break;case "session.created":case "session.updated":- if (sessionID) {- await reportState("idle", sessionID);- }+ // session.created and session.updated are metadata events; lifecycle+ // state comes from session.status and the deprecated session.idle.break;case "session.status": {const status =diff --git a/src/integration/mod.rs b/src/integration/mod.rsindex c309e2d3f..ccd3e045c 100644--- a/src/integration/mod.rs+++ b/src/integration/mod.rs@@ -27,7 +27,7 @@ const CODEX_INTEGRATION_VERSION: u32 = 4;const CODEX_HOME_ENV_VAR: &str = "CODEX_HOME";const OPENCODE_PLUGIN_INSTALL_NAME: &str = "herdr-agent-state.js";const OPENCODE_PLUGIN_ASSET: &str = include_str!("assets/opencode/herdr-agent-state.js");-const OPENCODE_INTEGRATION_VERSION: u32 = 2;+const OPENCODE_INTEGRATION_VERSION: u32 = 3;const HERMES_PLUGIN_INSTALL_NAME: &str = "herdr-agent-state";const HERMES_PLUGIN_MANIFEST_INSTALL_NAME: &str = "plugin.yaml";const HERMES_PLUGIN_INIT_INSTALL_NAME: &str = "__init__.py";@@ -2859,6 +2859,7 @@ mod tests {assert!(OPENCODE_PLUGIN_ASSET.contains("properties?.sessionID"));assert!(OPENCODE_PLUGIN_ASSET.contains("dispose: async"));assert!(OPENCODE_PLUGIN_ASSET.contains("agent_session_id: sessionID"));+ assert!(!OPENCODE_PLUGIN_ASSET.contains("await reportState(\"idle\", sessionID);\n }\n break;\n case \"session.status\""));assert!(HERMES_PLUGIN_INIT_ASSET.contains("session_id = _session_id(kwargs)"));assert!(HERMES_PLUGIN_INIT_ASSET.contains("agent_session_id"));// Qoder hook reads the event from the stdin JSON payload (per