Fix MCP upload rate limits and Instagram Reel duration caps#205
Merged
paulocastellano merged 17 commits intoJul 25, 2026
Conversation
Key signed uploads by workspace so ChatGPT's shared egress IPs don't throttle tenants together, raise the MCP upload cap to 300MB, and expose accurate Reel max durations via API/MCP. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the separate ai.mcp.upload.max_size_mb default and reuse Media\Type limits so MCP matches web/API (1GB video ceiling with per-type enforcement). Co-authored-by: Cursor <cursoragent@cursor.com>
Keep API media upload settings out of the Laravel AI package config so they are not overwritten on package updates. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep ContentType as the single source of truth and stop hardcoding maxVideoDurationSec in useMediaRules. Co-authored-by: Cursor <cursoragent@cursor.com>
Give ChatGPT's shared egress more headroom across tenants while keeping the per-workspace cap at 60. Co-authored-by: Cursor <cursoragent@cursor.com>
Agents need board_id to publish pins; list boards per connected account so create/update can set platforms[].meta.board_id. Co-authored-by: Cursor <cursoragent@cursor.com>
Stream signed uploads through addMediaFromPath, return per-type max_bytes, harden Pinterest/Discord listing errors and pagination, and keep frontend duration fallbacks when Inertia once-props have not synced. Co-authored-by: Cursor <cursoragent@cursor.com>
Share the full editor rule set (sizes, durations, accepts, aspect bounds) via Inertia so useMediaRules no longer hardcodes MB/GB math, and expose per-type byte caps on API/MCP content-type listings. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace repeated workspace_id checks with PostPolicy-style denyAsNotFound tenancy so cross-tenant lookups stay 404 without leaking existence. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the 20-page hard stop with a while-loop that follows bookmarks to completion, keeping only safety breaks for a repeated cursor or an absurd page ceiling. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep Instagram feed requiring media and Discord/Telegram accepting GIFs after centralization, skip the empty workspace rate-limit bucket, and clear the signed upload claim when persistence fails so retries work. Co-authored-by: Cursor <cursoragent@cursor.com>
…sts. Align editor/API/MCP size ceilings with trypost.media hard caps, return truncated from Pinterest board pagination stop conditions, and rename the signed-upload claim key and rate limiter away from the MCP-only naming. Co-authored-by: Cursor <cursoragent@cursor.com>
getBoards now returns {boards, truncated}; pass only the boards array into Inertia pinterestBoards so post and automation pickers keep receiving an array.
Co-authored-by: Cursor <cursoragent@cursor.com>
Share {boards, truncated} via ListPinterestBoards into Inertia and warn in the board picker when pagination stopped early, matching API/MCP.
Co-authored-by: Cursor <cursoragent@cursor.com>
Empty-account mount was clamping target_slide_count to 0 and never raising it when a media-required account was selected, so Pinterest showed a false requires-media error after picking a board. Co-authored-by: Cursor <cursoragent@cursor.com>
AI generate only produces images, so Video Pin / Reel / TikTok Video are filtered out in previewOnly and rejected server-side with a clear error. Co-authored-by: Cursor <cursoragent@cursor.com>
… API/MCP. GenerateNodeValidator and the Generate UI now respect ContentType::minMediaCount, and content-type listings share accept/min flags via toListingArray(). Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
POST /api/uploads/{token}) by workspace (60/min) with a high IP backstop (1200/min), so ChatGPT’s shared egress no longer buckets all tenants togetherconfig('trypost.media.max_size_mb')viaMedia\Type(video ceiling 1GB); uploads stream to storage viaaddMediaFromPath(no full-filefile_get_contents); failed persist releases the upload claim so retries workRequestMediaUploadToolreturnsmax_bytes+max_bytes_by_typeso agents preflight image/PDF/video correctlyContentType, clamped to hard upload caps, and shared via Inertia / API / MCP — Instagram Reel → 15 min, Facebook Reel stays 90 smeta.board_id/meta.channel_id); boards follow Pinterest bookmark pagination and return{boards, truncated}; web board picker warns when truncatedconfig/trypost.php(MEDIA_SIGNED_UPLOAD_URL_TTL_MINUTES, legacy fallbackMCP_UPLOAD_URL_TTL_MINUTES)SocialAccountPolicy(404 deny-as-not-found for cross-tenant)Ops / deploy notes
upload_max_filesize,post_max_size, andclient_max_body_sizeAutomated tests
truncatedManual test plan
Ops
/api/uploads/{token}under ChatGPT batch uploadsMCP / ChatGPT
list-content-types: Instagram Reelmax_video_duration_sec= 900, Facebook Reel = 90list-pinterest-boardsfor a connected account → pick aboard_id→ create/schedule a Pinterest pin withplatforms[].meta.board_idand confirm it publishes to the right boardlist-discord-channels→ pick achannel_id→ create/schedule a Discord post withplatforms[].meta.channel_idand confirm it lands in the right channelboard_idand confirm the validation error is clearWeb app
Automation editor