Repository navigation
feat(sentry-monitor): tag agent_end with run/session correlation ids - #182
Merged
Merged
Conversation
An agent_end failure could only be read AFTER you found it, never found BY the id you already had. run_id was in `contexts`, which Sentry does not index. It is boon-core's `dispatch_ref`: minted per turn, sent to the box as run_id / X-Request-Id, printed in the Slack stall alert, and tagged on boon-core's own Sentry events. So an operator holding a dispatch_ref from an alert could not search the fleet project for the box's side of that same turn. Promoting it to a tag closes the round trip. Also fills in session_id, whose plumbing already existed and was never used: runContext(runId, sessionId, callId) has always taken a sessionId, and every caller passed only runId, so the field was permanently undefined. It resolves the box's session file. agent_id comes along for free. The ids come from PluginHookAgentContext, the hook's existing second argument, which already carries sessionId/agentId — so this needs no change to src/plugins/hook-types.ts. That matters: hook-types is upstream-owned and the fork is far behind upstream, so touching it would add merge-conflict surface for no benefit. The ctx parameter is optional, keeping every existing call site valid. Deliberately additive only: - Emits ZERO new events. agent_end already fired on every failed turn; this only enriches what was already being sent. No new noise. - Does not touch `fingerprint`, so existing issues cannot fragment. Sentry groups on fingerprint, not tags. A test pins this. - pruneTags drops undefined/empty, so a run without these ids emits no empty facets — an empty-string tag would still create a searchable facet, which is worse than the tag being absent. A test pins this too. Verified: 62/62 in captures + register suites via scripts/run-vitest.mjs; oxfmt clean; oxlint clean; `pnpm tsgo:extensions` exit 0.
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
insomnius
approved these changes
Sep 3, 2026
There was a problem hiding this comment.
Approved.
Reviewed on the checked-out branch. Every claim in the description checks out against the code:
PluginHookAgentContextinsrc/plugins/hook-types.tsalready carriessessionId/agentId— no upstream-owned type touched, as promised.agent_endhook signature inhook-types.tsalready passesctxas the second arg; the register.ts change is just plumbing it through.runContext(runId, sessionId, callId)informat.tsalready acceptssessionId— the slot really was there and unused.pruneTagsdrops undefined/empty, so a run without correlation ids emits no empty facets (test pins this).fingerprintOfis called with the same args → grouping unchanged (test pins this too).- Zero new emit sites; only enrichment of an event that already fired on every failed turn.
Local proof: node scripts/run-vitest.mjs extensions/sentry-monitor/src/captures.test.ts extensions/sentry-monitor/src/register.test.ts → 62/62 passed.
CI: all completed jobs green; remaining shards still running but nothing failing. Claude PR Review's CANCELLED is a rerun artifact, not a red.
The reasoning (indexed tags vs unindexed contexts closing the dispatch_ref round-trip from a Slack stall alert to the fleet Sentry event) is the right lens on why this matters. Small, additive, well-tested. Ship it.
insomnius
added a commit
that referenced
this pull request
Sep 3, 2026
…186) Cut the boon.34 fork release. Carries ENG-19115 fix (#185): read the gateway-audience OBO from the inbound ctx, not the persisted sessionCtx -- the per-turn token was being dropped, so the tier-1 internal-test meter-skip never fired. Plus #182 (sentry-monitor correlation ids). release:prep synced the lockstep extension versions + regenerated release artifacts (plugin inventory/reference docs, shrinkwraps, plugin-sdk API baseline, bundled-channel-config metadata).
insomnius
added a commit
that referenced
this pull request
Sep 3, 2026
#186 bumped the version but omitted the CHANGELOG.md section, so the boon-release.yml prepack (scripts/package-changelog.mjs) hard-fails with "CHANGELOG.md does not contain a release section for 2026.6.11-boon.34" and no fleet tarball is built. Add the boon.34 section (covers #185 ENG-19115 OBO ctx fix, #182, #181) to unblock the release.
convyusboy
added a commit
that referenced
this pull request
Nov 18, 2026
…am fix available picomatch <=4.0.7 is vulnerable to catastrophic backtracking on single-branch repeated extglobs like +(*a) (confirmed locally: exponential blowup, ~7s at n=30). The advisory lists no first_patched_version, and the one linked PR (micromatch/picomatch#194) is unmerged and explicitly out of scope for this exact shape per its own author. Patch [email protected] and @4.0.4 (the two versions reachable in the production dependency closure, via vite/vitest/tinyglobby under extensions/qa-lab's @copilotkit/aimock) to treat a branch with a bare top-level star alongside other content as risky and literalize it - the same safety/correctness trade-off picomatch's own prior ReDoS mitigation (#182) already makes for mixed star/qmark branches. A branch that is nothing but stars (e.g. +(*)c) stays safe, matching existing tested behavior. Verified against picomatch's own upstream test suites at both versions: 1981/1983 and 1973/1975 passing. The only two newly-failing assertions (*(a*|b) matching "ax", */*(W*, *)* matching a benign short string) independently reproduce as themselves exponential against an adversarial input on the unpatched code - two more instances of the same unfixed bug the suite never exercised adversarially, not false positives in this patch. Documents the override in pnpm-audit-prod.mjs's existing AUDIT_ADVISORY_VERSION_OVERRIDES mechanism; remove once picomatch ships a real fix. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
What Problem This Solves
Resolves a problem where an operator holding a turn's correlation id could not find the corresponding fleet Sentry event.
When a customer agent turn fails,
agent_endreports it to Sentry. The event carriedrun_id— but only incontexts, which Sentry does not index. Tags are indexed; contexts are payload you can read after you have already found the event.run_idis boon-core'sdispatch_ref: minted per turn, sent to the box asrun_id/X-Request-Id, printed in the Slack stall alert, and tagged on boon-core's own Sentry events. So the operational path — "I have a dispatch_ref from an alert, what did the box say about that turn?" — dead-ended. You could only browse the fleet project by host and timestamp and hope.session_idwas similarly unavailable:runContext(runId, sessionId, callId)has always accepted asessionId, and every caller passed onlyrunId, so the field was permanentlyundefined. It resolves the box's own session file.Why This Change Was Made
Promoting
run_idto a tag closes the round trip between the control plane's view of a turn and the box's.session_idandagent_idcome fromPluginHookAgentContext— the hook's existing second argument, which already carries them.That last point is the design constraint worth noting: no change to
src/plugins/hook-types.ts. That file is upstream-owned and this fork is far behind upstream, so touching it would add merge-conflict surface for no benefit. Thectxparameter is optional, so every existing call site stays valid.User Impact
Operator-facing only; no runtime behavior change for agents or end users.
Deliberately additive, and each property is pinned by a test:
agent_endalready fired on every failed turn — this only enriches what was already sent. No new Sentry noise.fingerprint, which is untouched. Tags are metadata.pruneTagsdrops undefined/empty, so a run without these ids emits nothing. An empty-string tag would still create a searchable facet, which is worse than the tag being absent.Evidence
Behavior proof, all against the changed surface:
node scripts/run-vitest.mjs extensions/sentry-monitor/src/captures.test.ts extensions/sentry-monitor/src/register.test.tsoxfmt --checkon the 3 changed filesnode scripts/run-oxlint.mjspnpm tsgo:extensionsSix new tests written before the implementation (RED confirmed — 3 failing on the new behavior, then green):
run_idappears in tags, not only contextssession_id+agent_idare taken from the hook contextsession_idpopulates the run context whose slot already existedctx, so issues do not fragmentagent_endbehavior (success ignored, error message, message count) unchangedNote on local commands:
pnpm test extensions/sentry-monitorfanned out and timed out at 10 minutes on this machine, so per the root guide I usedscripts/run-vitest.mjsfor narrow explicit-file proof. Broader proof should come from CI/Testbox rather than a local full run.Summary by cubic
Tags
agent_endSentry events withrun_id,session_id, andagent_idso operators can find a failed turn's fleet event by the correlation id from an alert, instead of browsing by host and timestamp.run_idwas previously only incontexts, which Sentry doesn't index.session_idandagent_idcome from the hook's existing context argument, so no upstream type changes are needed.run_id,session_id, andagent_idas tags;session_idalso populates the existing run-context slot.ctxparameter is optional, so all existing call sites remain valid.Written for commit fce08ca. Summary will update on new commits.