Skip to content

Commit e8e12f1

Browse files
committed
cli/multiselect: skip root.unmount, let renderer.destroy reclaim container (workaround for opentui-react Embind BindingError); bump v0.1.5
1 parent e4a9c0c commit e8e12f1

3 files changed

Lines changed: 18 additions & 26 deletions

File tree

Formula/agentlock.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class Agentlock < Formula
22
desc "Locally-hosted, open-source firewall for AI coding agents"
33
homepage "https://openagentlock.github.io/OpenAgentLock"
4-
url "https://registry.npmjs.org/@openagentlock/cli/-/cli-0.1.4.tgz"
5-
sha256 "969b8730f29dae20f96326209f6c5ffcf881458027f733c8c735df257ba26b09"
4+
url "https://registry.npmjs.org/@openagentlock/cli/-/cli-0.1.5.tgz"
5+
sha256 "REPLACE_AFTER_NPM_PUBLISH"
66
license "FSL-1.1-Apache-2.0"
7-
version "0.1.4"
7+
version "0.1.5"
88

99
depends_on "bun"
1010

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openagentlock/cli",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"type": "module",
55
"license": "SEE LICENSE IN LICENSE",
66
"description": "OpenAgentLock CLI — a firewall for AI coding agents. Detects local agent harnesses (Claude Code, Codex CLI, Cursor, OpenCode, Cline, Gemini CLI, Continue, Copilot), gates risky tool calls via a Go control plane, anchors decisions in a Rust Merkle ledger.",

cli/src/tui/multiselect.tsx

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -197,31 +197,23 @@ export async function multiselect<T extends string>(
197197
let finished = false;
198198
const finish = (result: T[] | null): void => {
199199
// Guard against the keypress handler firing finish twice (Enter
200-
// can produce both `return` and `enter` on some terminals; q/esc
201-
// similarly). React's reconciler does not tolerate a second
202-
// unmount commit on a torn-down container — symptom is
203-
// BindingError "Expected null or instance of Node" inside
204-
// commitBeforeMutationEffects → clearContainer.
200+
// can produce both `return` and `enter` on some terminals).
205201
if (finished) return;
206202
finished = true;
207-
// Resolve first so the caller's `await` settles before teardown.
208-
// Defer unmount + destroy to the next microtask so React's
209-
// current commit cycle (the keypress that triggered finish)
210-
// finishes before the reconciler tries to mutate a container we
211-
// are about to clear.
203+
204+
// opentui-react's reconciler crashes inside clearContainer when
205+
// we try to formally unmount the React root — the WASM/Embind
206+
// binding does a strict instanceof check that fails across the
207+
// unmount→destroy boundary ("Expected null or instance of Node,
208+
// got an instance of Node"). The reliable workaround is to skip
209+
// root.unmount() entirely and let renderer.destroy() reclaim the
210+
// container in one step. Process exit handles the React leak.
211+
try {
212+
renderer.destroy();
213+
} catch {
214+
// best-effort
215+
}
212216
resolve(result);
213-
queueMicrotask(() => {
214-
try {
215-
root.unmount();
216-
} catch {
217-
// best-effort
218-
}
219-
try {
220-
renderer.destroy();
221-
} catch {
222-
// best-effort
223-
}
224-
});
225217
};
226218

227219
root.render(

0 commit comments

Comments
 (0)