Skip to content

feat(webapp,core): add a public HTTP API for errors#4005

Merged
ericallam merged 2 commits into
mainfrom
feat/errors-api
Jun 21, 2026
Merged

feat(webapp,core): add a public HTTP API for errors#4005
ericallam merged 2 commits into
mainfrom
feat/errors-api

Conversation

@ericallam

Copy link
Copy Markdown
Member

Summary

Adds an environment-scoped HTTP API over the Errors feature, mirroring the runs API. Task-run failures are grouped by a fingerprint into "error groups," and this exposes everything you can do with them in the dashboard:

  • GET /api/v1/errors lists error groups, with filter[taskIdentifier], filter[version], filter[status] (unresolved/resolved/ignored), filter[search], a time range, and cursor pagination.
  • GET /api/v1/errors/{errorId} retrieves a single group (summary, lifecycle state, affected versions).
  • POST /api/v1/errors/{errorId}/{resolve,ignore,unresolve} changes its state.
  • GET /api/v1/runs?filter[error]={errorId} lists the runs behind a group.

Request and response schemas are exported from @trigger.dev/core/v3 so the SDK can reuse them, and all endpoints are documented in the API reference (OpenAPI). errorId is the error_<fingerprint> friendly id.

Attribution

State changes record who made them. A plain environment API key has no user, so resolvedBy/ignoredByUserId stay null. When the caller uses an environment JWT obtained by exchanging a personal access token or a delegated user token at POST /api/v1/projects/:ref/:env/jwt, that exchange now stamps an act delegation claim, and the write endpoints read act.sub to attribute the change to the acting user. This is the first endpoint to consume the act claim, so two small pieces of plumbing ride along: the exchange stamps act for personal-access-token subjects too (it was delegated-token-only), and the public-JWT bearer-auth path surfaces act.sub to the handler.

Built on the delegated-token work in #3997.

Adds an environment-scoped HTTP API over the Errors feature, mirroring the
runs API: list error groups (filter by task, version, status, search and
time range, with cursor pagination), retrieve a single group, and change its
state with resolve, ignore, and unresolve. A new filter[error] option on the
runs list returns the runs behind a group. Request and response schemas are
exported from @trigger.dev/core/v3 for the SDK to reuse, and the endpoints are
documented in the API reference.

State changes record who made them. A plain environment API key has no user,
so the attribution stays null. When the request uses an environment JWT
obtained by exchanging a personal access token or a delegated user token, that
exchange now stamps an act claim and the write endpoints read it to attribute
the change to the acting user.
@changeset-bot

changeset-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e6d780a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@trigger.dev/core Patch
@trigger.dev/build Patch
trigger.dev Patch
@trigger.dev/plugins Patch
@trigger.dev/python Patch
@trigger.dev/redis-worker Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@trigger.dev/rbac Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/run-store Patch
@internal/schedule-engine Patch
@trigger.dev/sso Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/zod-worker Patch
@internal/sdk-compat-tests Patch
@trigger.dev/react-hooks Patch
@trigger.dev/rsc Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch

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

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2d4688d6-ad65-484d-956e-1792873287d4

📥 Commits

Reviewing files that changed from the base of the PR and between 80db49b and e6d780a.

📒 Files selected for processing (1)
  • apps/webapp/app/presenters/v3/ApiErrorListPresenter.server.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/webapp/app/presenters/v3/ApiErrorListPresenter.server.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (37)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: 🛡️ E2E Auth Tests (full)

Walkthrough

This PR introduces a public HTTP Errors API for trigger.dev's v3 environment. Five new Remix API routes are added for listing error groups, retrieving a single group, and mutating state (resolve, ignore, unresolve). New Zod schemas for these operations are defined in @trigger.dev/core/v3 and re-exported. Two new server-side presenters back the list and detail endpoints using ClickHouse queries and Prisma replica reads. JWT actor attribution is threaded through the RBAC fallback, API builder, and auth types so that state-mutation calls can record the acting user. The ErrorGroupActions service's userId param is relaxed to string | null. The OpenAPI spec gains five operations plus new component schemas and parameters, with corresponding MDX documentation pages and navigation entries. An end-to-end smoke test skill documents the full API surface, data flow, and attribution verification.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description provides a comprehensive summary of the implementation, including all endpoints, attribution logic, and integration with the delegation-token work. However, the provided description is missing the required checklist sections from the template. Complete the PR description by adding the required checklist items, testing steps, changelog entry, and screenshots sections from the template.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(webapp,core): add a public HTTP API for errors' accurately captures the main change—adding a public HTTP API for error management across webapp and core packages.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/errors-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

Use hasOwnProperty instead of `in` when validating filter[status] so
inherited Object properties (e.g. toString) can't pass validation and map
to a non-status value.
@ericallam ericallam marked this pull request as ready for review June 21, 2026 06:48

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread apps/webapp/app/routes/api.v1.errors.$errorId.ts
Comment thread apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
@ericallam ericallam merged commit 5052d89 into main Jun 21, 2026
66 checks passed
@ericallam ericallam deleted the feat/errors-api branch June 21, 2026 08:29
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