Skip to content

fix(agent): retain conversation memory attachments - #7818

Merged
icecrasher321 merged 1 commit into
stagingfrom
codex/fix-agent-memory-files
Sep 14, 2026
Merged

icecrasher321 merged 1 commit into
stagingfrom
codex/fix-agent-memory-files

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

  • Keep stable attachment references on saved agent messages and reload their bytes on later turns in the same conversation.
  • Preserve file access and secret-provenance checks, rebuild attachments through the selected provider, and bound replay to 20 references within the memory window.
  • Add regression coverage and a PostgreSQL replay harness to CI; document source-file retention and older conversations that require reattachment.

Type of Change

  • Bug fix

Testing

  • Provider, agent, memory, provenance, and hydration regression suite.
  • Eight PostgreSQL harness scenarios covering same-provider and cross-provider replay, streaming, stored metadata/provenance, byte equality, conversation isolation, workflow scope, and deleted files.
  • Live OpenAI replay with and without streaming; Anthropic and cross-provider HTTP responses are simulated in the harness.
  • App type-check, repository lint, all 46 CI audits, block-registry audit, and generated docs-manifest check.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 14, 2026 8:40pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule violations remain.

Summary

This PR retains durable attachment metadata in agent conversation memory and rehydrates authorized file bytes when later turns replay those messages.

  • Moves memory persistence until after current-turn files have been associated with the correct user message.
  • Stores stable file references while removing inline bytes, signed URLs, and provider-specific handles.
  • Reapplies secret-aware filename projection and existing file-scope authorization during replay.
  • Limits replay to 20 attachment references within the selected memory window.
  • Adds provider, provenance, persistence, streaming, PostgreSQL, and cross-provider regression coverage.
  • Documents attachment replay and source-file retention behavior.

Diagram

sequenceDiagram
  participant Run1 as Initial agent run
  participant Memory as Conversation memory
  participant Storage as Authorized file storage
  participant Run2 as Later agent run
  participant Provider as Selected model provider
  Run1->>Memory: Persist message and stable file reference
  Note over Memory: No bytes, signed URL, or provider handle
  Run2->>Memory: Load selected memory window
  Memory-->>Run2: Messages and file references
  Run2->>Storage: Authorize scope and reload file bytes
  Storage-->>Run2: Current file content
  Run2->>Provider: Rebuild provider-specific attachments
  Provider-->>Run2: Model response
Loading

Reviews (1) · Last reviewed commit: "fix(agent): retain conversation memory a..."

@icecrasher321
icecrasher321 merged commit ad05dae into staging Sep 14, 2026
33 checks passed
@icecrasher321
icecrasher321 deleted the codex/fix-agent-memory-files branch September 14, 2026 22:11
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.

1 participant