Skip to content

feat(platform): inline file tools and apply public URL rewriting#891

Merged
larryro merged 1 commit into
mainfrom
feat/inline-file-tools-and-public-urls
Mar 27, 2026
Merged

feat(platform): inline file tools and apply public URL rewriting#891
larryro merged 1 commit into
mainfrom
feat/inline-file-tools-and-public-urls

Conversation

@larryro

@larryro larryro commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Inline file tools into chat agent: Replace file agent delegation with direct tool access (pdf, docx, pptx, text, image, excel) in chat agent instructions and system defaults, removing the delegate agent indirection.
  • Apply toPublicUrl() to storage queries: Ensure all ctx.storage.getUrl() results in branding, files, and integrations queries are rewritten to browser-reachable URLs via toPublicUrl().
  • Make toPublicUrl idempotent: Prevent double-rewriting when a URL has already been transformed.

Test plan

  • Verify chat agent uses file tools directly (pdf, docx, pptx, text, image, excel) without delegating to file agent
  • Verify branding logo/favicon URLs are publicly accessible
  • Verify file download URLs work correctly in the browser
  • Verify integration icon URLs resolve properly
  • Run existing unit tests for branding and integrations queries
  • Confirm toPublicUrl is idempotent (calling it twice returns the same result)

Summary by CodeRabbit

Release Notes

  • New Features

    • Chat agent now directly handles PDF, DOCX, PPTX, text, image, and Excel file formats.
  • Improvements

    • Enhanced public URL conversion for storage files to ensure consistent asset loading across branding, files, and integrations.
  • Tests

    • Added mocks for URL transformation logic.

…L rewriting to storage queries

Replace file agent delegation with direct file tool access (pdf, docx, pptx, text, image, excel) in the chat agent instructions and system defaults. Apply toPublicUrl() to all storage URL resolution in branding, files, and integrations queries so URLs are browser-reachable. Make toPublicUrl idempotent to prevent double-rewriting.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f42ebc79-9330-4f95-963b-e04b7f3d474a

📥 Commits

Reviewing files that changed from the base of the PR and between ba5baea and 179838a.

📒 Files selected for processing (8)
  • services/platform/convex/agents/chat/agent.ts
  • services/platform/convex/branding/__tests__/queries.test.ts
  • services/platform/convex/branding/queries.ts
  • services/platform/convex/custom_agents/system_defaults.ts
  • services/platform/convex/files/queries.ts
  • services/platform/convex/integrations/__tests__/queries.test.ts
  • services/platform/convex/integrations/queries.ts
  • services/platform/convex/lib/helpers/public_storage_url.ts

📝 Walkthrough

Walkthrough

The PR refactors file handling by replacing agent delegation with direct use of built-in file tools. Chat agent instructions are updated to explicitly support pdf, docx, pptx, text, image, and excel tools instead of delegating to a file agent. System defaults are adjusted to include these tools and remove file agent delegation. URL handling in branding, file, and integration queries is standardized to convert internal storage URLs to public URLs using a toPublicUrl helper. The helper is updated to ensure idempotent behavior, preventing double-rewrites of URLs that already have the public prefix.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: inlining file tools into the chat agent and applying public URL rewriting across storage URL resolutions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/inline-file-tools-and-public-urls

Comment @coderabbitai help to get the list of available commands and usage tips.

@larryro larryro merged commit 8eb6836 into main Mar 27, 2026
17 checks passed
@larryro larryro deleted the feat/inline-file-tools-and-public-urls branch March 27, 2026 07:31
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