Skip to content

fix(sentry-monitor): stop paging on ordinary exec exit codes, add unzip to runtime image - #291

Merged
convyusboy merged 2 commits into
boonfrom
ridho/eng-21226-sentryfleet-openclaw-fleet-x5-subprocess-exec-captures
Oct 14, 2026
Merged

convyusboy merged 2 commits into
boonfrom
ridho/eng-21226-sentryfleet-openclaw-fleet-x5-subprocess-exec-captures

Conversation

@convyusboy

@convyusboy convyusboy commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Sentry OPENCLAW-FLEET-X5 paged on 1,164 events across 5 customer orgs over 44 days. buildAfterToolCallCapture fingerprints exec exit errors as [tool, kind, exitCode] with message text deliberately excluded, so every ordinary exec failure that happened to exit 1 fleet-wide — grep finding nothing, a failing test, a script's own exit 1 — landed in one shared Sentry issue, none of them host defects. A sibling issue, OPENCLAW-FLEET-X9 (exit code 127, 60 events), had the opposite problem: two genuinely different missing binaries (unzip, convert) were hidden behind one shared, misleading title.

Why This Change Was Made

POSIX reserves exit codes 126/127 for the shell's own command lookup/exec failure (missing or non-executable binary) — a real host-provisioning defect, not the invoked command's own exit status. The host already draws this exact line before the event reaches the plugin (isShellFailure in bash-tools.exec-runtime.ts). This PR threads that same split into buildAfterToolCallCapture: an exit-error at 126/127 stays a full exception, now with the normalized error text folded into its fingerprint so two different missing binaries no longer share one issue; every other exit-error downgrades to a non-paging warning message, matching the existing invalid-input/web_fetch 403/404/429 precedents already in the same function.

Separately, src/agents/utils/tools-manager.ts's fd/rg downloader already shells out to unzip -q (falling back to tar xf only because unzip isn't in the runtime image today) — added to the Dockerfile's runtime apt list. Note: this does not fix the fleet's own missing-unzip gap — the paid fleet runs a bare EC2 AMI, not this Docker image; that fix is tracked separately in getboon/gandalf-manager.

User Impact

Sentry noise for ordinary exec exits (tests, greps, scripts) stops paging operators; genuine missing-binary provisioning gaps stay visible and now split into one actionable issue per binary instead of one shared bucket. openclaw's own fd/rg auto-download path gets a working unzip instead of always falling through to tar.

Evidence

Related: https://linear.app/getboon/issue/ENG-21226/sentryfleet-openclaw-fleet-x5-subprocess-exec-captures-normal (this PR covers the sentry-monitor policy + Docker image side; the fleet AMI/sweep side lands separately in gandalf-manager)


Summary by cubic

Stops sentry-monitor paging on ordinary exec exit codes so routine command failures no longer page operators, while keeping genuine missing-binary defects visible. Adds unzip to the runtime image.

  • Exit errors at codes other than 126/127 (a failing test, grep finding nothing, a script's own exit 1) now emit a non-paging warning instead of an exception.
  • Exit codes 126/127 — POSIX's reserved shell lookup/exec failures — still page as exceptions, with the invoked binary's basename folded into the fingerprint so different missing binaries like unzip vs convert no longer share one issue (handles both bare and absolute-path invocations).
  • Adds unzip to the Dockerfile apt list so a self-hosted agent's exec tool can extract uploaded .zip archives, and so tools-manager.ts's fd/rg downloader can use its unzip -q path instead of always falling through to tar.
  • This does not fix the fleet's own missing-unzip gap; that fleet AMI change is tracked separately in getboon/gandalf-manager.

Written for commit 7d06f31. Summary will update on new commits.

View guided diff Turn on auto-fix

@convyusboy
convyusboy requested a review from a team October 14, 2026 10:18

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/gateway/sentry-monitor.md Resolved
Comment thread Dockerfile Resolved
convyusboy and others added 2 commits October 14, 2026 17:37
…ssing-binary exits as exceptions

buildAfterToolCallCapture fingerprinted every exec exit error as
[tool, kind, exitCode] with message text deliberately excluded, so there was
one Sentry issue per exit code, not per failure. The exit-code-1 bucket
collected every ordinary exec failure fleet-wide -- grep finding nothing, a
failing test, a script's own `exit 1` -- none of them host defects.
Meanwhile the exit-code-127 bucket hid real missing-binary failures (unzip,
convert) behind one shared, misleading title.

Exec already distinguishes a plain non-zero exit from a shell lookup
failure (126/127) at bash-tools.exec-runtime.ts's isShellFailure before the
event ever reaches this plugin. Thread that same split into
buildAfterToolCallCapture:

- exit-error at 126/127 stays a full exception, with the invoked binary's
  basename extracted from the shell diagnostic and folded into the
  fingerprint so two different missing binaries no longer share one issue
  (handles both bare and absolute-path invocations)
- every other exit-error downgrades to a non-paging warning message,
  matching the existing invalid-input/web_fetch-403-404-429 precedents in
  the same function

The harness path (hook-helpers.ts) never sets errorKind/exitCode and is
unaffected -- the fleet uses the embedded-agent path, which populates both.

Evidence: pnpm test extensions/sentry-monitor -> 112/112 passed. oxfmt,
oxlint, pnpm tsgo:extensions clean.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The agent's exec tool runs arbitrary shell commands in this image, so a
self-hosted user's agent asked to extract an uploaded .zip archive needs
unzip on PATH.

Appended after `tini` rather than inserted alphabetically so both
substring assertions in src/dockerfile.test.ts stay intact.

Evidence: pnpm test src/dockerfile.test.ts -> 25/25 passed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@convyusboy
convyusboy force-pushed the ridho/eng-21226-sentryfleet-openclaw-fleet-x5-subprocess-exec-captures branch from b7e1239 to 7d06f31 Compare October 14, 2026 10:38

@boon-hermes-bot boon-hermes-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Verified all changes:

  • captures.ts: Clean classification split. Ordinary non-zero exit codes (1..125, 128+) downgrade to non-paging warning messages, while shell command lookup/exec failures (126/127) remain exceptions.
  • Fingerprinting: Correctly isolates missing binaries by basename (e.g. unzip, convert) so distinct missing commands do not collapse into a single Sentry issue or get erased by path scrubbing.
  • captures.test.ts: Full coverage for downgrade behavior, upstream exceptions, 126/127 exceptions, and distinct fingerprinting across bare and absolute binary paths.
  • Dockerfile: unzip added to runtime image after tini, keeping dockerfile.test.ts substring assertions intact.
  • CI: All required checks passed.

@convyusboy
convyusboy merged commit 7961db0 into boon Oct 14, 2026
144 of 151 checks passed
@convyusboy
convyusboy deleted the ridho/eng-21226-sentryfleet-openclaw-fleet-x5-subprocess-exec-captures branch October 14, 2026 11:45
convyusboy added a commit that referenced this pull request Oct 15, 2026
Cut the fork release that ships the six commits on boon since
v2026.6.34-boon.7:

- #292 (ENG-21407): resolve relative media/PDF paths against the agent
  workspace in pdf, image_generate, video_generate, and music_generate,
  instead of the gateway process cwd; delete the image tool's duplicate
  inline resolution now that the loader owns it canonically.
- #289 (ENG-21228): let image, pdf, image_generate, video_generate, and
  music_generate read agent-rendered files outside the default roots
  (e.g. /tmp crops) when the agent is permitted host reads outside its
  workspace, matching the outbound MEDIA: path; a blocked path now
  returns a denied tool result instead of a raw error that paged Sentry.
- #293 (ENG-21406): raise the image tool's default vision timeout 60s ->
  150s (above boon-llm-gateway's 120s fallback-chain budget), share one
  deadline across setup and the provider request, and return a graceful
  timeout status instead of letting the raw error end the turn; mirrored
  in the Codex dynamic-tool watchdog; sentry-monitor downgrades image
  timeouts to a warning.
- #291: sentry-monitor no longer pages on ordinary non-zero exec exit
  codes; only shell lookup failures (126/127) stay exceptions, now
  fingerprinted per missing binary. Runtime Docker image adds unzip.
- #288 (ENG-21227): memory_search no longer pauses/pages Sentry while
  the index is still building ("missing" identity); only a real
  "mismatched" embedding provider pauses it.
- #294 (ENG-21405, test-only): regression coverage confirming the cron
  delivery-target guard already rejects a directory-less channel's
  unknown target end to end; root cause for the live Sentry errors was
  a stale anychat-boon-web plugin install, not a core gap.

Bump root package.json and npm-shrinkwrap.json, all 136 plugin
manifests, and the version field in every extension's
npm-shrinkwrap.json via pnpm plugins:sync, hand-patched the same way as
boon.7 (the npm-shrinkwrap generator still can't regenerate cleanly on
this fork: pre-existing, unrelated @sentry/node nested
@opentelemetry/resources / sdk-trace-base registry-resolution drift,
reproduced again on this base). Verified via
test/package-manager-config.test.ts (12/12) and the full
release-preflight check suite (plugin versions, inventory, base config
schema, bundled channel config metadata, config docs baseline, plugin
SDK exports/API baseline/surface budget, root dependency ownership) --
all green except the known shrinkwrap generator drift. Add the
2026.6.34-boon.8 CHANGELOG.md section and the generated
extensions/matrix/CHANGELOG.md entry.

No config schema, plugin-SDK surface, or plugin source/dependency
change in slack/msteams/diagnostics-prometheus; this is a gateway-only
roll (bundled-plugin source changes in codex, memory-core, and
sentry-monitor ship inside the gateway tarball). Targeted tests for all
three touched extensions plus the codex dynamic-tool-execution suite:
1075/1075 passing.

Co-authored-by: Claude Sonnet 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants