diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-30 00:49:43 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-30 00:51:01 +0300 |
| commit | 6b9b092228a6fa0c06451233dec0e90e8a6740b0 (patch) | |
| tree | 9f0d2fdb2ef7a981bedf16121c40f49e10621d35 /src/integration | |
| parent | 6d4c04fa509cd8f1a13907e260ca69179ca301c4 (diff) | |
fix: preserve opencode working state
refs #351
Diffstat (limited to 'src/integration')
| -rw-r--r-- | src/integration/assets/opencode/herdr-agent-state.js | 7 | ||||
| -rw-r--r-- | src/integration/mod.rs | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/integration/assets/opencode/herdr-agent-state.js b/src/integration/assets/opencode/herdr-agent-state.js index 17eb5ad9..ed0958fd 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=3 import 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.rs index c309e2d3..ccd3e045 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 |
