* fix(ai): meter Gemini thoughts and audio input separately
* fix(ai): schedule Gemini legacy redirect pricing
* fix(ai): keep video in Gemini conversations that contain audio
The native Gemini adapter maps video data URLs to inline data for the
models whose audio input it serves, so a conversation with both audio
and video is sent to Google instead of failing with 400.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* fix(ai): meter Gemini audio by content, send video and Puter file audio
Audio and video data URLs count as audio and video input whatever part
carries them, and the input check runs again once Puter files are read.
Gemini 2.5 Flash and Flash-Lite requests with video use the native API
so the audio track is metered at the audio rate. Remote video URLs are
fetched and inlined for Gemini, video reaches the compatible endpoint
in the part it reads, and audio inlined from a Puter file is sent as
bare base64 with a wav or mp3 format. The native adapter answers 400
for a tool call without a function name and no longer fails on a tool
call id or image URL that is not text.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* fix(s3): close pooled connections before S3 drops them
S3 hangs up on a keep-alive connection that has been idle for about 6 s and
sends no keep-alive hint, while the client's pool kept idle sockets
indefinitely. A request written to a socket as S3 closed it failed with
`socket hang up`, and the SDK's retries could draw more sockets of the same
age from the pool and fail the same way.
The pool now closes a socket after 4 s idle. Requests in flight keep the
handler's own socket timeout. Plain-HTTP endpoints get the same pool settings
as HTTPS ones.
* feat(alarms): name the host and a hosted site's owner on HTTP error alarms
A hosted site's visitor is usually anonymous, so an error alarm for a site
request named nobody, and its path alone did not say which site failed. The
site middleware now records the owner as the actor to report a failure
against, used when the request has no actor of its own, and every HTTP error
alarm carries the request host.
A card stands in for the phone step only on an account that neither owes a
card nor has verified one. A number on file is still stood in for by the card
on file. An account that owes both keeps both steps.
`puter.phone-verification.check` gains two optional fields:
- `countsTowardFallback: false` keeps a refused send out of the count that
opens the fallback. Refused sends count by default, as before.
- `refuseWithoutFallback` keeps a `card_fallback_instead` refusal in place
when there is no fallback to offer, instead of letting the send through.
GUI: a message for a card the verification doesn't accept, and the
virtual-number message no longer mentions a card (the card link shows on its
own when one is offered).
Adds the puter.card-fallback.policy event, asked before
phone_verification_card_fallback.enabled is read. A listener that sets
enabled decides in place of config; with none, config decides as before.
* perf(auth): a sign-in reads the team seat once; validate event carries request signals
- The seat a sign-in reads for its listeners is handed to the account
payload it builds afterwards, instead of being read again: one cache read
and, for an account with no seat, one database read fewer, and two fewer
serial stages.
- puter.signin.validate carries `request_signals`, every signal the edge
proxy raised on the request.
- A card step on an account that already has a card asks for that card,
entered again, the way a number on file asks for its number.
* feat(auth): proof of the phone or card on file belongs to the session that gives it
A sign-in made while the account owes proof of its phone or card on file
doesn't have its device remembered, and its session is noted. When a
session proves the phone or card, its device is remembered then, and every
other session opened while the proof was owed is revoked before the gate
clears, so clearing it from one session can't let another one in.
* fix(auth): proving the phone or card on file signs out the account's other web sessions
The proving session keeps its sign-in and is the only device remembered. A
sign-in that completes after the proof was given is not kept and is asked to
sign in again. If the other sessions can't be signed out, the gate goes back
on and the request fails.
* fix(auth): other sessions are signed out before the on-file gate clears; the phone proof counts for its sign-in
Proving the phone or card on file signs the account's other web sessions out
before the gate clears and again after it, so a session never sees the gate
open. Only the gates the request cleared go back on if the second pass fails.
The proof that allows an email change while the address is pending is kept
with the sign-in that gave it. A sign-in that isn't kept sets no session
cookie, and a provider sign-in in that case returns to its page.
* fix(auth): a gated sign-in checks the gate after its device id is kept
The check is the last step before the session cookie is set. Tests assert the
order of the gate writes and that a provider sign-in that isn't kept leaves no
session.
* feat(auth): phone on file step, email replacement while unconfirmed, no lock without email
- Phone gate on an account that already has a number: /send-confirm-phone
sends the code to that number and ignores any other, /confirm-phone checks
only that number, and `lostNumber: true` opens the card fallback (409 when
there is none). The send response and whoami carry `phone_on_file`, the
number's last two digits; the phone window drops the number field for it.
- /user-protected/change-email runs while the email code is pending, with
every other gate still applied, for an account with a verified phone,
card, paid plan or second factor; otherwise the code is still required.
Provider-only accounts keep the code. Confirming the replacement runs the
same side effects as confirming the code. The email window gets a step
for it.
- The per-account wrong-password lock skips accounts with no email; the
failures still count and alarm.
- puter.signin.validate carries `credential_exposed`.
- GUI gate flows read the account again between gate windows and before
opening one.
* feat(auth): a number on file is stood in for only by the card on file; two codes a day
- The card fallback for a phone on file opens only when the account already
has a card, and confirming it clears the phone step only when the card's
fingerprint matches the one on file (`card_not_on_file` otherwise).
- Codes to a number on file: two per account per day; past that the route
answers 429 `phone_on_file_send_limit` and offers the card on file.
- Phone window drops the signup help line in on-file mode; the email
window's footer no longer shows a stray separator in the change step.
* feat(auth): replacing an unconfirmed email takes a factor the account had before
A phone or card first verified while the address is unconfirmed is recorded
in the account's metadata (`factorsAddedWhileEmailPending`), before it is
stored, and no longer counts toward /user-protected/change-email. A number
on file proven again and the card already on file still count, as do a
second factor and a paid plan. The route no longer asks for a new factor;
with none from before it answers `email_confirmation_required`, and the
email window says the code is needed.
* feat(auth): email replacement and the card stand-in each take proof in hand
- Replacing an unconfirmed email: a dormant sign-in records, once, the
number the account had (`phoneAtDormantSignIn` in metadata). The change is
allowed only when the account still has that number and proved it within
the hour, by its code or by the card on file; otherwise the route starts
the phone step for it, or answers `email_confirmation_required`. A phone
or card merely being on the account, a paid plan, and a number or card
verified since no longer count. This replaces the list of factors added
while unconfirmed.
- Card confirmation while a number on file waits: only the card already on
file verifies, under any gate order. The confirm event carries
`required_fingerprint`, and the listener reports `card_entered` (details
typed for this confirmation, not a saved card or an old confirmation);
both are checked.
- A card fallback opened earlier no longer offers a card to an account whose
number on file has no card to stand in for it.
* fix(db): bound numbers must be safe integers; path and cursor input checks
Bound numbers outside ±2^53 (including NaN and Infinity) are refused with a
400 by every database client.
- Paths longer than 4096 characters are refused with a 400.
- The path lineage lookup returns null for paths deeper than its walk
without querying.
- The read batcher's circuit breaker counts a failed fallback flush only
when an item could not reach the database.
- App, subdomain and worker list cursors must carry a non-negative integer
id.
- App stats grouping accepts only its own keys.
- App batch lookups skip values of the wrong type, and app writes refuse
keys that are not column names.
- User, notification, durable subscription and KV share handle lookups
return no row for values of the wrong type.
- OIDC links are looked up by the sub as a string.
- User-to-user and group permission reads keep exact matches only.
- revoke-dev-app validates its parameters like grant-dev-app.
- A durable subscription's expiresAt must be before the year 10000.
- Installed apps paging reads page and limit as whole numbers.
* fix(db): review follow-ups for input checks
- The path length check measures the canonical absolute path, after the
leading slash is added and a trailing one dropped.
- The lineage lookup handles up to 500 segments, SQLite's compound select
limit.
- Group permission reads keep matching by the column's collation.
- A server error code is never read as a lost connection from its message.
- Cursor ids must be integers or digit strings, and a cursor that is
neither a string nor an object is refused.
- OIDC links store the sub as a string, matching lookups.
- findEmailOwner returns no row for a value that is not a string.
- Invalid stats groupings and non-string or non-number expiresAt values
return a 400.
- Installed apps limit clamps before rounding down.
Every database client refuses an array, object or function parameter with a
400 before it reaches the driver. Strings, numbers, bigints, booleans, null,
dates and buffers still bind. tryHardReadAll checks the whole batch first.
Store lookups on text columns return null for a value that is not a string:
users (only id takes a number), apps (also existsByName and
uidExistsOnPrimary), fsentries by uuid, subdomains by uuid, sessions by
uuid, shares and notifications by uid, notifications by send key. OIDC links
still look up a numeric provider sub.
Apps get `utm_content` set to how the user opened them: `app_icon`,
`file_open`, `open_with` or `file_drop`. Apps opened from the app browser
embed get the framing page's host as `utm_source`, which the server reads
from the same referrer check that pins `frame-ancestors`.
UserStore.getByProperty returns null for a value that is not a string or a
number, so an array or object from a request body never reaches the query.
POST /send-pass-recovery-email answers 400 for a username that is not a
string; it answered 500 for an array.
Sign-in
- One sign-in path (SignInService) for password, 2FA, recovery code, signup
and OIDC. It emits puter.signin.attempt (before the account lookup on
POST /login), puter.signin.validate (before the session is created) and
puter.signin. Listeners can refuse or require phone or card verification; a
listener that throws is ignored.
- POST /login keeps a wrong-password budget per account across all networks,
20 an hour and 50 a day. A browser that has signed in to the account before
is not refused, and the budget belongs to the current password.
- An account unused for dormantSignInDays (default 180) confirms an
unconfirmed email at sign-in, where the deployment can send mail.
- New account emails: sign-in from a new browser, sign-in attempts blocked,
password reset completed.
- pwnedPasswords (off by default): a k-anonymity range lookup after a
successful password sign-in, with a notice to the owner.
- requestSignalHeaders and requestSignalValue turn configured request headers
into req.requestSignals and a puter.request.flagged event.
Sessions
- web and app sessions end after 180 days without activity; accounts with no
password and no email keep 365 days. A missing expiry on web, app and asset
rows no longer means no expiry, and ended rows are purged.
- The cookie a private hosted site sets from ?auth_token= is tied to the
token's session row and carries a 7-day expiry.
Email confirmation codes
- A 6-digit code is valid for 60 minutes and has a wrong-code budget.
Mailbox ingress
- email.ingress.validate runs before a message is stored; a listener can refuse
it or record a sender check. X-Puter-Sender-Auth is written by the server
only. Header blocks over 256 KiB are refused.
GUI
- Login sends the device fingerprint, can show the captcha widget
(gui_params.turnstileLogin), offers a password reset when sign-in is locked,
and runs pending verification windows after a popup sign-in or signup.
* fix(thumbnails): files edited or written by apps get a thumbnail in the dashboard
An overwrite clears a file's thumbnail and nothing made a new one, so a file
an app saved over lost its picture, and files apps created never had one.
The dashboard now makes a thumbnail for a file with none as its row comes
into view, with the upload thumbnail generator, within budgets on size,
downloads at a time, files per minute, and bytes per page load. A version
that gives no thumbnail is remembered so it isn't downloaded again.
/update-fsentry-thumbnail takes an optional expectedModified and refuses a
thumbnail made from an older version with 409, tells the owner's other
clients about the new thumbnail, and has its own rate-limit scope instead of
sharing the one opening a file uses. Overwrites and replacements emit
thumbnail.discarded, and the thumbnails extension deletes the object behind
it, so replaced thumbnails no longer stay in the bucket.
* fix(thumbnails): expectedModified must be a whole number of seconds the column can hold
A fraction or a value past the column's range reached the UPDATE, which
Postgres refuses with an error after the thumbnail was already uploaded.
The route now answers 400 before it uploads anything.
* fix(thumbnails): setting a thumbnail keeps the current one when the new one can't be stored
The route stored whatever the thumbnail.created listeners left behind:
a pointer whose upload failed, or the null left for an image that can't
be decoded. Either replaced a working thumbnail and answered 200. It now
answers 500 or 400 and leaves the entry as it was.
* fix(thumbnails): the update announced after setting a thumbnail carries the entry's current name and path
The event was built from the entry read before the thumbnail was
uploaded, so a rename or move that landed during the upload was
announced with the name and path it had just replaced, and open clients
put the row back on a path that no longer exists. The entry is read
again after the thumbnail is stored.
* fix(thumbnails): a file that stops needing a thumbnail is no longer downloaded for one
A file waiting its turn, or already downloading, was still read and its
thumbnail stored after another tab had made one, or after the file was
saved again as something the generator can't read. A queued file is now
checked again before its download starts, and a change that makes the
thumbnail unwanted drops the queued job and cancels the download.
* fix(thumbnails): refreshing the folder on screen keeps its thumbnail downloads
A refresh of the folder on screen (a sort, a view switch, an upload
finishing, coming back to the tab) cancelled the downloads under way.
The rows drawn right after were skipped, because their files still
counted as being tried, so they stayed without a thumbnail until some
later render. The rest were downloaded again from the start.
A download is now cancelled only if its file's row isn't drawn again in
the same task, and the new row takes it over. A row that comes back
while a cancelled download is still ending is queued again.
* fix(thumbnails): a stored thumbnail is recorded on the row's own entry
The filler handed its callback a copy of the row's entry, so the
thumbnail was written to an object nothing else reads, and the row's
entry kept saying the file had none. It now passes the row's entry, and
skips a row whose file was saved again while the thumbnail was being
stored, which would otherwise show the older version's picture.
* fix(thumbnails): the download budget counts the bytes that were downloaded
A cancelled download gave its whole size back to the page's download
budget, though the bytes it had received were already billed as egress.
A file saved over and over while its row was on screen could be started
again each time, well past the budget. A download the server refused
kept its size charged with nothing downloaded.
The file is now read as a stream and the budget is charged what arrived.
Reading also stops as soon as a file turns out to be over the size cap,
where before a file larger than its listed size was buffered whole.
* fix(thumbnails): a thumbnail download that fails to connect is tried again
A download that failed on the network counted as tried, so the file went
without a thumbnail for the rest of the page load. A laptop waking before
its Wi-Fi is back marked every row on screen that way. A failed
connection now pauses the filler like a 429 does, and the file is tried
again after the pause.
* fix(thumbnails): a thumbnail that couldn't be stored yet is sent again, not made again
When storing a thumbnail got a 429, the file was queued again and
downloaded a second time after the pause. When the request failed to
connect, the thumbnail was dropped and the file went without one. The
thumbnail is now kept with the queued job and sent again after the
pause, as long as the file is still at the version it shows.
* fix(thumbnails): a file whose thumbnail the server refuses isn't downloaded again on every page load
When the server answers 400 for a thumbnail, the file's version is now
remembered like one that gave no thumbnail at all. It counted as tried
for the page load only, so each later page load downloaded the file and
sent the same image again.
* fix(thumbnails): only pictures a browser can draw are downloaded for a thumbnail
Any file typed image/ counted as one the generator reads, so TIFF scans,
CAD drawings, DjVu books and the like were each downloaded in full, up
to 20 MiB, to make a thumbnail no browser can draw. A file is now
downloaded only when its type or name is one browsers decode. Uploads
are unchanged: the generator still tries any image there, where the file
is already local.
* fix(thumbnails): missing thumbnails are downloaded one file at a time
Each download holds one of the account's concurrent file reads until it
ends. Two at a time left a temporary account, which has three, a single
read for everything its apps do, so an app reading two files at once got
a 429 while a folder's thumbnails were being filled in. The per-minute
cap of 20 files already bounds how fast they're made.
* fix(thumbnails): an update refreshes the icon of every item it matches
An update can match the Files row and the same item in a file dialog
open over the dashboard. The row updater set the new thumbnail on the
first match only, where it used to set it on all of them.
* perf(thumbnails): an update works out a row's icon again only when its thumbnail changed
Every update event carries a thumbnail key, so the row updater worked
out the icon on each one. For a .app file or a web link that reads the
file, once per event. The icon is now refreshed only when the event's
thumbnail differs from the one the row has.
* perf(thumbnails): drawing a large folder doesn't rescan the thumbnail queue for every row
Each row handed to the filler went through every row queued before it,
looking for a job to start, so drawing a folder of files without
thumbnails took the square of its length: about a second for 20,000
rows. A row that isn't on screen yet has nothing to start, so the queue
is now only gone through when a row is reported on screen, a job ends,
or a wait is over.
* fix(thumbnails): one tab no longer drops the failed files another tab remembered
Each tab read the list of files that gave no thumbnail once, then wrote
its own copy back whole on every addition, which dropped whatever
another tab had added in between. Those files were downloaded again on
a later page load. The stored list is now read again and merged before
each write.
* perf(thumbnails): files downloaded for a thumbnail stay out of the browser's HTTP cache
The download asked the cache to revalidate, which still writes each
response to it, up to 100 MiB of originals per page load that nothing
reads back. The read route doesn't answer conditional requests, so a
cached copy could never save a download either.
* bench(thumbnails): scenario for setting a file's thumbnail from the dashboard
The dashboard calls the route for each file it fills in a thumbnail
for, up to 20 a minute, so its round trips are measured from here on.
* docs(thumbnails): list the picture formats downloaded for a missing thumbnail
* perf(thumbnails): setting a thumbnail reads the entry again alongside the write, not after it
The read that keeps the announced name and path current ran after the
update, which added a serial round trip to the route. It now runs with
the update. The window it closes is the upload before both.
* feat(thumbnails): a file saved over keeps showing its old thumbnail until the new one is ready
A save cleared the row to its type icon for the few seconds it takes to
make the new thumbnail, so a file an app saves repeatedly flashed
between the two. The row now keeps the old thumbnail while a new one is
on its way.
It goes back to the type icon at once when no thumbnail will be made
(the file is too large, the download budget is spent, the filler is
paused), as soon as the attempt fails, and after 10 seconds at most,
counted from the first save, so an old picture can't stay on a file
that keeps changing.
* fix(thumbnails): a document gets its thumbnail when the view goes to the list and back while it's made
A list row shows a document's type icon, so switching to the list gave up
on the thumbnail being made for it. Switching back before that ended found
the version already tried and queued nothing, and the row kept its type
icon until the folder was drawn again. The row now takes the job back.
* fix(thumbnails): a file being saved waits to settle whatever the computer's clock says
The wait before a saved file is downloaded was measured from its modified
time, which the server sets, against the browser's clock. On a computer
whose clock runs a few seconds ahead the wait came out as zero, so every
save of a file an app keeps saving started a download that the next save
cancelled. A file an update just arrived for now waits at least two
seconds, the least it waits when the clocks agree.
* fix(thumbnails): an item in a file dialog gets a new thumbnail when its folder isn't the one on screen
The row updater only set a thumbnail through the entry a Files row
carries. An update for a file shown only in a file dialog, with another
folder open in Files, matched an item that has no entry, and the item
kept the picture it had.
* refactor(thumbnails): the row observer asks for no margin around the screen
The 200px margin never took effect. The rows scroll inside the listing's
own pane, and a margin on the viewport doesn't widen what that pane clips,
so a row was only ever reported once it was on screen. That's also what
the download budget is written for, so the option goes rather than being
made to work.
* test(thumbnails): a version tried once, a hidden tab, and a browser saving data
Three of the filler's cost guards had no test: a version whose thumbnail
the server turned away isn't downloaded again in the page load, nothing
starts while the tab is hidden, and nothing is downloaded when the
browser asks to use less data.
* perf(whoami): answer from the user row token auth already loaded
Token auth builds the actor from the user's row with the password hash left
out. It now records `hasPassword` in its place, so /whoami builds the details
(`oidc_only`, `is_temp`) from the actor and skips reading the same row again
by id. An actor built any other way still reads the row.
* perf(thumbnails): reuse a read URL signed this hour
A thumbnail's read URL is the same for the whole signing hour, so listings
re-signed it for nothing. Signed URLs are kept per signing client, keyed by the
signing key, bucket, object key and hour (5,000 entries, one hour). A new
signing key signs afresh.
* perf(kv): a refused conditional write ends at the refusal when it can
`set` with `onlyIfAbsent` on a live key, and a write or delete into a
foreign namespace refused by a private entry, made four store calls: the
refused write, a refused expired-row delete, a consistent read and a second
refused write. The conditional write now asks for the refusing item. When its
`ttl` is absent, null or a number, the condition already judged it the way
reads do and the refusal stands after one call. A text or boolean `ttl`, or a
refusal without the item, still settles and retries as before.
* perf(gui): the dashboard reads its saved settings in the boot batch
The GUI's boot KV batch fetched the desktop's keys on every boot, while the
dashboard read its seven (Files view and sort, Apps order, groups and
uninstalled list) one request each. The batch now carries the keys of the
interface that booted. The uninstalled-apps read-modify-write skips the batch,
which may predate another window's write.
* perf(profile): answer a revalidated GET /profile without reading it
A profile write records a hash of the stored JSON in the file's metadata.
GET /profile sends it as the ETag with `Cache-Control: private, no-cache`
and answers a matching If-None-Match with 304 before reading the stored
profile. Visibility is checked first, so a hidden profile still 404s. A
profile stored before this has no tag until its next write.
* fix(thumbnails): a listing's concurrent signings share one URL cache
The per-client cache was registered after the first signing returned, so a
cold client's first listing kept only one of the URLs it signed.
* fix(kv): recheck a refusing row's expiry and its private flag
A numeric `ttl` that passes while the refusal is on its way now settles and
retries, as before, instead of answering false. A share holder's refused
`onlyIfAbsent` takes the private flag from the refusing item rather than an
eventually consistent read after it. DDBClient tests cover the request and
the undecoded item on the wire.
* fix(gui): Apps refreshes read the saved layout from the store
Only the open's first load takes it from the boot batch. A refresh exists to
pick up another tab's changes, which a batch fetched a few seconds earlier can
predate.
* fix(profile): tag a profile response by the bytes it carries
The file is written before its entry and the entry can be read from a cache
that is behind, so a 200 now carries the tag of what was read. Tags are weak
(the compressed and plain bodies share one) and the early 304 sends
`Vary: Accept-Encoding` like the 200. A profile stored without a tag still
answers 304 to its content tag, after reading the file.
* fix(kv): the GUI boot batch only answers for the token it was fetched with
A sign-in from another tab swaps the token while the batch is still live, so
reads under the new account fall through to the store.
* feat(alarms): channel keys, warning in chat, and calls an uptime monitor can poll
- `create(..., { channel })` names the area that owns an alarm; config maps
keys to Slack channels (`pager.slack.channels`), unmapped keys post to the
default channel. `HttpError` takes `alarmChannel`, and the upstream_* codes
the error gate forces go to `ai_providers`.
- Slack can post with a bot token (`chat.postMessage`), which reaches any
channel and links a call to its message; the webhook stays as a fallback.
- Defaults: PagerDuty takes `error` and up, Slack takes up to `warning`.
- `pager.calls.rules` maps alarm ids or prefixes to call groups. A matching
alarm is recorded in system KV until it has been quiet for `ttlMs`;
`GET /alarms/calls?group=` (internal-auth secret) answers 503 while one is
active, with a short plain-text body linking each call's chat message.
- Core alarms retiered: non-urgent `warning`s become `info` with a channel;
critical and error alarms are unchanged.
* fix(alarms): keep warning on the pager; calls link to where the alarm landed
- PagerDuty takes `warning` and up again, and Slack stays at `info` when a
pager exists: `warning` is the low-urgency pager queue, `info` is chat.
- An alarm that calls is no longer also posted to Slack. Its link comes from
the transport that took it: the Slack message, or the PagerDuty incident,
looked up with the new `pagerduty.apiToken` (REST, read-only is enough).
- The PagerDuty transport moves to its own module.
A string containing :// is looked up as a URL instead of a name. The
puter-apps driver's read takes id.url and resolves it through
appUidFromOrigin, so it returns the same app a page on that origin acts
as.
* fix(auth): AuthMe reads forwards_to only from configured relays and never redirects onto the GUI
The authorization dialog names the host in `forwards_to` only when the
redirect's origin is listed in the new `authmeRelayOrigins` config, rather
than for any host under the deployment domain. An AuthMe request whose
redirect lands on the GUI's own origin is refused before the dialog opens,
since GUI pages pass their query on to whatever they launch.
* fix(fs): hold direct writes to their declared size or the owner's free storage
Writes that stream straight onto a file's object (`/fs/write`,
`/fs/batchWrite`, WebDAV PUT and signed `/writeFile`) now cap the body
before it is stored:
- A stream that declares a size fails with 400 once more bytes arrive than
it declared, and the upload is aborted.
- A stream that declares 0 (a chunked WebDAV PUT, `/writeFile`, a multipart
part sent with size 0) is capped at the owner's free storage and fails with
413 past it. Parts of one batch share that allowance.
- A body of known length that is longer than declared is checked against
the owner's free storage before the upload instead of after.
A refused overwrite leaves the stored file and its recorded size unchanged.
A new file whose write fails after its upload has its object deleted. The
last chunk of a capped stream is held until the body ends, so the store
never completes an upload that later turns out too long, and a PutObject is
aborted when its streamed body fails.
* fix(workers): uninstalling an app takes down its workers in the account
The workers an app runs in a user's account, and those bound to apps it
created there, are deleted when the user uninstalls it: script, sessions and
row. A redeploy of any kind (hot reload, unsuspension, an edge redeploy of an
evicted script) reads the row's app, so with the row gone none of them can
mint a token for the uninstalled app again. A worker bound to an app the user
owns is kept. When the edge can't delete the script, the row is still
removed and the script delete is retried in the background.
* perf(share): withdraw a share's access modes in one revoke
Withdrawing a share revoked each of the five access modes on its own, every
one a delete, a primary re-read and a cache bump in series. It now uses the
batch revoke: one delete, one re-read and one bump, with each removed
permission still audited and announced. A file's withdrawal also skips the
subtree scan for re-shares managed below it, since a file has nothing below
it. Adds a benchmark scenario for withdrawing a file share.
* perf(puter-js): an update to a file drops only that file from the FS cache
`item.updated` for a file now removes its cached entry and its folder's
listing, including an entry still cached under the file's old path, since
a rename arrives as an update naming only the new path. An update to a
directory still clears the whole cache. Before, any file overwrite cleared
the whole cache, and the desktop then re-read its warm folders.
* perf(puter-js): the desktop handing back its own token reads the user once
In the GUI environment, `setAuthToken` with the token it already holds no
longer re-reads `/whoami` when the user was read with that token and API
origin, or a read is still in flight; `puter.os.user()` there keeps what it
reads as `puter.whoami`. The auth-state change and its cache check still
run. The desktop merges the user it stores into `puter.whoami` when the token
is unchanged, so an account saved under a new username shows up there.
Other environments behave as before.
Model Studio's catalog lists dated snapshots and -latest names that a curated model already carries as aliases. Each became a second, unpriced entry, so the model list showed those models twice. Such a name now adds its alibaba: spelling to the curated model's aliases instead, so the model is listed once, with its price, and the alibaba: name keeps routing to it.
* fix(replicate): send input images as the bytes measured for billing
Each input image is fetched once, measured, and passed to Replicate as those bytes, which the client uploads to Replicate's file store. An input that can't be read as an image is refused with 400 instead of being billed as one megapixel.
* fix(ocr): hold the page limit for a PDF whose pages can't be counted
When the balance can't cover the page limit, the call holds the size-based estimate and asks Mistral for only that many leading pages. A pages selection still holds only the selected pages.
* fix(tts): bill gpt-4o-mini-tts by the tokens OpenAI reports
The model is streamed as server-sent events, decoded back into the audio stream callers get, and charged the input and audio tokens from the final event. The per-character rate on the text and instructions is the hold, and is charged when no usage arrives.
* fix(realtime): response holds include the conversation so far
Each response holds the fixed budget plus every token the previous response read and wrote, priced as uncached audio input. An unreported response is billed the same amount.
* fix(apps): reserve godmode app hosts and the puter.* launch params
apps.create and apps.update refuse an index_url on the host of a godmode app. The desktop drops puter.* params already in an index_url before adding its own. Dev Center inserts the payout email as text.
* fix(puter-js): fs.upload refuses paths outside the destination folder
A file or folder whose path resolves outside the destination, such as through .. segments, rejects the upload with invalid_upload_path before anything is written.
* docs: changelog and quota entries for the billing and upload changes
* fix(tts): skip a [DONE] line in the speech event stream
Also adds a gpt-4o-mini-tts integration case that checks the streamed audio and the billed tokens.
* fix(ocr): a document whose pages can't be counted reads only what the balance covers
Counted PDFs hold their page count. Anything else that can't be counted, such as a DOCX or an encrypted PDF, holds the provider's page limit, or as many leading pages as the balance covers, and Mistral is asked for only those pages. Drops the size-based page guess. The changelog keeps only the developer-facing upload error.
The chat credit gate emitted metering.out-of-credits only when the
balance couldn't pay for the prompt. A balance that covered the prompt
but not the reply capped max_tokens and flagged the response
usage_limited, so the caller saw a funds prompt while no listener was
asked to add credit.
The gate now asks when the balance is short of the prompt plus output
up to the request's limit, and reads the balance again if a listener
added credit.
* fix(gui): make Open With a one-time choice with an explicit default
Choosing an app under Open With opens the file in it and nothing else; it
no longer asks to make that app the default for the file type. A new
"Always Open .<ext> Files With" submenu lists the suggested apps with the
current default checked and saves the one picked.
Open With lists the default app first, then the rest in the server's
order. Third-party apps for an extension come back in registration order
instead of whatever order the database returned.
The desktop item menu and the dashboard menu now build Open With from one
helper instead of two copies. The dashboard's touch menu renders checked
items. Files without an extension no longer take a default, since one was
never loaded back after a reload.
* fix(gui): close every parent menu when an item in a nested submenu is chosen
Choosing an item in a submenu of a submenu closed that submenu and its
parent, and left the root context menu open. The menu now closes with
every menu above it.
* fix(gui): close a nested submenu together with the submenu it belongs to
Moving the pointer from a third-level menu back to the root menu removed
the second-level menu and left the third on screen until the next click.
A context menu now removes its own submenus when it is removed.
* fix(gui): keep keyboard selection in the submenu being opened
Pressing the right arrow or Enter on a submenu row highlighted the first
row of the first submenu on screen. In a submenu of a submenu that is a
row of the menu the key was pressed in, so two rows ended up highlighted.
The selection now goes to the submenu that row opens.
* fix(gui): make the touch menu's checkmark visible in dark mode
The checkmark of a checked item took the button's default text color, so
it was black on the dark sheet. It now uses the same color as the label.
* fix(gui): show an extension with special characters correctly in Open With
The desktop menu encodes the label of a row that has a submenu, and the
touch menu renders it as HTML, so the already encoded "Always Open" label
read ".a&b" on the desktop for a file named "x.a&b". Each menu now gets
the label in the form it expects.
* fix(gui): treat a file name that ends in a dot as having no extension
A file named "notes." was offered "Always Open . Files With". It takes no
default app, like any other file without an extension.
* fix(gui): don't offer a default app for a folder
A folder whose name ends in an extension, such as "three.js", was offered
"Always Open .js Files With", and its Open With list was ordered by the
default app for that extension. A folder opens as a folder, so its list
keeps the server's order and has no default to set.
* fix(gui): keep a context menu label clear of its submenu arrow
When a row with a submenu was the widest row of its menu, as "Always Open
.ext Files With" is, its label ran right up to the arrow. The label now
keeps a 12px gap; menus wider than their submenu rows look the same.
* fix(gui): keep a nested submenu off the root menu near the right edge
When a menu opened close to the right edge, such as from a row's more
button, its submenu opened to the left and that submenu's own submenu
opened back to the right, on top of the root menu. A nested submenu now
continues to the left when its parent opened there and it fits, and the
pointer's path to it is judged from the side it opened on.
* test(puter-js): cover context menus with a submenu inside a submenu
Two specs for puter.ui.contextMenu(): choosing an item three levels deep
closes the whole menu, and the inner submenu closes with the submenu it
belongs to.
* docs: add the nested context menu fix to the changelog
The desktop's change-username window was only reachable from
/action/change-username, which nothing links to. The dashboard's Account
tab has its own change-username dialog. Old links now redirect there.
* fix(redis): a command that gets no answer rejects after the configured timeout
redis.commandTimeoutMs (default 2000) arms a per-command timer on the
cluster client, so a command sent to a node that never replies, or queued
while the cluster is not ready, rejects and the caller takes its error
path. Blocking commands and duplicate() clients are left without it.
* fix(broadcast): a failed pubsub publish or subscribe is logged, not left unhandled
With command timeouts, a stalled publish now rejects; the fan-out is
fire-and-forget, so the rejection is caught and logged. The sign-in relay
test pins that /login/set still reaches a subscribed /login/wait when
Redis never answers.
* fix(permissions): a scan cache read that Redis fails to serve counts as a miss
The scan then computes from the store, as the generation and per-check
cache reads already do, instead of failing the permission check.
* refactor(redis): isCommandTimeout names the rejection of a timed-out command
Callers that issue a write can recognise the timeout and queue its undo
on the same key. Also notes that a timed-out command is not withdrawn,
restores the console spies in the timeout tests, and drops formatting
churn in types.ts.
* fix(metering): an increment whose buffering timed out is counted once
On a timeout the write-through runs and the buffered copy is negated on
the same keys, so if the timed-out increment lands later the next flush
nets it out. incr and incrAux both do this.
* fix(rate-limit): a concurrency slot whose acquire timed out is removed
The ZREM goes to the same key behind the timed-out MULTI, so a slot that
lands late does not stay held until the orphan window.
* fix(uploads): leases whose take timed out are released
The release goes to the same keys behind the timed-out take, so leases
that land late do not count against the owner until their deadline.
* fix(redis-lock): a claim that timed out is released if it lands
The token-checked delete goes to the same key behind the timed-out SET
NX, so a late claim does not hold the lock for its full TTL.
* fix(broadcast): a rejected pubsub subscribe is retried with backoff
Retries start at 1s and cap at 30s, and stop once the service shuts down.
* refactor(redis): isCommandTimeout lives in its own module
Stores, the rate limiter and the lock helper recognise a timed-out
command without importing the client.
* fix(credit-holds): a hold whose take or reserve timed out is released
The release goes to the same key behind the timed-out script, so a hold
that lands late does not shrink the spendable budget for its TTL.
* fix(metering): a write-through answers without waiting on its undo
The undo's place in the queue is fixed when it is sent, so the request
no longer waits on it. When the undo itself times out, the warning says
the increment may be counted once more or not at all.
* fix(broadcast): a pubsub subscribe retry checks the client is still current
A retry that fires after shutdown no longer subscribes the closed client.
* feat(redis): after a timeout, commands fail fast until a probe gets a reply
For redis.failFastMs (default 5000) after a command times out, other
commands reject unsent with 'Redis unavailable', so a stall costs a
request one timeout instead of one per call. After each interval one
probe is sent; a reply, or the cluster becoming ready, ends it. Commands
sent through sendAsUndo, blocking commands, CLUSTER commands and
duplicate() clients are not held back. A pipeline is admitted or
rejected as a whole.
* fix(redis): undos of a timed-out command are sent while failing fast
The metering negation, slot ZREM, upload and credit-hold releases and
the lock's token-checked delete go through sendAsUndo, so they still
queue behind the original that may land. A command rejected unsent is
not a timeout, so it triggers no undo.
* test(auth): the sign-in relay completes within one command timeout under a stall
/login/set and /login/wait against a cluster whose node never answers
now finish in about one timeout, since calls after the first fail fast.
* style(redis): one-line comments, and types.ts keeps its existing formatting
* fix(redis): releases are sent while failing fast and not waited on
The lock release, concurrency-slot release, credit-hold release and
upload-lease release and settle go through sendAsUndo, so resources
taken before the breaker opened are freed rather than held for their
TTL. They are sent without awaiting; later commands on the same key
queue behind them. The KV and memory slot backends are still awaited.
* fix(redis): a retried pipeline is timed again, and only replies end failing fast
Pipeline commands whose error reply cleared their timer are re-armed when
the pipeline resends them after MOVED, ASK or a closed connection, and
the ASKING command it adds is always admitted. Only a reply, including an
error reply, counts as an answer: a closed connection or an ended cluster
no longer ends failing fast.
* fix(rate-limit): window take-backs are sent while failing fast, and a release never rejects
The ZREM or DECRBY that takes back a denied window charge goes through
sendAsUndo without being awaited, and the request is still denied. A slot
release that throws synchronously is logged, not rejected, and the
release() doc says when it settles.
* fix(broadcast): a publish failing fast warns once per stretch, not once per event
Warnings for publishes rejected with 'Redis unavailable' are skipped
until a publish succeeds again; other failures still warn every time.
* test(redis): timing bounds name their command timeout and leave CI headroom
The relay test sets a 1000 ms timeout and checks it finishes within one
timeout rather than two; the release timing bound is 250 ms.
* style(broadcast): shorter comment on the publish warning
* fix(metering): the cached base is dropped while failing fast, without waiting
forgetBase sends its DEL through sendAsUndo, so after a write-through it
still queues behind the timed-out increment and its undo instead of being
rejected unsent. incr no longer awaits it on the request path; the
MeteringService callers still do.
* fix(redis): a command rejected while failing fast is handled, so one nobody awaits can't end the process
* style(types): unrelated interfaces keep the formatting lint expects
* fix(cache): invalidations are sent while failing fast, so a write during a stall doesn't leave the old entry cached
---------
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
* fix(user): account deletion marks the account's group memberships before the row goes
The account's group reads go to the primary while its memberships cascade
away with the row, and its permission cache generation is bumped after the
delete. Both are best effort and never stop the deletion.
* test(user): format the account deletion tests
* fix(user): account deletion refreshes the readings of those it granted to
Before the row goes, members of the groups the account granted to are
read from the primary and marked; after it, they and the holders of its
user-to-user grants have their permission cache generations bumped.
Both reads are bounded and best effort.
* test(user): clear a mark a reused account id may carry before the issuer delete
* fix(user): account deletion bumps cache generations after the flat purges
* fix(permissions): a deleted issuer's user-to-user grants are listed from the primary
* refactor(permissions): keep the held-purge constants under their comment
* fix(permissions): a flat entry whose issuer account is gone grants nothing
* fix(permissions): flat entries whose issuer account is gone count nowhere and are deleted when found
Manage inheritance and share listings skip them as the flat check does,
through one store helper that also deletes them off the request path.
* docs(permissions): one-line note on the orphaned flat entry helper
* fix(permissions): an issuer missing from a replica batch is re-read from the primary before its entry is dropped
Only ids absent on the primary count as gone. Entries naming no usable
issuer are kept, and an orphaned entry is deleted only while it still
names the gone issuer. The helper hands back the issuers it read, and
the flat readers use the ref-keyed read.
* fix(permissions): missing issuers are re-read in one primary query; flat-entry tests wait on the background work
* fix(permissions): share listings pass the users they already read to the orphaned-entry check, so it reads no issuer twice
* fix(permissions): account deletion drops the cached grant rows of the holders it issued to, so a manage grant from it stops passing down
---------
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
Polly and Textract each carried their own copy of the AWS price list
fetch, region check, term checks and USD conversion. The AWS-specific
parts now live in providers/aws/priceList.ts and the exact USD to
microcent conversion in shared/catalogPrice.ts. Each service keeps only
which products it reads and which tier it bills from.
Polly's price list fetch now refuses redirects, as Textract's already did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>