Skip to content

refactor(instagram): align publishing with codebase patterns - #6270

Open
BillLeoutsakosvl346 wants to merge 2 commits into
stagingfrom
refactor/instagram-codebase-alignment
Open

refactor(instagram): align publishing with codebase patterns#6270
BillLeoutsakosvl346 wants to merge 2 commits into
stagingfrom
refactor/instagram-codebase-alignment

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • preserve all 24 Instagram operations while standardizing publishing on canonical Sim file inputs
  • move server-only publishing behavior into a provider-local helper and keep publishing routes thin
  • remove unreleased URL/string compatibility paths and low-value configuration-restatement tests
  • keep direct Graph tools, custom Instagram OAuth, download persistence, polling, and file safety behavior intact

Why

Instagram had accumulated provider-specific input formats and duplicated server plumbing that differed from established Sim integration patterns. Because the integration is unreleased, the cleanup can remove those compatibility formats without migrations or aliases.

Validation

  • 90 focused Instagram and OAuth tests
  • Instagram deployment-availability regression suite
  • TypeScript type-check
  • format and lint checks
  • API-contract, bare-icon, client-boundary, and registry-boundary checks
  • tool metadata generation/check and integration catalog check
  • validate-integration and memory-load audit
  • independent gpt-5.6-sol max review: no remaining actionable findings

No Instagram triggers or shared platform changes are included.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 4, 2026 11:54pm

Request Review

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

PR Summary

Cursor Bugbot is generating a summary for commit b706259. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR standardizes Instagram publishing operations on canonical Sim file inputs and consolidates server-only media resolution and Graph publishing helpers into a provider-local module.

  • Aligns image, video, reel, story, and carousel tool parameters with shared file schemas.
  • Moves publishing lifecycle helpers behind thin authenticated API routes.
  • Updates Instagram block metadata, API contracts, generated tool metadata, and focused tests.
  • Removes unreleased URL and string compatibility paths while retaining all 24 operations.

Confidence Score: 5/5

The PR appears safe to merge, with no changed-code-triggered correctness or security failures identified.

The canonical file shapes remain consistent across block normalization, tool request construction, API contract validation, route handling, file resolution, and Graph publishing, while relocated publishing helpers preserve base-branch behavior.

Important Files Changed

Filename Overview
apps/sim/app/api/tools/instagram/server-utils.ts Consolidates server-only file resolution and Graph publishing helpers while preserving the existing publishing lifecycle.
apps/sim/lib/api/contracts/tools/instagram.ts Replaces publishing URL/string input schemas with shared canonical RawFileInput schemas and bounded file arrays.
apps/sim/blocks/blocks/instagram.ts Aligns publishing block parameters with canonical file inputs and keeps all Instagram operations registered.
apps/sim/tools/instagram/publish_carousel.ts Passes canonical file arrays directly through the carousel publishing request.
apps/sim/tools/instagram/types.ts Updates publishing parameter types to use canonical single-file and file-array representations.

Sequence Diagram

sequenceDiagram
  participant Workflow as Workflow executor
  participant Tool as Instagram publish tool
  participant Route as Publishing API route
  participant Files as Sim file storage
  participant Meta as Instagram Graph API

  Workflow->>Tool: Canonical Sim file input
  Tool->>Route: Authenticated publish request
  Route->>Files: Resolve file to signed HTTPS URL
  Files-->>Route: Signed media URL
  Route->>Meta: Create media container
  loop Until ready
    Route->>Meta: Read container status
    Meta-->>Route: IN_PROGRESS or FINISHED
  end
  Route->>Meta: Publish container
  Meta-->>Route: Published media ID
  Route-->>Tool: Container ID, media ID, status
Loading

Reviews (1): Last reviewed commit: "fix(instagram): remove stale cover strin..." | Re-trigger Greptile

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