Repository navigation
Delete stored traces and enforce a retention period - #359
Merged
Merged
Conversation
A shared server could store traces but never remove them. Both stores
gain delete_trace (project-scoped, removing findings, usage records and
interventions that compare the trace) and purge_traces (by storage age,
optionally per project). They are exposed as DELETE /v1/traces/{run_id}
for a project key, AgentLoopClient.delete_trace, delete-trace,
remote-delete-trace and purge-traces CLI commands (purge reads
AGENTLOOP_RETENTION_DAYS when no age is given), and a confirmed delete
control on the dashboard Traces page. The cloud stack adds a retention
service that purges daily; CI deletes a trace over HTTPS and checks it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
AgentLoop replay self-testThis required repository check evaluates generated synthetic demo traces. It tests the replay and CI machinery; it does not show that this PR improves application performance. AgentLoop CI Report
Performance Gates
Trace inputsThis comparison includes synthetic data. It does not establish application performance gains from a pull request.
Metric Impact
Top Findings
|
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.
A shared AgentLoop server could store traces (prompts, tool data) but never remove them, although the production guide asks teams to have a deletion policy.
Store (SQLite + Postgres): `delete_trace(run_id, project_id)` deletes the trace and everything derived from it (interventions comparing it, findings, usage events, children first, chunked, one transaction); returns per-table counts, `None` when not in that project. `purge_traces(older_than_days, project_id=None)` deletes by storage age; rejects non-positive/NaN/bool/string ages.
Access
Cloud stack: new `retention` service runs `agentloop purge-traces` daily with `AGENTLOOP_RETENTION_DAYS` (empty keeps traces). CI deploy-stack now deletes a trace over HTTPS (200, then report 404) and checks the retention service applied a 365-day setting.
Tests: store contract (both backends in CI) incl. cross-project refusal and interventions; API, client, CLI and dashboard tests. 234 related tests pass locally. Docs: PRODUCTION (new section), CLOUD_DEPLOY, TRACE_RETENTION pointer, API_VERSIONING, DASHBOARD, changelog.
🤖 Generated with Claude Code