The raw error can carry the token request body (client secret, refresh
token) on providers whose refresh fails through the base fetch or a client
library. Log the message, HTTP status and the token endpoint's response
body instead, which is what makes the failure diagnosable.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Tolerating unrecognized refresh errors everywhere meant a dead token on a
provider without a handleErrors override was never flagged: the refresh
that follows a rejected post went through the same code and stayed silent.
The refresh service now takes a tolerateUnknownErrors flag, off by default.
The refreshToken activity turns it on only when the calling workflow is
refreshTokenWorkflow, read from the activity context, so post workflows of
every version (including the still-running v1.0.1 runs that share this
activity) keep disconnecting after a rejected post.
Also add 'disconnect' to the optional handleErrors interface type, which the
base class returns since this branch was opened.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Mirror the subreddit_type === 'public' filter of the search path so a
pasted r/name that points at a private, restricted or archived
subreddit is not offered as a destination the post would fail on.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Slack provider sends every attachment as a Block Kit image block,
which Slack only accepts for png / jpg / gif. An mp4 made
chat.postMessage reject the whole message, and the post was still
shown as published.
Add a checkValidity override so a Slack post or comment with an mp4
attachment fails validation with "No video support for Slack, only
images" in the composer, the public API and the MCP schedule tool.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Slack answers HTTP 200 with { ok: false, error } when it rejects a
message. post() and comment() destructured ts off that body and returned
status 'posted' regardless, so a rejected post (e.g. invalid_blocks for
an mp4 in an image block) was marked PUBLISHED with an empty release
URL and nothing in the channel.
Check the response after both chat.postMessage calls: auth errors throw
RefreshToken, ratelimited is retried, everything else throws BadBody
with Slack's error code and detail lines as the message.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The composer's "Search Subreddit" box sent the typed text verbatim to
Reddit's subreddit search. A pasted reddit.com/r/<name> URL matched
nothing, so there was no result to pick and the subreddit setting was
saved empty, which then failed validation with "value should not be
null or undefined".
When the text contains r/<name>, search by the name alone and put the
exact subreddit first in the results if it exists. Plain text still
sends the same search request as before, and the exact lookup only
swallows a not-found response so token refresh keeps working.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A customer reported that their Facebook posts show no statistics at all;
every one of their Facebook posts is a reel. The video_insights edge
answers a reel with an empty data array for total_video_impressions,
total_video_views and total_video_reactions_by_type_total, so
videoPostAnalytics returned [] and the statistics modal stayed empty.
Verified against a real reel: the same request with fb_reels_total_plays,
post_video_likes_by_reaction_type and post_video_social_actions returns
values, and Graph simply omits whichever metrics do not apply to the
node, so both sets are now requested in one call. Regular videos keep
their existing cases; the new ones map to Plays, Reactions and
Engagement.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wvGQeFVP1UKfi9VAYYBYK
A response without a post (data: null with no errors array, or a null
publishPost/post) threw a TypeError on destructuring, which is retried and
re-sends the publish mutation. Treat it as BadBody like the errors case.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Hashnode retired gql.hashnode.com on 2026-05-13: every request now gets a
301 to an announcement page, so connecting a channel failed with "Invalid
credentials" for every key, and publishing failed for existing channels.
- point the three calls (authenticate, publications, post) at
gql-beta.hashnode.com
- send tags as { slug } (PublishPostTagInput no longer has id); the slug is
looked up by objectID from the existing tags list, so stored posts keep
working
- send the cover as coverImage (coverImageOptions was removed from
PublishPostInput)
- read the GraphQL errors array and throw BadBody with Hashnode's message.
Hashnode answers HTTP 200 with data: null for refusals such as a
publication without an active Pro plan, which used to surface as a
TypeError, get retried, and end as "couldn't confirm it was published"
Fixes#1737
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The release URL for every Google My Business post was a hardcoded
https://business.google.com/locations/<locationId> link, which Google
answers with a 404, even for the logged-in profile owner. That link is
what the "published" notification email and the preview point to.
localPosts.create returns a searchUrl for the created post; use it as
the release URL and keep the old link only as a fallback when Google
does not send one.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
createPost writes one post per channel, so a failure on a later channel left
the earlier drafts in place while the released claim let a retry create them
again. The claim now stays, the free slot is looked up before it is taken, and
each channel is drafted on its own so one failing channel does not drop the rest.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- createClips takes the row of the clipping before looking for clips, so a
timed out attempt and its retry can no longer both store a set
- a clip is claimed (draftedAt off null) before its draft is created and
released when creation fails, so a retry cannot draft it twice
- urls are stripped from the logged processor failure
- Turkish billing label reads correctly after the number
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Turns a YouTube video into captioned vertical clips that land in the media
library and as draft posts. Adds the Clipping / ClippingClip models, the
clipping_minutes credit type, clippingWorkflow + per-clip child workflows,
the /clipping REST routes, the MCP clipping tools and the ui://postiz/clipping
status widget.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
MCP has no way to send a file from the user's device, so add an MCP Apps
(SEP-1865) widget: uploadWidgetTool renders ui://postiz/upload, the widget
gets a short-lived ticket through the app-only uploadWidgetTicketTool and
posts the file to /media-widget/upload, then reports the media back to the
model. uploadWidgetStatusTool is the host-independent fallback.
The widget tools are mcpOnly, so the in-app agent keeps its current toolset.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The MCP server is stateless, so the GET that streamable-HTTP clients send
to open a server-to-client stream is not a supported route: nothing is
ever pushed on it. It is still about a quarter of MCP traffic (roughly
180k-214k of ~750k requests per day), and each one became a Sentry
transaction that stayed open for the life of the held connection
(avg ~5 min, p95 15 min).
Sentry usage is already near its limits, which is why #2082 recently cut
trace sampling from 100% to 20%. There is nothing to learn from traces of
an unsupported route, so tracesSampler now returns 0 for GET on /mcp,
/mcp/:id and the /mcp-oauth* mounts. POST traffic on the same routes, the
legacy /sse/:id transport and the /.well-known discovery routes keep the
existing sample rates.
Pairs with the change that answers these GETs with 405. Deploy this one
after that change has been verified in Sentry, because the verification
reads the GET transactions this commit removes.
Testing:
- Called the real tracesSampler with request contexts shaped like the
http instrumentation passes them (method and URL via normalizedRequest
and via span attributes only): GET on the MCP routes returns 0; POST on
the same routes 0.2; unrelated GETs 0.2; analytics 0.01; legacy /sse
0.2; /.well-known/.../mcp-oauth discovery 0.2; /mcpfoo 0.2.
- Ran the backend against a Sentry development environment and sent
140+ GETs and 60+ POSTs to /mcp, /mcp/:id and /mcp-oauth-claude: zero
GET transactions recorded, POST /mcp and POST /mcp/:id recorded as
before. Same result on SDK 10.45.0 and 10.56.0.
- Backend type-check passes.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
analytics() destructured only `data` from the page insights response, so any
Graph error body (rate limit, permission, invalid metric) silently became []
and checkAnalytics cached that empty result for an hour. Log the error and
throw, so checkAnalytics skips the cache write and the next call retries.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The mastra_* tables are now mirrored in schema.prisma, so prisma db push
creates them before the backend starts and the init race cannot happen.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
prisma-db-push runs with --accept-data-loss on deploy, so anything Mastra
created that the schema did not mirror (37 tables, 31 columns) was dropped
and rebuilt by @mastra/pg on the next boot, which is where instances raced
on ALTER TABLE ADD COLUMN. The mastra_* models are now introspected from a
database migrated by @mastra/pg 1.25, so db push creates them before the
backend starts and Mastra's init finds nothing to alter. Existing mirrored
columns are unchanged; migrate diff against a migrated DB is empty.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mastra/pg checks for a column against a schema snapshot and then runs a
plain ALTER TABLE ADD COLUMN, so instances migrating at the same time race
and the loser throws 'column "organizationId" ... already exists' into the
first user request. Init now runs when the Mastra instance is created and
retries once against the already migrated schema.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
OpenAI kept serving its cached copy of the /mcp-oauth authorization server
metadata, so the ChatGPT app submission moves to a fresh path with its own
issuer (no registration_endpoint, pre-defined client credentials).
/mcp-oauth stays available on the dynamic issuer for connectors that were
created against it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The OpenAI Apps builder auto-selects DCR whenever the discovered
authorization server advertises a registration_endpoint. /mcp-oauth is the
ChatGPT app submission path and should default to the pre-defined client
credentials, so it now has its own RFC 8414 issuer without the registration
endpoint. /mcp-oauth-claude and /mcp-oauth-dynamic point at a second issuer,
/mcp-oauth-dynamic, that still advertises DCR for Claude, Cursor and other
self-registering clients. Both issuers share the same authorize, token and
userinfo endpoints; tokens are opaque so existing connections are unaffected.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
RFC 6749 搂2.3.1 requires the token endpoint to accept HTTP Basic client
authentication for clients that hold a secret. Until now only
client_secret_post worked, so a client sending the id and secret in the
Authorization header failed validation before the code was checked.
- extractBasicCredentials() next to extractBearerToken() decodes the header
- the token controller merges header credentials with the body
- registration mirrors back client_secret_basic when a client asks for it
- both discovery documents advertise client_secret_basic
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The ChatGPT Apps builder registers its own client through DCR and, with
OIDC enabled, calls /oauth/userinfo after the token exchange. Only the
static OPENAI_OAUTH_CLIENT_ID app was allowed the openid/email scope and
a userinfo answer, so every builder client got a narrowed scope and a 403,
which ChatGPT reports as "Missing OAuth callback data".
allowsEmailClaims() keeps the static app and additionally trusts dynamic
clients whose https callbacks all sit on a DCR_VERIFIED_DOMAINS host.
Loopback-only / private-scheme clients and installs with an empty verified
list keep getting mcp scopes only.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>