Skip to content

fix(files): hydrate chat attachments and reject blank download URLs - #7870

Merged
icecrasher321 merged 2 commits into
stagingfrom
codex/fix-mothership-file-materialization
Sep 16, 2026
Merged

icecrasher321 merged 2 commits into
stagingfrom
codex/fix-mothership-file-materialization

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Resolve stored attachment ownership from canonical metadata so deployed agents can hydrate remembered chat uploads under workspace authority, while preserving explicit file/chat scope and strict workspace-file APIs.
  • Reject empty and whitespace-only download URLs before previews, direct requests, or authentication fallback can fetch the chat page.

Type of Change

  • Bug fix

Testing

  • PostgreSQL harness exercises persisted memory, real storage, OpenAI/Anthropic request building, streaming, large-file authorization, and byte-checked OpenAI uploads with mocked provider HTTP.
  • 3,102 tests passed across 204 files, including all 16 PostgreSQL harness cases and the complete internal-file operation suite. The current staging merge candidate also passed all 3,107 tests. App/auth type checks, lint, all 46 repository audits, and docs-manifest validation passed.

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 15, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 16, 2026 12:07am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The pull request appears safe to merge with no actionable correctness, security, or repository-rule violations identified.

Summary

This PR hardens chat attachment hydration and download handling.

  • Resolves persisted workspace and mothership attachments through canonical metadata and workspace authorization.
  • Preserves delegated file and chat scope while preventing known-invalid canonical bindings from falling back to legacy authorization.
  • Rejects empty or whitespace-only external URLs before preview or download requests.
  • Expands coverage for provider attachment handling, sandbox mounts, provenance, and stored-file authorization.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Remembered chat attachment] --> B[Infer workspace storage key]
  B --> C[Load canonical file metadata]
  C --> D{Metadata and workspace valid?}
  D -- No --> E[Return concealed not-found error]
  D -- Yes --> F[Authorize principal and delegated scope]
  F --> G[Recheck canonical identity]
  G --> H[Read or presign stored bytes]
  I[Chat download click] --> J{Valid storage key?}
  J -- Yes --> K[Authenticated serve route]
  J -- No --> L{Nonblank safe HTTP URL?}
  L -- Yes --> M[External download]
  L -- No --> N[Show download error]
Loading

Reviews (2) · Last reviewed commit: "fix(files): preserve concealed canonical..."

@icecrasher321
icecrasher321 force-pushed the codex/fix-mothership-file-materialization branch from 6dd4428 to 7f3a4a8 Compare September 16, 2026 00:07
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 11 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321
icecrasher321 merged commit 21291d7 into staging Sep 16, 2026
34 of 35 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/fix-mothership-file-materialization branch September 16, 2026 02:19

This branch was previously deployed

1 inactive deployment
Preview — 7f3a4a8a Deployed Sep 16, 2026 by vercel[bot]
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