Commit Graph
7676 Commits
Author SHA1 Message Date
Daniel Salazar 8839ab08d8 perf(metering): read the global usage total as one paced listing
getGlobalUsage got every shard of a month by key, 10,000 keys in batches
of 100 with several in flight. It now lists the shards by prefix, a page
at a time, and waits between pages so the read stays under a fixed
number of read units per second.

getGlobalUsageByMonth returns every month from the same listing, for a
caller that shows more than one.
2026-11-24 22:13:38 -07:00
Filip Kujundžić a53319baac fix(ai): reconcile Claude cache lifetimes from reported iterations (#4770) 2026-11-24 17:36:19 -07:00
dependabot[bot] 81d98406a1 chore(deps): bump libphonenumber-js from 1.13.16 to 1.13.17 (#4769)
Bumps [libphonenumber-js](https://gitlab.com/catamphetamine/libphonenumber-js) from 1.13.16 to 1.13.17.
- [Changelog](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/catamphetamine/libphonenumber-js/compare/v1.13.16...v1.13.17)

---
updated-dependencies:
- dependency-name: libphonenumber-js
  dependency-version: 1.13.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-24 16:29:22 -07:00
Giridhar SriramanandClaude Opus 5.5 ae51c23978 fix(pagination): reject limits that floor below one (#4767)
normalizeLimit now floors before validating, so a fractional limit such
as 0.5 returns the same 400 as zero or a negative limit instead of
becoming 0 and failing keyset pagination.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:27:42 -07:00
Nariman Jelveh 892a9cf071 docs: sync translated READMEs with the English README (#4771)
Backend Tests / changes (push) Waiting to run
Benchmarks / changes (push) Waiting to run
Notify HeyPuter / notify (push) Waiting to run
* docs: sync translated READMEs with the English README

Rewrites every doc/i18n README from the current README.md: the new
tagline, nav links (Office Suite, AI Builder, Developers), screenshot,
For Users / For Developers sections, the selfhost install scripts, and
the updated support channels. Removes the old Docker, Docker Compose,
and System Requirements sections and the Discord, Reddit, and Mastodon
links. Relative links point at ../self-hosting.md from doc/i18n.

* update links
2026-11-24 10:39:14 -07:00
Nariman Jelveh 37af115f96 Update README.md 2026-11-24 10:13:53 -07:00
Filip Kujundžić ef2e328905 Merge pull request #4759 from HeyPuter/fix/kling-verified-models
Backend Tests / changes (push) Waiting to run
Benchmarks / changes (push) Waiting to run
Notify HeyPuter / notify (push) Waiting to run
fix(ai): limit direct Kling support to 4.0 video models
2026-11-24 10:33:04 +01:00
404oops 8eb5a85223 Merge main into Kling model cleanup 2026-11-24 09:34:17 +01:00
Daniel Salazar f72938f9af fix(gui): the card gate is checked again after the phone gate when the email gate runs last (#4766)
Notify HeyPuter / notify (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
In that order the card gate runs before the phone gate, so a card
requirement set while the phone is verified was not shown until the
next load.
2026-11-23 20:46:51 -07:00
Nariman Jelveh 73ea25ccb0 fix(gui): the Files tab's selected sidebar folder keeps its label's weight
The bolder label was wider than the regular one, so selecting a folder
nudged its text.
2026-11-23 17:28:30 -07:00
Nariman Jelveh 7e1712f03f refactor(gui): the dashboard's Empty Trash confirm opens in its own dialog, not a UIAlert window
window.empty_trash takes an optional confirm, which the Files tab fills
with UIDashboardDialog; the desktop keeps its UIAlert. The file context
menu's Empty Trash goes through the Files tab via onEmptyTrash.
2026-11-23 15:55:49 -07:00
Nariman Jelveh f199916d18 feat(gui): the Apps tab's context menu drops Open in new tab, and Copy link copies the app's index_url
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
Built-in apps, which have no address of their own, still copy their
/app/<name> link.
2026-11-23 15:18:42 -07:00
Nariman Jelveh 709347acfc feat(gui): the add-app dialog opens apps.puter.com and builder.puter.com signed in, in a new tab
Find an app and Create an app with AI open their sites in a new tab with
the same token handoff the desktop card uses, falling back to the in-page
app window when the browser refuses the tab. openDesktopInNewTab becomes
openSiteInNewTab(url), with its double-click guard kept per site.
2026-11-23 14:53:02 -07:00
Filip Kujundžić 70687abf06 Merge pull request #4760 from HeyPuter/fix/ai-model-monitor-alert-presentation
fix(ai): make model monitor alerts easier to read
2026-11-23 22:15:00 +01:00
404oops 37aa34c250 fix(ai): simplify model monitor alerts 2026-11-23 22:04:00 +01:00
Daniel Salazar 8969c8b3b4 refactor(backend): layer pass for duplicated logic, dead code and round trips, with the bugs it turned up (#4754)
* refactor(util): shared helpers for hosts, timeouts, chunking, paging, shutdown flush and codes

Adds normalizeHost/getPuterHostedDomains, withTimeout, chunk, nowSeconds,
isMissingTable, clampLimit/parsePageQuery/pageEnvelope, finalFlush,
parseRetryAfterMs/doublingBackoffMs, randomCode, sweepInBatches,
hashPassword/generateEmailConfirmCode, requestIp and isTemporaryAccount, and
removes util exports nothing called.

* refactor(clients,core): drop unread alarm state and dead shutdown paths, share host helpers

DynamoDB batches still throttled after the retries answer 503 db_unavailable.

* refactor(stores): one cache read per miss, tombstones on every write, batch methods for callers above

The multi-check permission cache is read with pipelined GETs. claimOwnership,
replaceDataUrlIcon and setLabel tombstone their keys. updateMetadata merges in
one statement. App stats reject an unknown period and cap grouped answers.

* refactor(services): fewer serial round trips in permission, share, metering and events paths

checkMany no longer caches a check that threw. Account deletion revokes its
sessions first. OIDC email_verified strings are read as booleans. Events
limits, FS service types and the events worker deployer live under services.

* refactor(drivers): one teardown path for workers, shared credit hold and provider helpers

A URL input and a generated-media download have a deadline and a size cap.
Azure chat clients take the shared client options. xAI and Mistral chat send
tools through toolsToWire and honor apiBaseUrl.

* refactor(controllers): shared download, paging and second-factor helpers, store methods for raw SQL

/batch answers a non-HTTP op error generically and logs it. /fs/search returns
the client entry shape. The unused /puterai/video/proxy route is removed.

* refactor: thumbnails accept raster types only, boot failure exits, docs for new limits

* fix: sessions stay listed after a rename, token grants follow the whole revoke cascade, app delete in one transaction

- listSessions asks the primary about rows marked as changed, so a renamed
  session stays on the list under its new label.
- The revoke cascade reports the access tokens it revoked, and their grants
  are dropped at any depth. The read before each revoke is gone.
- App delete records the deletion, clears filetype associations and deletes
  the row in one transaction.
- A local worker deploy waits for the runtime to start, so a script it cannot
  load fails the deploy.
- Speechify plain text: an & that starts no XML entity and a < that starts no
  complete tag are escaped.
- The events forward queue's byte bound counts UTF-8 bytes.
- Without a dedicated store, thumbnails stay in the default bucket.
- AppStore.invalidateWrittenByUid for writers that hold the uid.
- subdomainFromHost takes the configured domain list; the sorting wrapper only
  tests called is removed.
- Changelog and alarm docs match the code.

* fix: cache pipelines fall back to single commands across shards, TURN records metered one by one, allowance baseline kept

- execTogether runs single-key cache commands in one round trip and, on a
  cluster that cannot route them in one pipeline, sends each on its own. The
  row cache, tombstone reads and writes, the FS entry backfill, the permission
  check cache and the revoked-session cache write use it.
- TURN usage ingestion makes one metering call per user with each record as
  its own usage, so one malformed record does not affect the others.
- The allowance settlement keeps the baseline fold for month records without
  allowanceUsed.
- Speechify plain text keeps a self-closing tag without attributes.

* fix(localworker): a deploy waits for the runtime to start and a failed cold start answers 502

A script the runtime cannot load fails the deploy. What was serving before
goes back in place, and a first request for such a worker answers 502.

* fix(subdomains): the sites rooted under a folder are read in name order, a page at a time

subdomainsRootedUnder takes the name to start past, so a caller pages
through every match instead of stopping at one query's limit.
2026-11-23 14:00:35 -07:00
404oops b589060668 fix(ai): restrict Kling to verified video models 2026-11-23 21:45:34 +01:00
Filip Kujundžić c73cd4de51 feat(ai): refresh provider model catalogs and add Gemini Omni 1.2 (#4755) 2026-11-23 13:11:08 -07:00
Filip Kujundžić 412c0aaa1c fix(ai): raise model monitor pagination limit (#4758) 2026-11-23 12:53:01 -07:00
54589ae1c2 fix(localworker): swap Miniflare instance before disposing previous one and dedupe concurrent cold starts (#4689)
* fix(localworker): swap Miniflare instance before disposing previous one and dedupe concurrent cold starts

* test(localworker): restore the service's tests and cover the swap on the real runtime

Brings back the existing LocalWorkerService tests and adds cases for a
request during a redeploy, concurrent first requests, and a retry after a
failed first deploy. The first-request deploy moves into its own method,
and both dispose paths share one helper.

---------

Co-authored-by: U-ITACHII <356922991+U-ITACHII@users.noreply.github.com>
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-23 11:57:39 -07:00
Daniel Salazar 5b8f4fb548 fix(apps): accept the Dev Center new-app placeholder as an index_url (#4757)
apps.create and apps.update refuse an index_url on the host of a godmode app. Dev Center points every new app at https://console.puter.com/coming-soon.html until its first deploy, and that page is on Dev Center's own host. That exact URL is now accepted. Any other URL on the host, including the placeholder with a query string or fragment, is still refused.
2026-11-23 11:34:46 -07:00
522c5af1a7 fix(puter-js): clear launch params from app tabs; private app sign-in keeps the tab's launch (#4743)
* fix(puter-js): clear launch params from an app tab's address bar

An app the desktop opens in its own browser tab removes the puter.*
params it was launched with from its URL after load. The app's own
params, utm_* and the hash stay; framed apps are unchanged.

The SDK reads launch items from the query it booted with, so
onLaunchedWithItems() and wasLaunchedWithItems() still see the opened
item after the URL changes.

* fix(puter-js): keep a tab's app id across a reload after the launch params are cleared

A godmode token doesn't name the app, so once the desktop answers a tab's
launch, the app id from the launch URL is stored the way a token's own app
id is.

* fix(hosting): a private app's sign-in page continues with the desktop's token and keeps the opened item

In a tab the desktop opened, the sign-in page waits for the desktop's
handoff, sends the handed token to its own URL in X-Puter-Auth-Token so
the host sets its cookie, then loads the URL the tab was opened at. The
token goes in the URL only after a redirect, a failed request, or on a
click after a header try didn't load the app.

Before leaving, the page keeps the opened item in sessionStorage, bound
to the launch and a fingerprint of the handed token, for 5 minutes. The
app's page takes it when it boots on that token in the same tab.

Reading sessionStorage for it can't stop the SDK from booting where
storage is blocked.

---------

Co-authored-by: Salazareo <25314977+Salazareo@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-11-23 11:33:48 -07:00
Giridhar SriramanandClaude Opus 5.5 19ae43b02b fix(email): match blocked domains on a label boundary (#4647)
isBlockedEmail compared each blocked entry as a raw suffix of the whole
address, so `mailinator.com` also blocked `notmailinator.com` and a TLD
entry like `ru` blocked `site.guru`. A bare entry now matches the
address's domain exactly or as a parent domain. Entries containing `@`
or starting with `.` keep matching as written.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 11:25:37 -07:00
HanadHassan 19590857a6 test(ai): fail CI if the SDK timeout outgrows plain fetch's timeout (#4714)
The AI vendor SDKs use plain fetch, and nodeFetchDispatcherGuard gives it
a 10-minute header and body timeout. SDK_TIMEOUT_MS relies on that, but
nothing linked the two values, so raising SDK_TIMEOUT_MS above 10 minutes
would still be cut off at 10 with no error.

The guard now exports OUTBOUND_FETCH_TIMEOUT_MS, and sdkClient.test.ts
checks that SDK_TIMEOUT_MS isn't larger than it. No change in behavior.
2026-11-23 11:07:45 -07:00
HanadHassan 35f27bfa97 test(ai): benchmark a streamed chat completion through the credit gate (#4744)
No benchmark covered the AI path, so a change could add round trips
to a chat completion's rate limit, concurrency slot, credit gate, hold
or usage record without the comparison noticing.

Four scenarios now run a completion through the real gates and the
real credit hold against a local stand-in for the vendor: streamed and
unstreamed through /drivers/call, for an account on its allowance and
for one with purchased credit, and streamed through the OpenAI chat
completions route.
2026-11-23 11:07:32 -07:00
HanadHassan f8ead99d32 test(ai): stream two interleaved tool calls through the compatibility routes (#4739)
* test(ai): stream two interleaved tool calls through the compatibility routes

The route tests for the OpenAI chat, Responses and Anthropic messages
routes stub the chat driver, and the HTTP tests that run a fake vendor
through the real driver only stream text. Nothing checked that a
vendor's streamed tool calls reach a client of those routes intact.

A new HTTP test boots the backend, plays Chat Completions, Responses and
Anthropic vendors at the fetch boundary with two tool calls whose
arguments arrive in pieces, interleaved for Chat Completions, and
rebuilds the calls from each route's stream. The fuzz test's healthy
upstream answers a streamed request that offers tools with the same
fixtures, and the misbehaving case offers a tool on half its requests,
so corrupted tool-call streams are exercised too.

* test(ai): review follow-ups for streamed tool-call tests

The fuzz test fed Mistral the piece-by-piece Chat Completions fixture,
which Mistral's SDK rejects because it requires a name on every
tool-call delta, and the fuzz test still passed. Mistral now gets every
call whole in one chunk, the shape it sends, and the HTTP test gains a
Mistral row and a whole-calls row for the OpenAI SDK.

The piece-by-piece fixture now opens each call with empty arguments, as
OpenAI does. The HTTP test also checks that the chat route numbers calls
from 0 and sends a call's id and name only once, that Anthropic blocks
never overlap, and that each route ends its stream the way clients wait
for.
2026-11-23 11:07:15 -07:00
HanadHassan 0692132771 fix(ai): the Anthropic messages route keeps every piece of parallel tool calls (#4740)
The Anthropic stream writer can have one content block open, and a
tool_use_start for a second call closed the first call's block. Pieces of
the first call that arrived after that were dropped, and its closing
tool_use was skipped as already written, so a client got its input as
truncated JSON whenever an upstream interleaved two calls' arguments.

A call that starts while the open call's input is still incomplete JSON
now waits, collecting its pieces. When the open call ends, its block
closes and the next waiting call opens with the pieces it has so far,
then streams the rest live. A call that starts after the open call's
input is complete closes it and streams live as before, so calls sent one
after the other are not delayed. A whole tool_use that arrives while a
call is open waits the same way, calls without a distinct id never wait,
and calls still waiting when the message ends are written before
message_delta.
2026-11-23 11:07:12 -07:00
HanadHassan 4e82cd27df fix(ai): streamed tool calls keep their arguments when an upstream's deltas differ from OpenAI's (#4713)
* fix(ai): streamed tool calls keep their arguments when an upstream's deltas differ from OpenAI's

The OpenAI-compatible stream handler slotted tool-call deltas by index
alone and appended function.arguments as it arrived. Parallel calls that
shared an index, or sent none, merged into one block whose JSON could not
parse, and the second call was lost. A delta without arguments started the
buffer with "undefined", and object arguments, which Mistral's SDK allows,
became "[object Object]". Each reached the caller as a tool call with
input {}. A delta carrying both content and tool_calls emitted only the
text.

A delta with an index still continues the call at that index, unless it
brings a new id and its own name, which opens another call. A delta with
no index resolves by id, then to the call in progress. Arguments are read
as JSON text, and a delta's tool calls are handled after its text.
Arguments that still don't parse pass as {} as before, and the call's
name, id and length are logged.

* fix(ai): review follow-ups for streamed tool calls

Two calls that shared an index were told apart only when the second one
opened. After that the index pointed at the second call, so a later
delta carrying the first call's id was appended to the second, and both
came back with arguments that don't parse when their pieces alternated.

Each index now remembers the calls opened on it by id, and a delta whose
id matches one of them continues that call. The lookup stays within the
index, so calls at different indexes that repeat an id stay apart.
2026-11-23 11:05:57 -07:00
Filip Kujundžić b3dad7a996 feat(ai): monitor upstream model catalog changes (#4690)
* feat(ai): monitor upstream model catalog changes

* fix(ai): persist catalog snapshots before change alerts

* Remove the clause
2026-11-23 10:27:22 -07:00
Daniel Salazar 0a5328bb24 fix: launch args decoded once, revoked sessions off the list, per-session socket eviction, writes into respelled folders, read URLs through folder access (#4752)
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
* fix: decode puter.args once and keep just-revoked sessions off the session list

* fix(socket): a session revoke drops only that session's sockets; the GUI reconnects after a server disconnect

* fix(fs): a write into a folder spelled in another case or form lands under the folder's stored path

* fix(auth): access tokens for fs: scopes accept access held through a parent folder

* docs(changelog): read URLs through folder access and writes into respelled folders

* style: format

* fix: address review — stored paths for created parents, batch alias dedupe, uid-only ACL mint, scoped socket eviction fallback, events suites

* test(fs): build the legacy respelled-descendant rows directly

* fix: address second review — refuse duplicate overwrite targets before upload, reuse ensured folders, check stored path length, match created folders by entry, decode a doubly encoded API origin

* docs(changelog): file this PR's entries under its merge day
2026-11-22 13:40:24 -07:00
Nariman Jelveh 12f089db26 refactor(gui): the dashboard's alerts and confirms open in its own dialog, not a UIAlert window (#4753)
Files, Apps, the properties modal and the log-out confirm now use
UIDashboardDialog, mounted in the dashboard window like the Notifications
tab's dialogs. Messages are HTML-encoded at the call site, since the dialog
renders its message as given. Dismissing the name-conflict dialog counts as
Skip or Cancel.
2026-11-22 11:53:32 -07:00
Filip Kujundžić 30da7a8b0c Merge pull request #4741 from HanadHassan/HH/responses-final-arguments
fix(ai): the Responses route gives a streamed function call its arguments in the finished item
2026-11-22 15:18:47 +01:00
Filip Kujundžić 96f46ed3ef Merge pull request #4751 from HanadHassan/HH/chat-model-catalog
perf(ai): the chat model listing is built when the model map changes, not on each request
2026-11-22 15:15:44 +01:00
jelveh fc33a00d73 feat(gui): complete the Korean translation
Backend Tests / changes (push) Canceled after 0s
Backend Tests / typecheck (push) Canceled after 0s
Backend Tests / test shard 1/4 (push) Canceled after 0s
Backend Tests / test shard 2/4 (push) Canceled after 0s
Backend Tests / test shard 3/4 (push) Canceled after 0s
Backend Tests / test shard 4/4 (push) Canceled after 0s
Backend Tests / test (main) (push) Canceled after 0s
Backend Tests / coverage (push) Canceled after 0s
Benchmarks / changes (push) Canceled after 0s
Benchmarks / bench shard 1/3 (push) Canceled after 0s
Benchmarks / bench shard 2/3 (push) Canceled after 0s
Benchmarks / bench shard 3/3 (push) Canceled after 0s
Benchmarks / benchmarks (push) Canceled after 0s
Notify HeyPuter / notify (push) Canceled after 0s
Translates the 652 strings ko.js was missing, updates the 2FA setup
instruction to match the current English, and drops two keys en.js no
longer has plus a duplicated billing key.
2026-11-21 19:30:30 -07:00
Hanad Hassan 8cd680fb60 fix(ai): the Responses route gives a streamed function call its arguments in the finished item
The Responses route asks the driver to stream tool input, so every
function call starts with tool_use_start, even from an upstream that
sends the call whole. The route added each call to the response output
with empty arguments and sent the pieces only as
function_call_arguments.delta events. The items in
response.output_item.done and in the output of response.completed kept
arguments "", so a client that reads the finished response rather than
the deltas, such as the OpenAI SDK's finalResponse() or the Agents SDK,
got every streamed tool call with no arguments.

When the call ends, its item now takes the arguments the route collected
for it, before the done events are sent.
2026-11-21 18:59:43 -07:00
Hanad Hassan 20d11ebf18 perf(ai): the chat model listing is built when the model map changes, not on each request
The chat driver rebuilt its model listing on every call to models() and
list(): it flattened the model map, visiting each model once per name it
answers to, dropped the repeats, applied the listed rates and sorted.
The map only changes at boot and on the fifteen-minute refresh, and the
routes that serve the listing are public.

The listing is now built when the model map is swapped and both methods
return it. A scheduled price change still takes effect at its instant:
the listing records the span of time its rates hold for and is rebuilt
from the current map on the first call outside that span. The returned
arrays are frozen, since every caller now shares them. What the routes
return is unchanged.
2026-11-21 18:02:54 -07:00
Nariman Jelveh 3d49d320af Merge branch 'main' of https://github.com/HeyPuter/puter into feat/gui-file-picker-remembers-view 2026-11-21 15:55:33 -07:00
414090bb36 fix(ai): bill Mistral OCR for a page count a document can have (#4734)
* fix(ai): bill Mistral OCR for a page count a document can have

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(ai): retry a chat credit hold apart from lost headroom when the balance changed

A conditional hold refused because the balance changed since it was read
is now reported as 'stale', separately from one that no longer fits. The
chat gate reads the balance again for it, up to five times with a short
randomized wait, without spending the tries a lost headroom gets, and
refuses with a plain 429 rather than credits_reserved if it never holds
still.

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
2026-11-21 15:52:17 -07:00
Filip KujundžićandClaude Fable 5.2 0dbf84bc3e fix(ai): give Cloudflare image requests a timeout and a reply size cap (#4733)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:17 -07:00
Filip KujundžićandClaude Fable 5.2 9e1ee69ac5 fix(ai): bill no more Replicate runtime than a prediction is given (#4732)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:17 -07:00
Filip KujundžićandClaude Fable 5.2 24bc88b451 fix(ai): keep a failed model map build from leaving an unhandled rejection (#4731)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:16 -07:00
Filip KujundžićandClaude Fable 5.2 16419dc951 fix(ai): reserve chat and video credits only while they still fit the balance (#4730)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:16 -07:00
Filip KujundžićandClaude Fable 5.2 02a2d87d5e test(ai): fuzz vendor replies, gateway catalogs and recorded usage (#4729)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:16 -07:00
Filip KujundžićandClaude Fable 5.2 3b5d6619dd fix(ai): classify malformed text-to-speech provider replies (#4728)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:15 -07:00
Filip KujundžićandClaude Fable 5.2 ec8789e9fa fix(ai): classify malformed video provider replies (#4727)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:15 -07:00
Filip KujundžićandClaude Fable 5.2 d60b909e83 fix(ai): classify a malformed Gemini image reply (#4726)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:14 -07:00
Filip KujundžićandClaude Fable 5.2 b0df774be7 fix(ai): classify malformed image provider replies and options (#4725)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:14 -07:00
Filip KujundžićandClaude Fable 5.2 2f43d618ae fix(ai): reject a Claude 2xx answer that isn't a message object (#4724)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:14 -07:00
Filip KujundžićandClaude Fable 5.2 2798d721e0 fix(ai): record no usage for a provider count that isn't a positive number (#4723)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:13 -07:00
Filip KujundžićandClaude Fable 5.2 d8bb1b3570 fix(ai): hold billed transcription seconds to what the audio can contain (#4722)
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:52:13 -07:00