mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-26 15:48:41 +00:00
84add3365407874bc4304deee5a8bdc9f53c7113
2994
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
fdc1f9f3d8 | feat(ai): add Gemini 4 Neon chat model (#4695) | ||
|
|
8955253e2f |
feat(gui): app launches say what the user did and which page sent them (#4697)
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`. |
||
|
|
442a50baed |
fix(auth): user lookups match only string and number values (#4698)
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. |
||
|
|
6b8af52077 |
feat(auth): sign-in pipeline, per-account wrong-password budget and idle session expiry (#4692)
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. |
||
|
|
e62418f7a9 |
fix(thumbnails): files edited or written by apps get a thumbnail in the dashboard (#4691)
* 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. |
||
|
|
6478f18feb |
perf: whoami row reuse, thumbnail URL cache, KV refusals, dashboard KV boot batch, profile revalidation (#4687)
* 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. |
||
|
|
25804a8fbe |
Merge pull request #4681 from HanadHassan/HH/alibaba-catalog-snapshot-aliases
fix(ai): Alibaba snapshot names fold into the curated model instead of listing unpriced |
||
|
|
521b03a4b0 |
Update recommended creative apps
Replace `pdf-editor` with `pdf` and add the photo, video, vector, audio, music, and 3D studio apps. |
||
|
|
bc73cde987 |
feat(alarms): channel keys, and calls an uptime monitor can poll (#4672)
* 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.
|
||
|
|
327eef2d32 |
feat(apps): puter.apps.get() accepts a URL (#4686)
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. |
||
|
|
6b7541d0b6 |
fix: AuthMe relay names, write size caps, worker teardown on uninstall, and fewer share, cache and whoami round trips (#4683)
* 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. |
||
|
|
713c5aabb9 |
fix(ai): Alibaba snapshot names fold into the curated model instead of listing unpriced
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. |
||
|
|
5d2eaeb981 |
fix: billing holds that follow what AI calls cost, reserved godmode hosts, contained upload paths (#4671)
* 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. |
||
|
|
7d046acdb9 |
fix(apps): stop suggesting draw as a built-in opener for images
Images now map to viewer alone. An app named draw is suggested for an image only when it registers the extension, like any other app. |
||
|
|
25ba1de867 |
fix(ai): a chat request the balance would cut short asks top-up listeners first (#4679)
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. |
||
|
|
245254ce0c |
fix(gui): make Open With a one-time choice with an explicit default (#4677)
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(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 |
||
|
|
b904eddc69 | feat(ai): add GPT-6.2 Astra and Sol with API pricing (#4678) | ||
|
|
6b4e7cb28a |
chore(deps-dev): bump vite from 8.1.6 to 8.1.7 (#4675)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.1.6 to 8.1.7. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v8.1.7/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v8.1.7/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 8.1.7 dependency-type: direct:development 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> |
||
|
|
74c5bb54a0 |
chore(deps): bump postal-mime from 4.2.0 to 4.2.1 (#4674)
Bumps [postal-mime](https://github.com/postalsys/postal-mime) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/postalsys/postal-mime/releases) - [Changelog](https://github.com/postalsys/postal-mime/blob/master/CHANGELOG.md) - [Commits](https://github.com/postalsys/postal-mime/compare/v4.2.0...v4.2.1) --- updated-dependencies: - dependency-name: postal-mime dependency-version: 4.2.1 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> |
||
|
|
66668e819b |
Merge pull request #4667 from HeyPuter/fix/qwen4-max-pricing
fix(ai): add Qwen4-Max billing rates |
||
|
|
13371a5b1b |
Merge pull request #4663 from HeyPuter/fix/standard-model-pricing
Use regular model prices instead of launch promotions |
||
|
|
0005bf1803 |
Merge pull request #4661 from HeyPuter/refactor/aws-ai-providers
Group the AWS AI providers and share their price list parsing |
||
|
|
7b35cbafa7 | fix(ai): add Qwen4-Max billing rates | ||
|
|
037ba9b214 |
refactor(gui): /action/change-username redirects to the dashboard's Account tab, and its desktop window is removed (#4665)
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. |
||
|
|
b85c04d49a |
fix(redis): a command that gets no answer rejects after a timeout, and commands fail fast while Redis is stalled (#4656)
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(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> |
||
|
|
d51fc36563 |
fix(user): account deletion marks memberships first, and a deleted issuer's grants count nowhere (#4655)
* 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> |
||
|
|
f4568a20c7 | Use regular GPT-5.6 Sol token prices | ||
|
|
24488dc483 | Fund Gemini speech routing test reservations at regular rates | ||
|
|
62cb99b8a8 | Use regular Gemini model prices throughout launch promotions | ||
|
|
b42c6f1448 |
Share the AWS price list parsing between Polly and Textract
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> |
||
|
|
1276765a5c |
Move the Polly and Textract providers into providers/aws
Both are AWS services, so they share one vendor folder like every other vendor: providers/aws/textToSpeech and providers/aws/ocr. Files move as they are; only the four imports that point into them change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
214f189a1a |
fix(ai): Textract OCR sends a file's bytes to the configured region when its bucket's region has no Textract
Textract reads S3 objects only from a bucket in its own region, and AWS doesn't run Textract in every region. A file whose bucket is in a region without Textract is now sent as bytes to the configured Textract region and billed at that region's rate. The provider decides this before any Textract call, from the bucket region's public price list: AWS publishes one for each region it runs Textract in and answers 404 for the others. The price cache keeps that 404 as an answer for its normal lifetime instead of retrying it as a failure, and the credit hold for such a call is sized from the configured region's rate alone. When the price list can't be loaded, an S3 read whose Textract hostname doesn't resolve (ENOTFOUND) falls back to the bytes the same way. Any other error from the bucket's region surfaces as before. |
||
|
|
237ff84cc5 |
feat(hosting): sites list their custom domains, and hosting.detach() removes them (#4651)
* feat(hosting): sites list their custom domains, attach names a moved domain's old site, and hosting.detach() removes domains
- puter-subdomains read/select return `custom_domains` ({ uuid, hostname,
status }) per site, filled by a `site.customDomains` event listener. Only
rows attached under the site's current owner count; the field is left out
when the listener fails, so a failed lookup never reads as "no domains".
- The attach dialog's answer carries `previousSite` when the user moved the
domain from another site, kept through a status check or switch to www.
- puter.hosting.detach(subdomain) opens the custom domain dialog in a
remove-only mode (desktop message, frame, or popup) and resolves the
domains the user removed, or []. Desktops advertise it as
`custom-domains-detach`; older ones reject with not_supported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(workers): expect the sandbox-owner message create() throws now
create() rejects another user's sandbox app with "The sandbox app '…'
belongs to another user…" since the workers name-cap fix; the deploy test
still expected the old wording and failed on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
e7bc94029c |
fix(workers): name length cap, sandbox app freed on delete, no app opens from workers (#4631)
- Worker names are capped at 50 characters, the most a `workers.puter.<name>` subdomain row holds. A longer name is a 400 before any token is minted, instead of a 500 from the insert. The publish dialog caps at 50 too. - Deleting a worker deletes its `sandbox-<name>` app when nothing else runs as it, so the name can be reused by another user. A sandbox app owned by someone else rejects with `sandbox_not_owned` instead of a TypeError. - POST /rao records nothing for a worker or events handler actor, and the worker runtimes' clients no longer ask. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
bd50fde0b1 |
feat(auth): end every session of several users in one batch (#4603)
AuthService.revokeAllSessionsForUserIds reads the listed users' sessions from the primary and cascades them together, 200 users at a time, and still announces each user's revocation on its own. revokeAllSessionsForUserId is its one-id case. SessionStore.getByUserIds is the batch reader, and getByUserId calls it. |
||
|
|
9ca1acf634 |
Benchmarks that gate PRs on I/O regressions, wider test baseline, and npm run check (#4644)
* feat(bench): backend benchmarks that fail a PR for waterfalled or uncached I/O A scenario runs a request against the in-memory backend and records every SQL, key-value, Redis and object-storage round trip on a modeled clock, then reports round trips per destination, serial stages and modeled latency. tools/bench.mjs runs the scenarios on a base commit and on the head and fails on a regression the pull request description does not accept; benchmarks.yaml runs that on every pull request. Also adds npm run check (lint, type check, related tests and the benchmark comparison for the files a branch changed) and describes the distributed deployment in AGENTS.md. * test(bench): scenarios for fs, kv, auth, apps, permissions, sharing and hosted sites * test(puter-js): count the SDK unit tests in the coverage report Only the bundle the API runners load was instrumented, so the unit tests next to the SDK source never counted. In coverage mode the vitest config now instruments SDK source for them and writes one shard per test file. * test(puter-js): unit tests for ui messaging, dialogs, components, uploads, peer and smaller modules * test(backend): cover fs, permission, app, worker, sharing, broadcast and user edge cases * fix(backend): fs write flags are stored as booleans, app stats weeks are ISO weeks - A write's boolean flags reach the store only once read as booleans; any positive number reads as true. - App open stats grouped by week use ISO 8601 weeks for both the buckets and their labels on every database engine, so the two agree across a year boundary. * fix(puter-js): dialog token source, legacy upload cancel, submenu state, typed-array views - The sign-in dialog takes the token only from the popup it opened, and stops listening when it leaves the page. - Cancelling a legacy upload rejects with `upload_aborted` and no longer runs the `error` callback. - A context menu's submenu stays in step with its parent when the parent item is pressed or the submenu closes itself. - The FileReader polyfill reads a typed-array view through its own offset and length. * ci(bench): benchmark a pull request as merged into its base The comparison ran the branch's own head against the tip of the base branch, so a branch behind its base was charged for (or credited with) what the base gained since. The head side is now the merge commit and the base side its first parent. Shards also get a 15 minute timeout. * test(broadcast): shutdown drain tests send boot's own events first Boot queues cache updates that flush 10 ms later. A test body that started after that flush counted it as its own request, which failed 'bounds a hung flush in onServerShutdown' on a slow runner. |
||
|
|
679f577cd8 |
feat(ai): a declined Claude request reruns on a fallback chain, and its conversation stays on the model that answered (#4641)
* Rerun declined Claude requests on Anthropic's fallback model A Claude model with safety classifiers can decline a request and end it with stop_reason "refusal". Requests to the models that have server-side fallback (Fable 5.2, 5.1 and 5, Opus 5.5 and 5, Sonnet 5.5) now carry `fallbacks: "default"` and the server-side-fallback beta, so Anthropic reruns a declined request on the model it recommends for that refusal and the caller gets that model's answer in the same response. - `refusalFallback: false` turns it off for a request. The Anthropic route takes the native `fallbacks` field instead: "default" or a list of models is the caller's own chain, null turns it off. - The `fallback` content block is a `refusal_fallback` chunk in a stream and `refusalFallbacks` on a non-streaming result, where it is taken out of `message.content`. The Anthropic route writes it back as a native block and accepts it in replayed messages. - `usageDetails.fallbackModel` names the model that answered. - A final refusal is forwarded as before, without the fallback-credit fields of `stop_details`. - A request Anthropic rejects over a fallback the caller did not ask for is sent again without it. * Meter each Claude fallback attempt on the model that ran it A request Anthropic reruns on a fallback model is several attempts, each billed at its own model's rates. `usage.iterations` carries one entry per attempt and the top-level counts describe only the attempt that answered. - Every attempt is its own charge, priced at the rates of the model that ran it and recorded under that model's key: the answer from the top-level counts, each declined attempt from its iteration entry. Nothing is counted twice, and a fast request's attempts are priced at each model's fast rates. - The reported `usage` keeps the answering attempt under the plain keys and adds a declined attempt's tokens under `declined_` keys. Like the advisor's, only their recorded cost prices them, and they are no part of the request's own prompt or output totals. - A provider's `requestPricing` can name the models the upstream may rerun the request on. The credit gate then prices the prompt and the capped output once per model, each at its own rates and cost factor, for the affordability check, the output cap and the hold. Claude names the priciest target of default routing, or every model of a chain the caller named. * Charge a declined Claude request only when Anthropic bills it Anthropic bills a request its classifiers decline before any output only in the bio, frontier_llm and reasoning_extraction categories; any other category, or none, is not billed. A request declined after it produced output is billed for its prompt and that output. Metering follows the same rule for each attempt: the final refusal by its `stop_details.category`, and an attempt that declined before a fallback by the `trigger.category` of its `fallback` block. An attempt Anthropic does not bill is recorded with its token counts at no cost. An attempt whose refusal details are missing is charged as before. * Estimate images inside tool results as attachments The credit gate's prompt estimate read a `tool_result` as the text of its serialized content, so a base64 image inside one counted as text, at many times the tokens the image costs. An image or document block inside a tool result is now estimated the way a top-level one is, from its payload size. Text and other blocks in the result are counted as before. * Name each Claude model's fallback chain, and keep a declined conversation on the model that answered A request to a Claude model with fallback targets names them in order (Opus 5, then Opus 4.8) instead of asking for default routing, which leaves some refusal categories declined. puter.js remembers the model that answered a declined turn and names it on later turns of the same conversation, so they skip the declined attempt. The backend runs such a request on that model and presents it in the requested model's response format. * Rerun a declined Claude request from the driver, one attempt at a time A request a Claude model declines is now rerun by the chat driver on the model's fallback models, instead of by Anthropic inside the same API call. The request sent upstream is the same as before this branch: no `fallbacks` field and no extra beta header. Each rerun is a whole attempt of its own. It goes through the credit gate against the balance left after the declined attempt, takes its own hold once the declined attempt's hold is released, and is metered by the provider under its own model. A request reserves one attempt at a time, as any other chat request does. When the balance can't cover the rerun, or the rerun fails, the response is the refusal. A non-streamed request is rerun on any refusal. A streamed request is rerun only when it was declined before any output, and the answer follows a `refusal_fallback` chunk on the same stream. The response reports the model that answered in `usageDetails.fallbackModel`, each switch in `refusalFallbacks`, the declined attempts' tokens under `declined_` usage keys, and the total charged in `usage.cost`. It keeps the requested model's format. A conversation pinned to a fallback model that declines continues down the rest of the requested model's fallback models. The Anthropic route reads `fallbacks: null` or `false` as an opt-out and ignores any other value. Claude restores `puter_path` parts after a refusal, so a rerun uploads the files again. |
||
|
|
04b9244913 |
feat(workers): a suspended account's workers stop serving until the suspension lifts (#4649)
Suspending an account already made its hosted sites answer 404, but its deployed worker scripts kept running. - On `user.suspended` the worker driver removes each of the owner's deployed scripts and keeps the rows. On `user.unsuspended` it deploys them again from their source files, without the per-worker notification. The local runtime needs no redeploy: it builds a worker from source on its next request. - Hot reload skips a suspended owner, so a write by someone the source file is shared with does not bring the script back. - The local worker runtime answers 404 for a suspended owner's worker instead of deploying it on demand. |
||
|
|
bc456982e9 |
feat(metering): events for an actor's balance and for a refusal a listener can make good (#4643)
* feat(metering): report an actor's balance each time it is worked out `metering.balance` carries what an actor on a metered plan has left to spend and the plan it was worked out under. It is emitted when usage settles and when a credit gate re-reads the balance, so an extension can act on a low balance without reading it itself. The balance a settling batch reports now counts the purchased credit that batch drew, so the credit gate and the exhausted notice follow the batch that spends the last of it instead of the one after. A batch that settles right after a credits change still reports the credit as read, since that read may predate the change. `MeteringService.isUnmetered` is public, for callers that need to tell a plan with nothing to run out of from one that has run out. * feat(metering): let a listener top an actor up at the moment of refusal `metering.out-of-credits` is emitted, and waited on, when an actor is about to be refused for lack of credit. A listener that adds credit sets `refilled`, and the refused work is tried once more instead of failing. It is asked from the three places a refusal is decided: the credit gate on routes, the shared credit reservation the AI drivers use, and the chat driver's own gate. Each tries again once, after the listener answers, and refuses as before when nothing was added. * fix(metering): count a flush's write once in a read with no cached base An increment for a counter with no cached base read the store after its buffer snapshot with nothing ordering the two, so a flush landing in between was counted from both, and that store read was then kept as the base. It now reads the store the way other reads do, starting from the increment's own snapshot. A write that has reached the store but is not yet applied to the buffer looks the same from the buffer as one still on its way. `kv.get` can now answer with the last fence token a writer applied to a key, and a read counts such a write's amounts from one side only. A read that sees a write sent between its snapshots is retried. A base is laid from a store read only if no write was out when it was read and none has been sent since. |
||
|
|
e17783931f |
fix(ai): follow-ups to the AI driver stack: optional image type hint, stable fuzz cases, provider-only integration workflow (#4638)
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
* fix(ai): the image type hint only has to be a string when a request carries an input image * fix(ai): OpenAI speech to text answers 400 to a prompt that is a list or an object * test(ai): a fuzz case keeps its input and route when the catalog changes, and a suite that reaches no provider fails * fix(ai): a model id with a colon after its vendor keeps its name when it is qualified * fix(ai): the native Gemini request type accepts the xhigh effort Hydrogen takes * style: restore the repo formatting in files the AI stack reflowed * docs(ai): the image reference and quotas page cover Replicate's safety reruns * ci: the AI provider workflow runs only the provider tests and passes every provider's key |
||
|
|
4d4b0b0990 |
Qualify published chat model names while preserving routing aliases (#4624)
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
651a303bb0 |
Point Mistral's floating Large aliases at Large 4, apply its GA price and cap its output (#4623)
* Point Mistral's floating Large aliases at Large 4 and apply its GA price Mistral made Large 4 generally available on 2026-11-05, moved `mistral-large-latest` to it, and deprecated Large 3 and Medium 3.5, which both retire on 2027-04-30. - `mistral-large-latest`, `mistral-large` and `mistralai/mistral-large-latest` resolve to `mistral-large-4`. They resolved to `mistral-large-2512`, which stays callable by its own id until Mistral retires it. - Large 4 uses Mistral's current rates: $0.70 input, $0.07 cached input and $2.10 output per million tokens, in place of the preview rates. It is marked open-weight. - The Large 3 and Medium 3.5 entries carry their retirement date. * Cap Mistral Large 4 output at the 262,144 tokens Mistral accepts The catalog listed `mistral-large-4` with a 1,000,000-token output limit, equal to its context window. Mistral rejects a request for more than 262,144 completion tokens, so a request that left `max_tokens` unset, or set it higher, failed with a 400 whenever the account's credit covered more than 262,144 output tokens. - `max_tokens` for `mistral-large-4` is 262,144. The context window stays at 1,000,000 tokens. - A test sends `mistral-large-4` and `mistral-large-latest` through the chat driver with ample credit and checks the cap that reaches Mistral. --------- Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
4ec125bbc6 |
Add Gemini 4 Carbon, Gemini 4 Hydrogen and Kling 4 video models (#4616)
* Add Gemini 4 Carbon and Kling 4 video models * Include Kling 4 models in the video driver catalog test * Document the Kling 4 prompt limit for non-English text Kling 4.0 and 4.0 Flash take 26,000 characters of English but 11,000 of other languages, with mixed text sharing the limit in proportion. The video page and the quotas page said 26,000 for every prompt. - txt2vid.md and rate-limits-and-quotas.md give both limits, the rule for mixed text, and the error each one returns. - Puter still rejects only a prompt over 26,000 characters. Kling enforces the lower limit, and its refusal reaches the caller as `upstream_bad_request` with nothing charged. A test covers that path. * Add Gemini 4 Hydrogen and cap unary Gemini 4 Carbon output Google released `gemini-4-hydrogen` on 2026-11-12. It uses the same native request shape as Carbon and Argon. - Hydrogen is served natively at $1.50 input, $7.50 output and $0.075 cached input per million tokens, with fast service at 1.8 times those rates. It accepts `low`, `medium`, `high` and `xhigh` reasoning effort, ignores temperature, and takes text and images. - A Carbon response that isn't streamed is capped at 32,768 output tokens, as Argon's already is, and the credit hold is sized to that cap. Google reports this limit for both models. The cap is now a field of the native model options instead of a check on Argon's id. - chat.md and rate-limits-and-quotas.md list Hydrogen's reasoning levels and limits and Carbon's unary cap. * Move the reasoning_effort model list out of the chat options table The `reasoning_effort` row in chat.md listed the models that read the option. Model-specific details belong under Model-specific features, which already gives each family's accepted values. - The row no longer names models. - The Gemini and Moonshot Kimi sections say that their other models ignore the option. --------- Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
f6139147fd |
Hold the AI concurrency slot until a detached chat completion settles (#4615)
A chat completion keeps running for up to 10 minutes after the caller hangs up, so the upstream can report usage. It now counts against the caller's concurrency cap for as long as the upstream runs, instead of until the response closes. - The chat driver registers its upstream run with the request's concurrency slot, so `/drivers/call` keeps the slot until the upstream is done. The cleanup after it does not hold the slot. - The route concurrency gate now uses the same CallSlot as `/drivers/call`: the slot is held until the response is done and the work the handler registered has settled. The OpenAI- and Anthropic-compatible chat routes register the completion, so a non-streaming call counts until the upstream answers too. - CallSlot moves to core/http, since the route gate below the controllers uses it. The context key is renamed keepConcurrencySlot. - rate-limits-and-quotas.md says a completion counts until the model finishes it, even after a disconnect. Co-authored-by: Daniel Salazar <daniel.salazar@puter.com> |
||
|
|
2d12dcc99f |
Reorganize AI drivers and harden request handling (#4614)
* Move the AI drivers into drivers/ai
The seven drivers/ai-* folders and the AI-only helpers in drivers/util
become one tree:
drivers/ai/interfaces/<interface>/ the Puter-facing drivers
drivers/ai/providers/<vendor>/<interface>/ vendor adapters, catalogs, tests
drivers/ai/protocols/openaiCompatible/ the shared OpenAI wire protocol
drivers/ai/shared/ helpers several interfaces use
Files are moved and their relative imports rewritten; no implementation
changes. Driver names, aliases, interfaces, config keys, model ids and
usage keys are unchanged.
The chat catalog registration test scanned providers/*/ next to itself.
It now scans providers/*/chat/ and fails if the scan finds no catalog, so
a wrong directory can't pass it.
General helpers that non-AI code also uses stay in drivers/util: file
input, data URIs, upstream errors, stream piping, CRUD limits.
* Document the AI driver layout
doc/ai-drivers.md explains what interfaces, providers, protocols and
shared each own, the import rules between them, where a new file goes,
and the steps for adding a provider or an AI interface. It also lists
the three places that don't follow the layout yet.
doc/architecture.md and AGENTS.md link to it.
* Move catalogPrice into ai/shared
Chat providers and the Cloudflare and xAI image catalogs all parse vendor
prices with catalogPrice, so it lives in shared/ instead of the chat
interface's pricing helpers. The image catalogs no longer import from
the chat interface.
* Move the Textract and Mistral OCR calls into provider classes
OCRDriver held both vendors' clients, request building, response
normalizing and metering. That now lives in TextractOcrProvider
(providers/awsTextract/ocr) and MistralOcrProvider (providers/mistral/ocr),
both implementing IOcrProvider. The driver keeps the provider catalog,
model resolution, auth and credit gates, and input resolution.
The page estimate, document detection and credit hold both providers use
are in interfaces/ocr/common.ts.
No behavior change: same validation order, error messages, usage keys,
holds and charges.
* Move the ElevenLabs voice changer into a provider class
VoiceChangerDriver built the ElevenLabs request, measured the converted
audio and metered it, and imported the output formats from the ElevenLabs
text-to-speech provider. That code is now in providers/elevenlabs:
outputFormats.ts formats both speech interfaces use
speechToSpeech/ElevenLabsSpeechToSpeechProvider.ts
speechToSpeech/measuredOutput.ts WAV, Opus and byte-rate timing
speechToSpeech/costs.ts
The driver keeps provider resolution, test mode and the auth check. With
one provider it holds the class directly; there is no provider interface.
No behavior change: same validation order, error messages, usage keys,
holds and charges.
* Move the AI billing helpers the realtime relay uses below the driver layer
OpenAIRealtimeRelayService is a service, and it imported the cost factor,
the provider key reader and a transcription price from drivers/ai. Those
now live in src/backend/util, which both layers can import:
util/aiCostFactor.ts withAiCostFactor, withAiCreditHold and the
request cost helpers, unchanged
util/aiProviderKey.ts readProviderKey, cut from providerRegistry.ts
util/aiPrices.ts the gpt-transcribe per-second price, read by the
OpenAI speech-to-text cost table and the relay
withStreamedAiCharge returns a DriverStreamResult, so it stays in the
driver layer as drivers/ai/shared/streamedAiCharge.ts with its tests.
MeteringService is untouched. No prices or billing behavior change.
* Remove the aiUserIdentifier alias
shared/aiUserIdentifier.ts re-exported upstreamUserIdentifier under a
second name, and only its own test imported it. The alias is gone; its
tests, which cover truncation and actor shapes the other file didn't,
replace the four cases in upstreamIdentifier.test.ts.
* Move the AI test helpers into the AI tree
drivers/integrationTestUtil.ts held helpers for AI provider tests, but a
store test and the realtime relay test imported from it too.
drivers/ai/shared/integrationTestUtil.ts the provider test helpers
testEnv.ts optionalEnv and skipUnlessEnv,
for any env-gated suite
testUtil.ts withAiCostFactorHook, next to
the server it hooks
No test under services/ or stores/ imports from the driver layer's AI
code now. The typecheck baseline entry for the moved file is renamed, not
regenerated.
* Split the tool and compaction helpers by dialect
FunctionCalling.js and compaction.js each held Puter-facing parsing next
to OpenAI and Anthropic request shapes. Each dialect now owns its mapping:
interfaces/chat/utils normalize_tools_object, readCompaction and the
other dialect-neutral checks
protocols/openaiCompatible/openaiParams.ts
toolsToWire (was make_openai_tools) and
toOpenAiContextManagement
providers/claude/chat/contextManagement.ts
toAnthropicContextManagement
toolsToWire takes the dialect as its second argument, like the other
mappers in that module, and takes an array; every caller already guarded
the empty case.
make_claude_tools is removed. Nothing but its tests called it: the Claude
provider uses claudeToolPolicy directly. The three cases only those tests
had are added to the claudeToolPolicy tests. The chat interface helpers no
longer import from providers/claude.
* Remove the unused ImageProvider base class
Every image provider implements IImageProvider directly; nothing extended
or imported the abstract class in interfaces/image/ImageProvider.ts.
The guide's import rules now say that only an interface's driver file
imports providers, which holds since the tool helpers stopped importing
the Claude policy.
* Rerun Replicate predictions an output safety checker rejects
Some community models check the generated image and fail the
prediction with "Try running it again" for a share of seeds, whatever
the prompt. adirik/realvisxl-v3.0-turbo failed 5 of 24 runs of "a small
red cube on a white table" that way.
A prediction that fails with that message is now run again, up to two
more times, inside the same deadline and credit hold. A request that
pins a seed is not rerun, because the same seed is rejected again.
Only the prediction that succeeds is metered, as before.
* Answer malformed AI requests with a 400 where they enter
A value that used to end in an unclassified error, in a request or in
an upstream answer, now gets a classified one before provider code runs
on it. A value a driver or provider ignored or refused before is
handled as it was.
Every driver:
- shared/scalarOptions.ts answers 400 for a value that cannot be
converted to text, such as { "toString": null }, in the options a
driver reads as text, a number or a flag. The chat, video, text to
speech, speech to text, voice changer and OCR drivers call it first.
- An unknown provider name that is not text gets the same 400 as any
other unknown name.
Chat requests:
- A falsy `tools` means no tools on every provider.
- A tool call id or a content block type that cannot be converted to
text is a 400.
- A tool result that is an object is sent as its JSON, like the content
of a `tool` message.
- `include` that is not an array is a 400.
- `anthropicBetas` that is not a list of names is dropped.
- Gemini's native route answers 400 when no user or assistant message
is left to send.
- The prompt estimate reads a compaction block whose content is not a
string.
Image, video, speech and OCR requests:
- The image driver checks `input_image_mime_type` with `quality` and
`resolution`.
- The video driver answers 400 for a model that is not a string.
- The voice changer answers 400 for an `output_format` that is not a
string.
- Mistral OCR answers 400 when the SDK refuses the options before
sending them, as Mistral chat does.
Upstream answers to chat:
- A choice without a message is the existing 400 bad_response, which
still falls back.
- A usage count that is not a number is reported as zero in the cost
event, as pricing already skips it.
* Fuzz the AI drivers with seeded requests and upstream answers
Two seeded suites send malformed input through the real drivers and
providers. The vendors are played at the HTTP boundary, so each
provider's request and response code runs.
- ChatCompletionDriver.fuzz.test.ts covers the 17 chat providers that
have a static catalog. Requests with a few values changed must
resolve or reject below 500 without marking a route unhealthy.
Valid requests against wrong statuses, bodies of the wrong shape and
broken event streams must end with an answer or a classified error.
A stream only has to end; the error line it carries is not checked.
- mediaDrivers.fuzz.test.ts covers the image, video, speech and OCR
drivers, called as a user with unlimited metering so a request gets
past file input and the credit hold. Every vendor refuses the
request, and every call must end with a classified error.
shared/fuzzTestUtil.ts holds the seeded random source, the hostile JSON
values, the mutation, and the stand-in for fetch, undici and axios. An
SDK that calls https.request itself fails the suite. PUTER_FUZZ_CASES
raises the case count for a longer run. doc/ai-drivers.md describes the
suites.
* Restore the CODEOWNERS default owner and wildcard patterns
The default owner line read `- @Salazareo`, which only matches a file
named `-`, so files without a specific owner had none. Three patterns
had their `*` escaped, which GitHub rejects as invalid, so their lines
assigned no owner.
---------
Co-authored-by: Daniel Salazar <daniel.salazar@puter.com>
|
||
|
|
3e11e7dc79 |
refactor: keep folder sort and layout in puter.kv, drop /set_sort_by and /set_layout (#4642)
Explorer saved each folder's sort and layout through POST /set_sort_by and
/set_layout, which wrote them onto the folder's fsentries row. stat only
returns `layout`, so a saved sort was never read back.
The GUI now keeps them in the user's key-value store, one key per folder
uid (`folder_view:<uid>` holding `{ sort_by, sort_order, layout }`), via
helpers/folderViewPrefs.js. A change to one preference keeps the others.
A folder with nothing stored falls back to the layout its fsentry still
carries, then to the defaults, so existing layouts carry over.
refresh_item_container reads the folder's view after stat and re-sorts
items that went in under the previous sort; a view for a folder the
window has left is ignored. update_window_path no longer applies sort and
layout itself, since the refresh it starts does.
With no callers left, DesktopController and its two routes are removed.
The fsentries columns and stat's `layout` field stay.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
b2eb8ed895 |
feat(auth): a first-party page served on its own origin signs in with a session of its own (#4635)
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
A deployment can list origins of its own pages in `first_party_session_origins`. When such a page asks the GUI to sign it in, the sign-in hands it a GUI token on a `web` session of its own, parented to the user's sign-in, instead of an app token. The session is minted by POST /auth/first-party-session, which only the GUI's own page script may call, and only as the user's sign-in itself: app tokens, access tokens and a session minted this way are refused. It never gets a session cookie, ends with the sign-in it was handed out under (revoking either takes the tokens minted under the page along), is not counted as a sign-in, and stays up with its sign-in when all other sessions are revoked. The sessions list shows it under its sign-in, titled with the page's host and badged as a site session. |
||
|
|
ac44de819d |
fix(hosting): choose the site and subdomain from Host, not X-Forwarded-Host (#4459)
With trust proxy on, express derives req.hostname and req.subdomains from X-Forwarded-Host, which any client can send, while host validation reads the raw Host. A request could serve one hosted site's files on the main domain, or reach the API on a hosting host. The header is now dropped before routing. Fixes PUT-2272 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4ad53899da |
feat(auth): debug app sessions that act as a user in one app (#4629)
Adds a `debug_app` session kind and AuthService.createDebugAppToken, which mints an app-under-user token on its own session row instead of the user's app session. The row has a hard expiry that activity never slides, its calls record no user activity, it is hidden from the user's session list, and a password reset revokes it. SessionStore.deleteExpiredDebugAppSessions purges expired rows. Migrations add the kind to the sessions constraint on sqlite, mysql and postgres. |
||
|
|
c253b7e05e |
feat(auth): signups record the request's TLS fingerprint when a fronting proxy supplies one (#4622)
`tlsFingerprintHeader` names a request header that a TLS-terminating proxy sets to the client's TLS fingerprint. When set, the value is exposed as `req.tlsFingerprint`, stored on the new `user.signup_tls_fingerprint` column, passed to `puter.signup.validate`, and forwarded to the phone verification provider when it is a JA4. |