Repository navigation
feat(connector): add Trigger.dev data-source connector (cognee#6197) - #464
Open
JakkulaVeerababu wants to merge 5 commits into
Open
JakkulaVeerababu wants to merge 5 commits into
JakkulaVeerababu wants to merge 5 commits into
Conversation
Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
…ctor Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
The first version called endpoints that do not exist (/api/v1/tasks, /api/v3/schedules, a runs list at /api/v3/runs with limit/cursor), and a failed listing was treated as empty, which tombstoned every stored task and schedule. Its tests replaced the whole client with a fake, so none of this showed. - Read schedules (page/perPage + totalPages), error groups, runs and deployments (page[size]/page[after]) as documented; retrieve a failed run once for its last attempt's error. - Forget a schedule only after a complete listing and a 404 on GET by id; a failed or partial listing fails the run and forgets nothing. - Errors, runs and deployments are history: read the last lookback_days, keep them in memory once they age out, drop their fingerprints from state. - Stop cleanly on 429, a spent budget or a key revoked mid-run; never sleep on a rate limit. api_url must be an https origin. - Never render payloads, outputs, costs or a deployment's git remoteUrl; nothing volatile (nextRun, occurrence counts, live durations). - Per-row node sets (triggerdev:task:<id>) so search can stay in one task. - Tests run the real client against an HTTP-level fake that refuses unknown query parameters, plus cognee.add() runs for forget-on-delete, failed listings, rate-limit resume and two environments in one dataset. - Drop the committed test screenshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
…ns them
A live test against a Trigger.dev dev environment showed that GET /api/v3/runs/{id} returns the error at the top level with attemptCount, and an empty attempts list, so failed-run documents had no error. Read the top-level error first and fall back to attempts. Show short durations in ms instead of 0.0s, and keep only up to 5 frames of the task's own code from a stack trace, with short file paths.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
Resolve the README conflict: main moved connectors into the new Data-Source Connectors table, so add the Trigger.dev row there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: VeeraBabu Jakkula <squadpanda447@gmail.com>
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 this adds
A Trigger.dev data-source connector for cognee (related to topoteretes/cognee#6197).
triggerdev_source(...)returns a dlt resource forcognee.remember()that syncs one Trigger.dev environment into memory:Each record is one document, tagged with the node set
triggerdev:task:<task id>.Never stored: run payloads, outputs and metadata (customer data), costs, and a deployment's git
remoteUrl(it can carry a token). Volatile fields (next run, error counts, a live run's duration) are not rendered, so an unchanged record is never sent again.Changes since the first version
The first version of this PR did not work against the real API. It called endpoints that don't exist, treated a failed listing as empty (which would have deleted everything already stored), and its tests replaced the whole HTTP client, so none of this showed. It is now rebuilt on the documented management API:
lookback_days(default 7) and keeps older records in memory.api_urlmust be an https origin, and the key never appears in logs or error messages.Live test
I ran it against a Trigger.dev Cloud dev environment (SDK 4.8.1) with two schedules and three failing runs:
GET /api/v3/runs/{id}returns the error at the top level withattemptCount, andattemptsis empty, so failed-run documents had no error. Fixed in the second commit: the top-level error is read first, withattemptsas a fallback. The same commit shows short durations in ms instead of0.0s, and keeps only up to 5 stack frames from the task's own code with short file paths (the live trace was mostly runtime frames and carried the local folder path).Not tested live: deployments, since a dev environment has none.
Tests
cd packages/connector/triggerdev uv run --with pytest --with pytest-asyncio pytest tests/83 tests pass, and
ruff checkandruff format --checkare clean. The tests run the real client against an HTTP-level fake that answers with the API's response shapes and rejects unknown query parameters, pluscognee.add()runs that check forget-on-delete, failed listings, rate-limit resume and two environments in one dataset.I built this with help from Claude Code (the commits carry a Co-Authored-By trailer). I went through every part of it and ran the live test myself.
I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.