vibeapp.win

What broke

One rate-limit error cost a whole day, and a failed post fell to the back of the queue

A failed day of Instagram posting went to the back of a 54-post backlog, and one temporary 403 from Meta stopped posting for a whole Saturday. Both faults were in code Claude wrote. Here is what went wrong and the retry and ordering rules that replaced them.

The short version

What went wrongA failed day was treated as done, so one temporary 403 rate-limit error cost a whole Saturday, and a failed story fell to the back of a 54-post backlog.

How we found itHenning reported the account wasn't posting. Session notes showed the 31 October 403, and a review found the ordering put only the last day's posts first.

The rule nowTransient errors get two retries an hour apart, never after something reached the account. Unposted stories from the last week go first, oldest first, and posting waits for the site to return 200.

This post documents something Claude got wrong. The claim rests on a commit or a file, not on memory. All of Claude's mistakes

The engine behind this site posts one story a day to Instagram, as a Reel or a carousel. On 23 and 31 October that daily post failed. The damage came from what the code did next. Claude wrote that code, as it writes all the code in our repositories, and the fix commits say plainly what was wrong with it.

23 October: a failed day and a lost place in line

On 23 October both the Reel and the fallback carousel for that day’s story failed. The engine treats a failed day as “tried”, so it does not hammer Instagram every ten minutes. That part was intended. The story should then have gone out the next day. It never did.

The ordering function decided which story goes next. It put stories published on the site in the last 24 hours first, newest first, and everything else after them, oldest first. By the next day the 23 October story was more than a day old, so it lost its priority and dropped into the general backlog. The session notes put it at roughly number 50 of 54.

The fix commit from 25 October:

postOrder put only the last day’s posts first, so the post from 2026-10-23, whose Reel and carousel both failed, fell to the back of a 54-post backlog.

The same fix covered a second problem. On 24 October a Reel went to Instagram while its page on the site returned a 404. The engine waited one hour after a story was published and assumed the site build would be done by then. Every site build had been failing since the day before, so the page did not exist.

The 25 October change did two things:

  • Unposted stories from the last seven days now go first, oldest first. On a normal day that is still today’s story. A day that fails keeps its story at the front of the line.
  • Before picking a story, the engine sends a request for both the story’s page on www.vibeapp.win and its first slide image. It picks the story only if both return 200. A network error counts as no. It checks at most the first five candidates.

A new test reproduces the 23 October case: a missed story from the 23rd, a posted one from the 24th and a fresh one from the 25th. The missed story must come first.

31 October: one 403, no second try

A week later Henning reported: “den poster ikke til instagram” (it isn’t posting to Instagram). The last post was from 30 October.

According to the session notes, the carousel failed on 31 October at 16:05 UTC with 403: Application request limit reached, Meta’s app-wide rate limit. Because the day was marked as tried, the engine gave up until the next day. Nothing was posted that Saturday.

This kind of error clears by itself. The next day Meta’s usage header showed a call volume of 0, and the changelog notes that the quota was empty again a few hours after the failure. A second try later the same day would very likely have worked. The code had no way to make one.

The alert was wrong too. It said the post would be “tried again at 18:00”. The posting hour is set in UTC, and in winter that hour is 17:00 in Oslo. The text had the summer time hardcoded.

We don’t know why Meta’s limit was hit. The notes estimate our own use at about 45 calls for the midnight statistics run and about 25 for a carousel, well under the roughly 200 per hour the limit allows. We checked that no other app shares the Meta app. The container had been rebuilt on the morning of 1 November and the previous day’s log was lost with it. The notes say outright: “Årsaken på Metas side er ikke bevist” (the cause on Meta’s side is not proven). Next time this error comes, the trace is the last error saved in the engine’s state file.

The fix commit from 1 November:

On 2026-10-31 one 403 “Application request limit reached” cost the whole day. Rate limits and 5xx now get up to two retries an hour apart, never after something reached the account, and the alert names the Oslo time instead of a hardcoded 18:00.

How the retry avoids posting twice

Retrying a social media post is risky. The failed call may still have published the post. So the retry comes with three guards:

  • Only transient errors. The rate-limit message, any 5xx, and Meta’s “unexpected error / retry your request” text count as transient. An invalid token, a missing image, a media processing error or a caption stopped by the leak scan do not. Tests check both lists, starting with the 31 October error word for word.
  • Only when the post itself was tried. If an error happens after a successful post, for example while refreshing the token, it does not trigger a retry. A retry there would send the next story the same day.
  • Check the account first. Before a retry, the engine lists the five newest posts on the account. If any of them is newer than the previous attempt, with a one-minute margin, something went out. The engine stops and raises an alert saying the account should be checked and the story marked as posted.

One more change: before this fix, a failed permalink lookup after a successful publish counted as a failed post. That would have made a retry post the same story twice. Now the publish counts as successful and the link falls back to the profile URL.

The alert now gives the actual time of the next attempt in Oslo time. A test checks that 16:00 UTC shows as 17:00 on 1 November and as 18:00 on 1 July.

The two fixes also work together. The story that should have gone out on 31 October was not lost. It was an unposted story from the last week, so under the 25 October ordering it was first in line for the next weekday. Sunday is reserved for the weekly Reel.

What we take from it

Both faults came from the same narrow assumption: a day is either done or failed, and a failed day doesn’t need special handling. Under that assumption, one temporary error meant a lost day, and a lost day pushed a story to the back of the queue. The site-build check came from a similar assumption that an hour is always enough for a build.

The 31 October gap came to light when Henning reported that the account had stopped posting.

The rule

Transient errors (rate limit, 5xx) get two more tries, an hour apart, and never after something has reached the account. Unposted stories from the last week go first, oldest first, so a failed day doesn’t cost a story its place. Nothing is posted until the site returns 200 for both the page and its first image.