Skip to content

Simplify TikTok to draft-only Content Posting#5703

Open
BillLeoutsakosvl346 wants to merge 2 commits into
stagingfrom
chore/tiktok-simplify
Open

Simplify TikTok to draft-only Content Posting#5703
BillLeoutsakosvl346 wants to merge 2 commits into
stagingfrom
chore/tiktok-simplify

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • Remove unused TikTok Direct Post stubs and collapse publish-video to a draft-only { accessToken, file } contract
  • Remove legacy Share Kit / Video Kit webhook triggers (video.publish.completed, video.upload.failed) and related provider shareId paths
  • Keep Content Posting draft upload, read/query tools, Query Creator Info, and post.publish.* + authorization.removed triggers
  • Fix draft upload response handling so real TikTok errors are not misreported as size-limit failures

Test plan

  • Run focused Vitest suite for TikTok tools/contracts/route/provider/block
  • Connect a TikTok credential and run Upload Video Draft with a small MP4
  • Confirm Get Post Status tracks the returned publishId
  • Confirm TikTok trigger dropdown no longer lists Video Publish Completed / Video Upload Failed
  • Confirm Direct Post is not present in the TikTok block operation list
  • Spot-check a Content Posting webhook (post.publish.inbox_delivered or post.publish.complete) still formats correctly

Made with Cursor

Remove Direct Post stubs and legacy Share Kit webhook triggers that Sim does not ship, and fix draft upload response handling so real TikTok errors are not misreported as size-limit failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 16, 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 Jul 16, 2026 5:13am

Request Review

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reduces TikTok content posting to draft uploads. The main changes are:

  • Removes the Direct Post tool, request fields, and registry entries.
  • Removes legacy Video Kit triggers and shareId handling.
  • Exposes the remaining TikTok block in the toolbar.
  • Improves bounded response reading and TikTok error messages.

Confidence Score: 4/5

Legacy Direct Post requests can run as draft uploads, and stored legacy trigger IDs can break or stop firing.

  • The simplified schema strips mode: 'direct' instead of rejecting it.
  • Deleted trigger IDs have no migration path for saved workflows and subscriptions.
  • The response-stream and TikTok error-handling changes are consistent with their callers.

apps/sim/lib/api/contracts/tiktok-tools.ts and apps/sim/triggers/registry.ts

Important Files Changed

Filename Overview
apps/sim/lib/api/contracts/tiktok-tools.ts Simplifies the publish body, but silently accepts legacy Direct Post fields and changes their behavior.
apps/sim/app/api/tools/tiktok/publish-video/route.ts Removes Direct Post rejection and improves TikTok initialization error reporting.
apps/sim/tools/index.ts Forwards the reconstructed response stream to tool response transformers.
apps/sim/lib/core/utils/stream-limits.ts Allows the requested text fallback when a response has no body stream.
apps/sim/triggers/registry.ts Deletes legacy trigger definitions without a compatibility path for stored trigger IDs.
apps/sim/lib/webhooks/providers/tiktok.ts Removes formatting and idempotency behavior for the retired Video Kit events.

Reviews (1): Last reviewed commit: "Simplify TikTok to draft-only Content Po..." | Re-trigger Greptile

Comment on lines 9 to 12
export const tiktokPublishVideoBodySchema = z.object({
accessToken: z.string().min(1, 'Access token is required'),
file: RawFileInputSchema,
})

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.

P1 Direct Requests Become Draft Uploads

A caller that still sends mode: 'direct' with Direct Post metadata now passes this schema because z.object strips those unknown fields. The route no longer has the direct-mode guard, so a request that previously returned 400 can upload the video as a draft and report success under different semantics.

Comment on lines 709 to 710
tiktok_post_publicly_available: tiktokPostPubliclyAvailableTrigger,
tiktok_post_publish_complete: tiktokPostPublishCompleteTrigger,

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.

P1 Stored Trigger IDs Lose Their Definition

A saved workflow or webhook subscription can still contain tiktok_video_publish_completed or tiktok_video_upload_failed. Removing both registry entries without migrating that stored state makes trigger lookup throw when the workflow is loaded, while webhook matching for the same IDs returns false and silently discards later events.

Reject legacy mode:direct publish requests instead of silently drafting, keep deprecated Share Kit triggers registered for saved workflows, and apply biome format/import fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
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