From dabcbc79831052effc6ce990021feee07d661f7e Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Wed, 24 Jun 2026 14:10:03 +0900 Subject: fix(kernel+tool-shell): abort hanging tool calls without bricking the conversation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kernel: executeToolCall now races tool.execute against the abort signal via Promise.race; on abort resolves (not rejects) with an "Aborted" result so the step completes normally → finishReason "aborted" → turn seals cleanly (done event) → finally clears activeTurns → conversation freed, next message accepted. run-turn strips tool-call chunks from the assistant message on abort (keeps text/thinking) and omits tool-result messages to avoid persisting dangling tool calls that would 400 the provider next turn. tool-shell: realSpawn spawns detached (own process group); on abort AND timeout kills the entire group (process.kill(-pgid, SIGKILL)) and resolves immediately — no child.on("close") dependency, so a grandchild holding the pipes can't stall the spawn promise or leak. Also: ORCHESTRATOR.md migrated to dispatch CLI summon mechanism; .skills summary; bin/sync-env PATH injection; frontend handoff docs. 1453 vitest pass · tsc -b EXIT 0 · biome clean. --- bin/sync-env | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bin') diff --git a/bin/sync-env b/bin/sync-env index 9a69076..4b7c64c 100755 --- a/bin/sync-env +++ b/bin/sync-env @@ -4,12 +4,21 @@ set -euo pipefail ENV_FILE="/etc/dispatch/env" OPENCODE_KEY="sk-P2DW7UFzQZgI8TnYzp6wWKxv6suzFvSGRrwewhUK0OjA4C7bLzsKHki7r7zZOAH1" UMANS_KEY="sk-bvI-mgUrp5qJzMlK8ndoDqJ3dK0U-ds_8KYS8pzpRLw" +# PATH that includes user-installed tools (mise, bun, npm global, etc.) +DISPATCH_PATH="/home/tradam/.local/bin:/home/tradam/.local/share/mise/shims:/home/tradam/.bun/bin:/usr/local/sbin:/usr/local/bin:/usr/bin" if [ ! -f "$ENV_FILE" ]; then echo "Error: $ENV_FILE not found" >&2 exit 1 fi +# Update PATH (so tools like typescript-language-server, npm, bun are found) +if grep -q "^PATH=" "$ENV_FILE"; then + sed -i "s|^PATH=.*|PATH=$DISPATCH_PATH|" "$ENV_FILE" +else + echo "PATH=$DISPATCH_PATH" >> "$ENV_FILE" +fi + # Update DISPATCH_API_KEY if grep -q "^DISPATCH_API_KEY=" "$ENV_FILE"; then sed -i "s|^DISPATCH_API_KEY=.*|DISPATCH_API_KEY=$OPENCODE_KEY|" "$ENV_FILE" -- cgit v1.2.3