Harden host + agent-runner from health audit findings#2732
Open
caburi00 wants to merge 1 commit into
Open
Conversation
This was referenced Jun 12, 2026
b26da17 to
fdf4472
Compare
This was referenced Jun 14, 2026
Fixes from a multi-agent health audit (adversarially verified). Scoped to upstream core; WhatsApp adapter fixes and the approval-click authorization (already implemented upstream) are intentionally excluded. Container lifecycle (container-runner.ts, container-runtime.ts): - realpath-resolve bind-mount sources so the groups/data ext4 symlinks are followed and drvfs never enters the mount path (fixes Docker Desktop stale staging crash-loops, exit 127) - crash-on-spawn circuit breaker (decideCrashExit) so a broken image backs off and pauses instead of respawning every 60s forever - enforce MAX_CONCURRENT_CONTAINERS in wakeContainer - killContainer falls back to daemon-level `docker kill` before the CLI client Agent-runner (poll-loop.ts, db/messages-out.ts, mcp-tools/core.ts): - follow-up poller claims only messages it will push (no orphaned 'processing') - apply the accumulate (trigger=1) gate to follow-ups - thread message origin (fromMe) through edit/reaction content Delivery + DB: - order outbound by (timestamp, seq) so same-second multi-part replies stay ordered (host + container) - add idx_messages_in_due for the hot countDueMessages poll - guard migration013 ALTERs (idempotent) - delete FK dependents in a transaction for agent/messaging group deletes - correct misleading delivery-retry comment Router: - cache compiled engage_pattern + cap input length (ReDoS guard) - invalid pattern fails closed with a one-shot warn (was fail-open) - run the command gate only when engaging (accumulate context stays silent) Scheduling: - recurring series survives a failed occurrence instead of dying silently - anchor next run on scheduled fire time to prevent drift Ops: - only colorize logs on a TTY so the service log file is greppable - non-destructive startup reconciliation of orphan session folders - correct stale schema.ts header to point at migrations Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fdf4472 to
18a29ef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes from a multi-agent health audit (adversarially verified). Scoped to upstream core; WhatsApp adapter fixes (skill-managed in core) and approval-click authorization (already implemented upstream) are intentionally excluded. Rebased onto latest main — 1 commit, 19 files, typecheck + tests green.
Container lifecycle
decideCrashExit) — a broken image backs off and pauses instead of respawning every 60s foreverMAX_CONCURRENT_CONTAINERSinwakeContainerkillContainerfalls back to daemon-leveldocker killbefore the CLI clientAgent-runner
fromMe) through edit/reaction contentDelivery + DB
(timestamp, seq)so same-second multi-part replies stay ordered (host + container)idx_messages_in_duefor the hotcountDueMessagespollRouter
engage_pattern+ cap input length (ReDoS guard)Scheduling
Ops
schema.tsheader to point at migrationsAdds unit tests for the crash breaker.
🤖 Generated with Claude Code