Skip to content

🗃️ feat: Retain Agent Files During All-Data Retention#13477

Merged
danny-avila merged 2 commits into
devfrom
danny-avila/retain-agent-files-retention-exemption
Jun 2, 2026
Merged

🗃️ feat: Retain Agent Files During All-Data Retention#13477
danny-avila merged 2 commits into
devfrom
danny-avila/retain-agent-files-retention-exemption

Conversation

@danny-avila

Copy link
Copy Markdown
Owner

Summary

I added an explicit interface.retainAgentFiles option so operators can keep persistent agent resources while retentionMode: "all" still expires non-agent data.

  • Added retainAgentFiles to the interface schema and runtime interface config loading.
  • Updated persistent agent file retention handling so the flag preserves agent uploads under all-data retention while keeping the default 🗄️ refactor: Honor All-Data Retention for Agent Files #13424 behavior unchanged.
  • Documented the YAML option and expanded tests for schema acceptance, config loading, agent upload behavior under both retention modes, and non-agent all-data expiry.

Change Type

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Testing

  • Ran npm run build:data-provider
  • Ran npm run build:data-schemas
  • Ran npm run build:api
  • Ran cd api && npx jest server/services/Files/process.spec.js --runInBand
  • Ran cd packages/data-provider && npx jest specs/config-schemas.spec.ts --runInBand
  • Ran cd packages/data-schemas && npx jest src/app/interface.spec.ts --runInBand

Test Configuration:

  • Local workspace dependencies installed with npm ci

Checklist

  • My code adheres to this project style guidelines
  • I have performed a self-review of my own code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Copilot AI review requested due to automatic review settings June 2, 2026 18:16

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI 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.

Pull request overview

Adds an operator-facing interface.retainAgentFiles flag that allows persistent agent resource uploads to remain non-expiring even when retentionMode: "all" is enabled, while preserving the existing default behavior when the flag is unset/false.

Changes:

  • Extends the interface config schema + runtime interface config loading to include retainAgentFiles.
  • Updates file retention handling for persistent agent resource uploads to optionally skip retention metadata under all-data retention.
  • Documents the new YAML option and expands unit tests across schema/config loading and file retention behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/data-schemas/src/app/interface.ts Whitelists retainAgentFiles into the runtime interfaceConfig returned by loadDefaultInterface().
packages/data-schemas/src/app/interface.spec.ts Adds coverage to ensure retainAgentFiles is preserved when configured (with retentionMode: all).
packages/data-provider/src/config.ts Extends interfaceSchema to accept retainAgentFiles.
packages/data-provider/specs/config-schemas.spec.ts Adds schema parsing test for retainAgentFiles under all-data retention.
librechat.example.yaml Documents the retainAgentFiles option and its intended effect under retentionMode: "all".
api/server/services/Files/process.js Introduces shouldRetainPersistentAgentFile() and uses it to skip retention metadata for persistent agent resource uploads when configured.
api/server/services/Files/process.spec.js Expands retention tests to cover retain/expire behavior based on retentionMode and retainAgentFiles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13477 index is now live on the MCP server.
Deploy run

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila
danny-avila changed the base branch from main to dev June 2, 2026 19:03
@danny-avila
danny-avila marked this pull request as ready for review June 2, 2026 19:04
@danny-avila
danny-avila merged commit 8ba0249 into dev Jun 2, 2026
17 checks passed
@danny-avila
danny-avila deleted the danny-avila/retain-agent-files-retention-exemption branch June 2, 2026 19:04
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request Jun 4, 2026
)

* feat: add agent file retention exemption

* refactor: centralize agent file retention policy
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
)

* feat: add agent file retention exemption

* refactor: centralize agent file retention policy
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