errors-api-e2e
Skill16k starsChanged 4 months agoApache-2.0View on GitHub
End-to-end smoke test for the public Errors HTTP API (error groups). Seeds failed runs into ClickHouse so the error materialized views populate, then drives the real endpoints against the running webapp — list (with filters + pagination), retrieve, resolve/ignore/unresolve, the `filter[error]` runs filter, user attribution via the `trigger.dev mint-token` -> JWT exchange, and the 401/403/404 negatives. Use for "smoke test the errors API", "test the errors API e2e", "prove the errors endpoints work", or to re-verify after changes.
- Reads credentials
- Sends data out
Trending
More talk lately.about the whole repository
Who's talking about triggerdotdev/trigger.dev
- coollabsio/coolify“[Bug]: Various problems with Trigger template”GitHub · May 16, 2025 · 3 reactions
- @github-trending-js.bsky.social“📦 triggerdotdev / trigger.dev ⭐ 13,747 (+48) 🗒 TypeScript Trigger.dev – build and deploy fully‑managed AI …”Bluesky · Feb 21, 2026 · 2 likes
- @github-trending-js.bsky.social“📦 triggerdotdev / trigger.dev ⭐ 13,027 (+33) 🗒 TypeScript Trigger.dev – build and deploy fully‑managed AI …”Bluesky · Dec 18, 2025 · 2 likes
- @github-trending-js.bsky.social“📦 triggerdotdev / trigger.dev ⭐ 11,333 (+46) 🗒 TypeScript Trigger.dev – open source background jobs and …”Bluesky · Jun 3, 2025 · 2 likes
- coollabsio/coolify“[Bug]: Trigger.dev Error: Build failed: 401 "No authorization header provided"”GitHub · Jan 22, 2025 · 2 reactions
The biggest 5 of 60 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 60
Talked about on GitHub and Bluesky (60 times).
On GitHub · 50
- May 16, 2025[Bug]: Various problems with Trigger template — coollabsio/coolify3 reactions · 3 comments
- Jan 22, 2025[Bug]: Trigger.dev Error: Build failed: 401 "No authorization header provided" — coollabsio/coolify2 reactions · 1 comment
- Jan 8, 2026Strange error (i think) due to some git symlinked file that doesn't exist — nrjdalal/gitpick1 reaction · 2 comments
- Nov 2, 2026chore(deps): bump zod, @chronark/zod-bird, @trigger.dev/python, @trigger.dev/core, @trigger.dev/sdk, @trigger.dev/build and zod-openapi — HeliosEnergy/papermark0 reactions
- Nov 2, 2026chore(deps-dev): bump trigger.dev from 4.8.1 to 4.8.2 in the trigger-dev group — bodkul/faceit-deaf0 reactions · 1 comment
45 more on GitHub
- Nov 1, 2026Bump zod and @trigger.dev/sdk — caameliaz/Psi-dashboard-et-site-vitrine-0 reactions · 1 comment
- Oct 30, 2026The Trigger.dev pin is behind its newest release — Robbes/Ownpace0 reactions
- Oct 28, 2026● relit: triggerdotdev/trigger.dev — 🗺️ Observability Map — fitzyracing1/darks0 reactions · 1 comment
- Oct 26, 2026Bump the weekly group with 5 updates — markmoran/wushu-schools-scraper0 reactions
- Oct 26, 2026● relit: triggerdotdev/trigger.dev — 🦋 Changesets PR — fitzyracing1/darks0 reactions · 1 comment
- Oct 24, 2026Bump zod, @ai-sdk/openai, @trigger.dev/react-hooks, @trigger.dev/sdk and @trigger.dev/build in /vercel-ai-sdk-image-generator — orderofmagnitude1/use-for-smartsheet-examples0 reactions
- Oct 21, 2026The Trigger.dev pin is behind its newest release — Robbes/Ownpace0 reactions · 3 comments
- Oct 20, 2026chore(deps-dev): bump trigger.dev from 4.3.3 to 4.5.9 in the security-development group across 1 directory — Dargon789/ethereum-org-website0 reactions · 2 comments
- Oct 19, 2026Port upstream Trigger.dev self-hosting changes (v4.7.3...v4.8.3) — dodi-smart/coolify-trigger-v40 reactions
- Oct 14, 2026● relit: triggerdotdev/trigger.dev — 🚀 Publish Trigger.dev Docker — fitzyracing1/darks0 reactions · 5 comments
- Oct 13, 2026○ dark: triggerdotdev/trigger.dev — 🛡️ E2E Tests: Webapp Auth (full) — fitzyracing1/darks0 reactions · 1 comment
- Oct 12, 2026Port upstream Trigger.dev self-hosting changes (v4.6.4...v4.7.3) — dodi-smart/coolify-trigger-v40 reactions
- Oct 10, 2026chore(deps-dev): bump trigger.dev from 4.5.1 to 4.5.9 in /clickhouse-chat-agent — triggerdotdev/examples0 reactions · 1 comment
- Oct 10, 2026chore(deps-dev): bump trigger.dev from 4.0.0-v4-beta.0 to 4.5.9 in /article-summary-workflow — triggerdotdev/examples0 reactions · 1 comment
- Oct 10, 2026chore(deps-dev): bump trigger.dev from 3.3.5 to 4.5.9 in /batch-llm-evaluator — triggerdotdev/examples0 reactions · 1 comment
- Oct 10, 2026Bump trigger.dev from 4.0.2 to 4.5.9 in /anchor-browser-web-scraper — orderofmagnitude1/use-for-smartsheet-examples0 reactions
- Oct 10, 2026Bump trigger.dev from 4.1.0 to 4.5.9 in /claude-agent-github-wiki — orderofmagnitude1/use-for-smartsheet-examples0 reactions
- Oct 10, 2026Bump trigger.dev from 4.0.0-v4-beta.0 to 4.5.9 in /article-summary-workflow — orderofmagnitude1/use-for-smartsheet-examples0 reactions
- Oct 10, 2026Bump trigger.dev from 4.3.0 to 4.5.9 in /changelog-generator — orderofmagnitude1/use-for-smartsheet-examples0 reactions
- Oct 10, 2026Bump trigger.dev from 3.3.9 to 4.5.9 in /realtime-csv-importer — orderofmagnitude1/use-for-smartsheet-examples0 reactions
- Oct 10, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 — RothBlueprint/rbp-cal.diy0 reactions · 2 comments
- Oct 10, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 — forky-mcforkface/cal.com0 reactions
- Oct 9, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 in /packages/features — forky-mcforkface/calcom-cal.com0 reactions
- Oct 9, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 in /packages/features — codedeeply/cal.diy0 reactions · 1 comment
- Oct 9, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 — forky-mcforkface/calcom-cal.com-e7578750 reactions
- Oct 9, 2026Bump trigger.dev from 3.3.5 to 4.5.9 in /batch-llm-evaluator — orderofmagnitude1/use-for-smartsheet-examples0 reactions
- Oct 9, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 in /packages/features — RothBlueprint/rbp-cal.diy0 reactions · 2 comments
- Oct 9, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 — forky-mcforkface/calcom-cal.com0 reactions
- Oct 9, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 in /packages/features — forky-mcforkface/cal.com0 reactions
- Oct 9, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 — codedeeply/cal.diy0 reactions · 1 comment
- Oct 9, 2026build(deps-dev): bump trigger.dev from 4.3.3 to 4.5.9 — beaconchain-horizon/ethereum-org-website0 reactions
- Oct 9, 2026Bump trigger.dev from 4.4.3 to 4.5.9 in /packages/jobs — appsmithorg/midday0 reactions
- Oct 9, 2026chore(deps): bump trigger.dev from 4.4.3 to 4.5.9 in /packages/jobs — KB-Helios/midday0 reactions · 2 comments
- Oct 9, 2026chore(deps-dev): bump trigger.dev from 4.3.2 to 4.5.9 in /packages/features — forky-mcforkface/calcom-cal.com-e7578750 reactions
- Oct 5, 2026chore(deps): bump engine.io, @trigger.dev/python, @trigger.dev/core, @trigger.dev/sdk and @trigger.dev/build — HeliosEnergy/papermark0 reactions
- Sep 28, 2026chore(deps): bump the trigger-dev group with 4 updates — renatomf/nextjs-switchboard0 reactions · 2 comments
- Sep 20, 2026chore(deps): bump nanoid and @trigger.dev/sdk — shrikrishna-lab/noska0 reactions · 1 comment
- Sep 5, 2026chore(deps): bump nanoid, @trigger.dev/sdk, @trigger.dev/build and trigger.dev — evanjob2005-ux/savrio-dev-hq0 reactions
- Sep 5, 2026Bump nanoid, @trigger.dev/sdk, @trigger.dev/build and trigger.dev — andrewfowl/compound_app_data_api0 reactions
- Sep 5, 2026chore(deps): bump @trigger.dev/react-hooks from 4.5.12 to 4.6.3 — ameisw667/Casino0 reactions · 1 comment
- Sep 1, 2026Bump engine.io, @trigger.dev/python, @trigger.dev/core, @trigger.dev/sdk and @trigger.dev/build — aebq/papermark0 reactions · 1 comment
- Sep 1, 2026chore(deps): bump engine.io and @trigger.dev/sdk — shrikrishna-lab/noska0 reactions · 1 comment
- Sep 1, 2026chore(deps): bump engine.io, @trigger.dev/python, @trigger.dev/core, @trigger.dev/sdk and @trigger.dev/build — Ai-Systems-Australia/papermark0 reactions
- Sep 1, 2026chore(deps): bump engine.io, @trigger.dev/sdk and @trigger.dev/build in /trigger — Gabrielvilabracho/OCR-Prossesin-System0 reactions
- Sep 1, 2026Bump engine.io, @trigger.dev/sdk, @trigger.dev/build and trigger.dev — andrewfowl/compound_app_data_api0 reactions
On Bluesky · 10
- Feb 21, 2026📦 triggerdotdev / trigger.dev ⭐ 13,747 (+48) 🗒 TypeScript Trigger.dev – build and deploy fully‑managed AI agents and workflows — @github-trending-js.bsky.social2 likes and reposts
- Dec 18, 2025📦 triggerdotdev / trigger.dev ⭐ 13,027 (+33) 🗒 TypeScript Trigger.dev – build and deploy fully‑managed AI agents and workflows — @github-trending-js.bsky.social2 likes and reposts
- Jun 3, 2025📦 triggerdotdev / trigger.dev ⭐ 11,333 (+46) 🗒 TypeScript Trigger.dev – open source background jobs and AI infrastructure — @github-trending-js.bsky.social2 likes and reposts
- Aug 19, 2024📦 triggerdotdev / trigger.dev ⭐ 8,006 (+48) 🗒 TypeScript Trigger.dev is the open source background jobs platform for TypeScript. — @github-trending-js.bsky.social2 likes and reposts
- Dec 12, 2023📦 triggerdotdev / trigger.dev ⭐ 6,072 (+32) 🗒 TypeScript ✨ Trigger.dev is the open source background jobs framework for TypeScript. With… — @github-trending-js.bsky.social2 likes and reposts
5 more on Bluesky
- Apr 25, 2026https://github.com/triggerdotdev/trigger.dev — @tom-doerr.bsky.social1 likes and repost
- Nov 11, 2023📦 triggerdotdev / trigger.dev ⭐ 5,676 (+34) 🗒 TypeScript ✨ Trigger.dev is the open source background jobs framework for TypeScript. With… — @github-trending-js.bsky.social1 likes and repost
- Oct 4, 2023🔥 Hot Repo! 🔥 (100+ new stars) 📦 triggerdotdev / trigger.dev ⭐ 4,774 (+170) 🗒 TypeScript ✨ Trigger.dev is the open source background… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Aug 26, 2023📦 triggerdotdev / trigger.dev ⭐ 4,159 (+52) 🗒 TypeScript ✨ Trigger.dev is an open-source platform to create long-running jobs directly in… — @github-trending-js.bsky.social1 likes and repost
- Aug 27, 2025⭐️ Check out and star our open source GitHub repo here: github.com/triggerdotd... — @triggerdev.bsky.social0 likes and reposts · 1 reply
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/executing-commands.mdcCursor rule
- .cursor/rules/migrations.mdcCursor rule
- .cursor/rules/otel-metrics.mdcCursor rule
- .cursor/rules/repo.mdcCursor rule
- .cursor/rules/webapp.mdcCursor rule
- .cursor/rules/writing-tasks.mdcCursor rule
- .cursor/rules/writing-tests.mdcCursor rule
- drizzleSkill
- span-timeline-eventsSkill
- trigger-dev-tasksSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Run everything from the repo root in one shell.
- Very specific: line 197
Run files use a unique $RUN suffix per invocation, so reruns don't collide and seeded rows stay isolated by their unique task identifier.
- Distinctive: line 198
After adding the route files, the classic Remix dev compiler may not register them until a dev-server restart (a stale manifest returns …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Errors API — end-to-end smoke test
Proves the public Errors API against the running webapp with real HTTP. No
mocks. The error data plane is ClickHouse (errors_v1 + error_occurrences_v1,
both materialized-view-fed from task_runs_v2) plus Postgres ErrorGroupState
for lifecycle status; this skill seeds straight into task_runs_v2 and lets the
MVs do the rest.
Code under test:
apps/webapp/app/routes/api.v1.errors.ts—GET /api/v1/errors(list).apps/webapp/app/routes/api.v1.errors.$errorId.ts—GET /api/v1/errors/:errorId(detail).apps/webapp/app/routes/api.v1.errors.$errorId.{resolve,ignore,unresolve}.ts— state actions.apps/webapp/app/presenters/v3/ApiErrorListPresenter.server.ts/ApiErrorGroupPresenter.server.ts.apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts— thefilter[error]addition onGET /api/v1/runs.apps/webapp/app/v3/services/errorGroupActions.server.ts— resolve/ignore/unresolve (nullableuserId).- Attribution:
api.v1.projects.$projectRef.$env.jwt.tsstampsact:{sub}for PAT and UAT exchanges;@trigger.dev/rbacsurfacesact.subthrough bearer auth; the action handlers readauthentication.actor?.sub.
errorId is error_<fingerprint> (round-trips via ErrorId in @trigger.dev/core/v3/isomorphic).
Prerequisites
- Webapp running on http://localhost:3030 (
pnpm run dev --filter webapp). Confirmcurl -s http://localhost:3030/healthcheck. - DB seeded (
pnpm run db:seed), and a local ClickHouse reachable atCLICKHOUSE_URL(thepnpm run dockerstack). - The CLI built + logged in to localhost:3030 (
pnpm run build --filter trigger.dev; profiledefaultpoints at localhost:3030). Needed only for the attribution leg.
Important wiring facts the seed relies on (verified):
- The MVs read the error type/message from
error.data.*, so the seedederrorJSON column must be wrapped:{"data": {"type": ..., "message": ..., "stack": ...}}.- The MVs only fire for failed statuses:
SYSTEM_FAILURE | CRASHED | INTERRUPTED | COMPLETED_WITH_ERRORS | TIMED_OUT, and require a non-emptyerror_fingerprint.GET /api/v1/runslists run ids from ClickHouse but hydrates from PostgresTaskRun. So the error-list/detail/action legs work from a ClickHouse-only seed, but thefilter[error]leg needs a paired PostgresTaskRunrow whoseidequals the ClickHouserun_id.
Run everything from the repo root in one shell. Invoke the built CLI via a
function (a CLI="node …" variable won't word-split under zsh):
cli() { node packages/cli-v3/dist/esm/index.js "$@"; }
PROFILE=defaultSetup — resolve a dev environment + connection strings
cd apps/webapp
CHURL=$(grep -E "^CLICKHOUSE_URL=" .env | head -1 | cut -d= -f2- | tr -d '"')
DBURL=$(grep -E "^DATABASE_URL=" .env | head -1 | cut -d= -f2- | tr -d '"' | tr -d "'" | sed 's/?.*//')
# Pick the seeded hello-world dev env (proj_rrkpdguyagvsoktglnod). Adjust the
# WHERE if you want a different project.
read ENV ORG PROJ REF < <(psql "$DBURL" -t -A -F' ' -c "
SELECT re.id, re.\"organizationId\", re.\"projectId\", p.\"externalRef\"
FROM \"RuntimeEnvironment\" re
JOIN \"Project\" p ON p.id = re.\"projectId\"
WHERE re.slug='dev' AND p.\"externalRef\"='proj_rrkpdguyagvsoktglnod' LIMIT 1;")
APIKEY=$(psql "$DBURL" -t -A -c "SELECT \"apiKey\" FROM \"RuntimeEnvironment\" WHERE id='$ENV';")
cd ..
H="Authorization: Bearer $APIKEY"
B="http://localhost:3030"Steps
1. Seed two error groups (ClickHouse, MV-fed)
RUN=$(node -e 'console.log(Date.now().toString(36))')
TASK="errors-api-e2e-$RUN"; FP_A="fpA${RUN}"; FP_B="fpB${RUN}"
ERRID_A="error_$FP_A"; ERRID_B="error_$FP_B"
NOW_CH=$(node -e 'console.log(new Date().toISOString().replace("T"," ").replace("Z","").slice(0,23))')
NOW_MS=$(node -e 'console.log(Date.now())')
Q=$(python3 -c "import urllib.parse;print(urllib.parse.quote('INSERT INTO trigger_dev.task_runs_v2 FORMAT JSONEachRow'))")
mkrow() { # status fingerprint errorType message runId
echo "{\"environment_id\":\"$ENV\",\"organization_id\":\"$ORG\",\"project_id\":\"$PROJ\",\"run_id\":\"$5\",\"friendly_id\":\"run_$5\",\"status\":\"$1\",\"environment_type\":\"DEVELOPMENT\",\"engine\":\"V2\",\"task_identifier\":\"$TASK\",\"created_at\":\"$NOW_CH\",\"updated_at\":\"$NOW_CH\",\"error\":{\"data\":{\"type\":\"$3\",\"message\":\"$4\",\"stack\":\"at x (a.ts:1:1)\"}},\"error_fingerprint\":\"$2\",\"task_version\":\"20240101.1\",\"_version\":\"$NOW_MS\",\"_is_deleted\":0}"
}
ROWS="$(mkrow COMPLETED_WITH_ERRORS $FP_A AlphaBoom 'alpha boom happened' r_a1_$RUN)
$(mkrow COMPLETED_WITH_ERRORS $FP_A AlphaBoom 'alpha boom happened' r_a2_$RUN)
$(mkrow CRASHED $FP_B BetaCrash 'beta crash happened' r_b1_$RUN)"
printf '%s' "$ROWS" | curl -s "$CHURL/?query=$Q" --data-binary @-
# Poll until both fingerprints appear in errors_v1 (the MV is near-instant locally).
for i in $(seq 1 10); do
N=$(curl -s "$CHURL" --data-binary "SELECT count() FROM (SELECT 1 FROM trigger_dev.errors_v1 WHERE environment_id='$ENV' AND error_fingerprint IN ('$FP_A','$FP_B') GROUP BY error_fingerprint)")
[ "$N" = "2" ] && break; sleep 1
done
echo "seeded fingerprints in errors_v1: $N (want 2)"PASS: N = 2. Alpha has 2 occurrences, beta 1.
2. List + filters + pagination
curl -s "$B/api/v1/errors?filter%5BtaskIdentifier%5D=$TASK&filter%5Bperiod%5D=1d" -H "$H" \
| python3 -c "import sys,json;d=json.load(sys.stdin);print('count',len(d['data']),[(e['id'],e['status'],e['count']) for e in d['data']])"PASS: 2 groups, both status=unresolved, alpha count=2, beta count=1, ids error_<fp>.
Assert each filter narrows correctly (each should return the noted shape):
curl -s "$B/api/v1/errors?filter%5BtaskIdentifier%5D=$TASK&filter%5Bstatus%5D=unresolved&filter%5Bperiod%5D=1d" -H "$H" | python3 -c "import sys,json;print('unresolved:',len(json.load(sys.stdin)['data']))" # 2
curl -s "$B/api/v1/errors?filter%5BtaskIdentifier%5D=$TASK&filter%5Bsearch%5D=AlphaBoom&filter%5Bperiod%5D=1d" -H "$H" | python3 -c "import sys,json;print('search:',[e['errorType'] for e in json.load(sys.stdin)['data']])" # ['AlphaBoom']
curl -s "$B/api/v1/errors?filter%5BtaskIdentifier%5D=$TASK&filter%5Bperiod%5D=1d&page%5Bsize%5D=1" -H "$H" | python3 -c "import sys,json;d=json.load(sys.stdin);print('page size 1:',len(d['data']),'next?',bool(d['pagination'].get('next')))" # 1 / TruePASS: unresolved: 2, search: ['AlphaBoom'], page size 1: 1 / next? True.
3. Retrieve detail
curl -s "$B/api/v1/errors/$ERRID_A" -H "$H" \
| python3 -c "import sys,json;d=json.load(sys.stdin);print(d['id'],d['errorType'],d['status'],d['count'],d['affectedVersions'],d['resolvedBy'])"PASS: error_<fpA> AlphaBoom unresolved 2 ['20240101.1'] None.
4. Resolve / ignore / unresolve (env API key — resolvedBy null)
st(){ python3 -c "import sys,json;d=json.load(sys.stdin);print('status',d['status'],'| resolvedInVersion',d['resolvedInVersion'],'| resolvedBy',d['resolvedBy'],'| ignoredUntil',bool(d['ignoredUntil']),'| reason',d['ignoredReason'])"; }
curl -s -X POST "$B/api/v1/errors/$ERRID_A/resolve" -H "$H" -H 'Content-Type: application/json' -d '{"resolvedInVersion":"20240101.1"}' >/dev/null
curl -s "$B/api/v1/errors/$ERRID_A" -H "$H" | st # status resolved | resolvedInVersion 20240101.1 | resolvedBy None
curl -s -X POST "$B/api/v1/errors/$ERRID_B/ignore" -H "$H" -H 'Content-Type: application/json' -d '{"duration":3600000,"reason":"known flake"}' >/dev/null
curl -s "$B/api/v1/errors/$ERRID_B" -H "$H" | st # status ignored | ignoredUntil True | reason known flake
curl -s -X POST "$B/api/v1/errors/$ERRID_A/unresolve" -H "$H" >/dev/null
curl -s "$B/api/v1/errors/$ERRID_A" -H "$H" | st # status unresolvedPASS: each transition reflected; filter[status]=ignored returns only beta:
curl -s "$B/api/v1/errors?filter%5BtaskIdentifier%5D=$TASK&filter%5Bstatus%5D=ignored&filter%5Bperiod%5D=1d" -H "$H" | python3 -c "import sys,json;print([e['id'] for e in json.load(sys.stdin)['data']])" # [error_<fpB>]5. filter[error] on the runs list (paired PG + CH seed)
The runs list hydrates from Postgres, so seed a matching TaskRun row + a CH row
that share run_id/id and carry a fingerprint:
RID="re2e${RUN}"; FRID="run_${RID}"; FP_R="fpR${RUN}"
psql "$DBURL" -v ON_ERROR_STOP=1 -c "
INSERT INTO \"TaskRun\" (id, \"friendlyId\", \"taskIdentifier\", payload, \"traceId\", \"spanId\", \"runtimeEnvironmentId\", \"projectId\", queue, status, \"createdAt\", \"updatedAt\")
VALUES ('$RID','$FRID','$TASK','{}','trace_$RID','span_$RID','$ENV','$PROJ','task/$TASK','COMPLETED_WITH_ERRORS', now(), now())
ON CONFLICT (id) DO NOTHING;" >/dev/null
ROW="{\"environment_id\":\"$ENV\",\"organization_id\":\"$ORG\",\"project_id\":\"$PROJ\",\"run_id\":\"$RID\",\"friendly_id\":\"$FRID\",\"status\":\"COMPLETED_WITH_ERRORS\",\"environment_type\":\"DEVELOPMENT\",\"engine\":\"V2\",\"task_identifier\":\"$TASK\",\"created_at\":\"$NOW_CH\",\"updated_at\":\"$NOW_CH\",\"error\":{\"data\":{\"type\":\"RunsFilterErr\",\"message\":\"for runs filter\",\"stack\":\"at x\"}},\"error_fingerprint\":\"$FP_R\",\"task_version\":\"20240101.1\",\"_version\":\"$NOW_MS\",\"_is_deleted\":0}"
printf '%s' "$ROW" | curl -s "$CHURL/?query=$Q" --data-binary @-
sleep 1
curl -s "$B/api/v1/runs?filter%5Berror%5D=error_$FP_R" -H "$H" | python3 -c "import sys,json;d=json.load(sys.stdin);print('runs:',[r['id'] for r in d['data']])"PASS: one run, run_<RID> (status maps to FAILED). Proves filter[error] -> fingerprint -> CH -> PG hydration.
6. Attribution — mint-token -> JWT exchange records the acting user
TOKEN=$(cli mint-token --profile $PROFILE --client errors-api-e2e --cap read:errors,write:errors 2>/dev/null) # UAT
ENVJWT=$(curl -sS -X POST "$B/api/v1/projects/$REF/dev/jwt" -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' -d '{"claims":{"scopes":["read:errors","write:errors"]}}' \
| python3 -c "import sys,json;print(json.load(sys.stdin)['token'])")
# Decoded env JWT carries act.sub = the user id.
node -e 'const p=JSON.parse(Buffer.from(process.argv[1].split(".")[1],"base64url").toString());console.log("act:",JSON.stringify(p.act))' "$ENVJWT"
curl -s -X POST "$B/api/v1/errors/$ERRID_A/resolve" -H "Authorization: Bearer $ENVJWT" \
-H 'Content-Type: application/json' -d '{"resolvedInVersion":"20240101.2"}' >/dev/null
curl -s "$B/api/v1/errors/$ERRID_A" -H "$H" | python3 -c "import sys,json;d=json.load(sys.stdin);print('resolvedBy:',d['resolvedBy'])"PASS: act.sub is the user id (matches cli whoami), and detail.resolvedBy equals that user id (not null). A plain env key leaves it null (step 4). A PAT exchanged the same way also stamps act — repeat with the stored PAT to confirm ignoredByUserId attribution.
7. Negatives
curl -s -o /dev/null -w 'unknown id: %{http_code} (404)\n' "$B/api/v1/errors/error_doesnotexist0000" -H "$H"
curl -s -o /dev/null -w 'no auth list: %{http_code} (401)\n' "$B/api/v1/errors"
curl -s -o /dev/null -w 'no auth resolve: %{http_code} (401)\n' -X POST "$B/api/v1/errors/$ERRID_B/resolve" -H 'Content-Type: application/json' -d '{}'
# read-only JWT must be denied on write, allowed on read
READJWT=$(curl -sS -X POST "$B/api/v1/projects/$REF/dev/jwt" -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' -d '{"claims":{"scopes":["read:errors"]}}' | python3 -c "import sys,json;print(json.load(sys.stdin)['token'])")
curl -s -o /dev/null -w 'read JWT write: %{http_code} (403)\n' -X POST "$B/api/v1/errors/$ERRID_B/resolve" -H "Authorization: Bearer $READJWT" -H 'Content-Type: application/json' -d '{}'
curl -s -o /dev/null -w 'read JWT read: %{http_code} (200)\n' "$B/api/v1/errors?filter%5BtaskIdentifier%5D=$TASK" -H "Authorization: Bearer $READJWT"PASS: 404, 401, 401, 403, 200 respectively.
Result
Report PASS only if: step 1 lands 2 groups in errors_v1; step 2's filters and
pagination narrow correctly; step 3 returns the detail; step 4's resolve/ignore/
unresolve flip status (and filter[status] follows); step 5's filter[error]
returns the paired run; step 6 records resolvedBy = the acting user via the
JWT exchange (null with a plain env key); and step 7 returns 404/401/401/403/200.
A red leg is a bug or a missing prereq — report the exact status + body and file
a Linear issue, don't tune around it.
Notes / gotchas
- Run files use a unique
$RUNsuffix per invocation, so reruns don't collide and seeded rows stay isolated by their unique task identifier. They are local-dev test rows (90-day ClickHouse TTL); no cleanup required. - After adding the route files, the classic Remix dev compiler may not register them until a dev-server restart (a stale manifest returns Remix's HTML 404 on the new paths). If
POST …/resolvereturns a 404 HTML page rather than 401/200, restartpnpm run dev --filter webapp. - The rbac
actextraction lives in@trigger.dev/rbac(a built dep). After editing it,pnpm run build --filter @trigger.dev/rbacand restart the webapp so the attribution leg (step 6) reflects the change.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

