Repository navigation
fix: report actionable failures to Sentry - #1125
Merged
Merged
Conversation
Mark infrastructure and unexpected internal errors on the log record so the server logger can send them to Sentry without reporting provider inference errors, bad credentials, or client disconnects. Signed-off-by: Raman Tehlan <ramantehlan@gmail.com>
ramantehlan
requested review from
chiragjn,
debajyoti-truefoundry,
heerambavi1998 and
thesujai
as code owners
October 21, 2026 22:10
🦋 Changeset detectedLatest commit: 3b88b6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A normal Redis close during shutdown is not a failure, and an HTTP 500 whose cause was already marked should not be reported again. Signed-off-by: Raman Tehlan <ramantehlan@gmail.com>
Restore the sandbox captures this branch had dropped, and remember a directly captured error so the HTTP handler does not send it again. Signed-off-by: Raman Tehlan <ramantehlan@gmail.com>
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
reviewed
Oct 22, 2026
chiragjn
approved these changes
Oct 22, 2026
chiragjn
left a comment
Member
There was a problem hiding this comment.
Keeping it approved with some comments
…crease Signed-off-by: Raman Tehlan <ramantehlan@gmail.com> # Conflicts: # packages/trueforge-core/src/core/llm/VercelAILLM.ts
The marker stayed on the printed line whenever Sentry did not start, and production tags collapsed to the server bundle or skipped core. Wrapped provider responses from 200 through 499 stay in the logs. Signed-off-by: Raman Tehlan <ramantehlan@gmail.com>
…increase' into sd/sentry-coverage-increase
Dual-write cleanup keeps the agent identity on the event. A turn.done error only has a message, so provider failures stay classified where they are thrown. Missing sandbox versions, rejected credentials, and API responses the server already logged stay in the logs. Signed-off-by: Raman Tehlan <ramantehlan@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
The agent store log already carries the agent identity. The HTTP 500 handler skips an error that was already marked, so the same cleanup failure is not sent again. Signed-off-by: Raman Tehlan <ramantehlan@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c897511. Configure here.
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.

Summary
reportable_error.Test plan
pnpm --filter @truefoundry/trueforge exec jest --config jest.unit.config.cjs tests/unit/sentry/reportMarkedLog.test.ts tests/unit/apis/auth.test.ts tests/unit/sandbox/progressSandboxEnvironmentVersion.test.ts tests/unit/controller/sandboxEnvBuild.test.tspnpm --filter @truefoundry/trueforge-core exec jest --config jest.config.cjs tests/core/llm/VercelAILLM.stream.test.tsreportable_errorNote
Medium Risk
Broad changes to error observability and many failure paths; mis-tagged
reportable_errororisReportableErroredge cases could over- or under-alert Sentry without affecting request handling.Overview
Introduces opt-in Sentry reporting via Winston: error logs can carry a
reportable_errormetadata field; when Sentry is enabled, a log formatter turns the log message into the event title, uses the wrapped error for cause/stack, attaches optionalextra/filepath, and stripsreportable_errorfrom console/JSON output.Adds
isReportableErrorin core so HTTP 200–499 (includingstatusCode/statuson the error cause chain) is treated as non-reportable—used to avoid Sentry noise for provider 4xx, OAuth failures, and similar client errors while still logging them.Replaces ad-hoc
captureCriticalExceptioncalls across server, controller, Daytona sandbox, and TrueFoundry dual-write paths with marked logs; removes Daytona'sonCriticalAlerthook. Sentry scope now auto-tags tenant/request/session/turn from log context and enables linked errors integration.Call sites across agent turns, LLM streaming, sandboxes, Redis, request-reply, and API handlers are updated to mark infrastructure/unexpected failures; several paths stop reporting expected cases (missing sandbox versions, authz build failures, duplicate build errors, provider/model client errors). Turn draining adds reporting for unexpected
turn.doneerror/abandoned-timeout cancellations.Reviewed by Cursor Bugbot for commit 3b88b6c. Bugbot is set up for automated code reviews on this repo. Configure here.