Repository navigation
Release v0.16.5
Added
- The website measures traffic with cookieless PostHog through
e.codeswhat.com: pageviews, pageleaves, Core Web Vitals and a short fixed list of link and copy-button clicks. It sets no cookies, builds no person profiles, collects no campaign parameters, and keeps only the referring hostname, never the full referrer or any query string. It only runs onportkey.codeswhat.com, and the site's CSP allows that one origin for scripts and connections. create_mcp_serveracceptsworkspace_id(required with an organisation admin key) andcreate_mcp_integrationacceptsorganisation_id, matching the Portkey API.update_mcp_server_user_accessacceptsdefault_user_access(allowordeny);usersis now optional as long as one of the two is given.update_mcp_integration_workspacesaccepts an emptyworkspaceslist plusglobal_workspace_accessandoverride_existing_workspace_access.list_mcp_serversacceptsidandsearch, the two capability list tools accept atypefilter, andlist_mcp_server_user_accessacceptssearch.
Changed
- Responses from Portkey are read with a size cap, and tool results have one too. A Portkey response body over 8 MiB fails the call with an explicit error instead of being buffered whole, and a tool result over 4 MiB (text block and
structuredContentcounted separately, after JSON escaping) is replaced by a short error that says how to narrow the request. Nothing is ever truncated. Both limits are configurable withPORTKEY_MAX_UPSTREAM_BODY_BYTESandPORTKEY_MAX_TOOL_RESULT_BYTES, and a malformed value stops the server at startup. Because both copies count, the default result cap in practice allows about 2 MiB of JSON payload; raisePORTKEY_MAX_TOOL_RESULT_BYTESif a large list call that worked before now errors. update_*andarchive_*tools now reportdestructiveHint: trueunless a tool sets its own, since they overwrite or retire existing state and MCP treatsfalseas additive-only. This includesupdate_config,update_organisation_defaultsand the MCP integration capability and workspace updates, which had overridden it tofalse.- The Docker image builds on Node 26.13 (26.13.1), pinned to the current multi-arch digest.
tools/listis cheaper. The server converts each tool's input and output schema to JSON Schema once per process instead of on every request, which cuts the CPU for a full catalog listing by roughly two thirds.- The generic output schema descriptions that every tool repeats in
tools/listare shorter, which trims the catalog by about 25 KB (518,112 to 493,280 bytes). Validation is unchanged. - The README no longer says
tools/listis paginated. The server returns all 194 tools in one response (about 500 KB of JSON). The VS Code section notes the 128-tool cap per chat request and points toPORTKEY_TOOL_DOMAINS. ENDPOINTS.md says the deployment ping route isn't exposed instead of calling it deprecated, since the spec doesn't deprecate it. The distribution notes say Smithery shut down its API, CLI, SDKs and accounts on 2026-10-31 and is directory-only now.
Fixed
- Updating a key's or provider's alert threshold or credit limit no longer drops a custom reset cadence.
periodic_reset_daysis now carried over and sent withoutperiodic_reset, and an explicitperiodic_resetreplaces inherited days.get_secret_referenceno longer fails on a status other thanACTIVE. - An empty
PORTKEY_BASE_URLno longer slips through once a default client has been created. The shared client cache treated an empty value as unset and returned the cached default client. It now fails with an invalid base URL error, like a fresh client does. - The HTTP server now validates
PORTKEY_TOOL_DOMAINSat startup and exits on an unknown domain. It used to start, report/readyhealthy and then answer every/mcprequest with a 500. rotate_api_keyreturned an output-validation error after the rotation had already run upstream, which dropped the one-time new key. This happened when Portkey sentkey_transition_expires_atwith an offset such as+00:00, or left it out. The schema now accepts both.list_secret_referencesandget_secret_referenceaccept offset timestamps too, and the list no longer fails on a status other thanACTIVE.- Virtual key, API key and provider results include
usage_limits.type, so a tokens budget no longer looks like a cost one. run_prompt_completionreturns the model'stool_callsand legacyfunction_callinstead ofresponse: nullafter a billable call that ended in a tool request. They come back as data and the server never runs them.get_workspaceandlist_workspacesnow returnis_default,usage_limitsandrate_limits. Portkey sends the default flag at the top level withdefaultsset to null, so the flag was always missing, and the limits accepted on create and update were never shown back.get_token_analytics,get_users_analyticsandget_cache_hit_rateread fields that Portkey's spec doesn't return and dropped the ones it does. Token results now carrytotalandavg(the graph has no prompt/completion split), user results carry the unique-usertotal, and cache hit-rate results carrysimple_hits,semantic_hits,rateand both cumulative savings fields per bucket, withsummary.total_hitsandsummary.hit_rate.update_virtual_key,update_api_keyandupdate_providerno longer overwrite an existing budget. Changing only the alert threshold used to sendtype: costand a monthly reset, which turned a weekly token budget into a monthly cost one. These updates now read the current limits first and change only the fields you pass, and an update that touches no limit field sends nousage_limitsand does no extra read. The read-modify-write isn't atomic and Portkey has no conditional writes, so concurrent limit updates to the same resource can overwrite each other. Serialize them.create_providerandupdate_providerno longer drop limit inputs.usage_limit_typeandperiodic_reseton their own used to be discarded while the call reported success, and a lonerate_limit_valueorrate_limit_unitwas silently ignored. Updates now forward only the usage fields you pass, and a half rate-limit pair is rejected.promote_promptinto an existing target now replaces the target's version with the source version. It used to patch, so a source with no tools left the target's oldtoolsandtool_choicein place. It also fails before writing when the source version has no model (model,ai_model_idorfinetune_id), string or virtual key, and carries whichever model field the source has into the replacement.- Clerk v2 session tokens now decode correctly. The role comes from
o.rolwithout itsorg:prefix, soCLERK_ALLOWED_ROLES=org:adminnever matched, and permissions packed intofea,o.perando.fpmwere dropped, soCLERK_REQUIRED_PERMISSIONScould never be met. Both are rebuilt the way Clerk's own parser does it. v1 tokens with flatorg_*claims keep working. On v2 tokens, top-levelpermissionsandrolesarrays (custom session-template claims) still count towardCLERK_REQUIRED_PERMISSIONSandCLERK_ALLOWED_ROLES, next to the decodedoclaims. - The tool result size cap now covers error results too. A very large upstream error message used to skip it and come back at full size.
update_api_keysentreset_usageas a number, but the Portkey API takes a boolean. It now acceptstrue/false, asupdate_providerdoes.
Security
/readyno longer returns the upstream Portkey error text whenMCP_READY_CHECK_MODE=portkey. The route is unauthenticated, so the message could expose admin-key state. It returns a fixedUpstream readiness check failedand logs the details server-side.- Clerk auth mode rejects pending sessions (
sts: "pending"). Those sessions still have unfinished tasks such as MFA setup or a password reset, and the token was accepted anyway. Tokens with nostsclaim still pass. - Clerk auth mode now requires
CLERK_ALLOWED_SUBJECTSorCLERK_ALLOWED_ORGANIZATION_IDS. A roles-only or permissions-only policy was accepted at startup, so an admin of any organization in the same Clerk instance could pass it. Roles and permissions still narrow the policy, but can't satisfy startup validation alone. - Refreshed the root lockfile to Hono 4.13.19. Removed the osv-scanner ignores for GHSA-fc5q-39xc-vjpf and CVE-2026-112366, since the advisory was withdrawn on 2026-11-18.
What's Changed
- docs(release): record 0.16.4 publication and refresh site manual by @scttbnsn in #205
- docs(release): promote 0.16.4 publication records and site manual by @scttbnsn in #206
- fix(deps): update dependency next to v16.4.5 [security] by @renovate[bot] in #208
- chore(git): reconcile promotion ancestry and ignore unpatched picomatch advisory by @scttbnsn in #210
- fix(website): promote the Next.js security patch by @scttbnsn in #209
- feat(website): measure the site with cookieless PostHog by @scttbnsn in #211
- test(website): assert the exact script-src list by @scttbnsn in #213
- feat(website): promote cookieless PostHog analytics by @scttbnsn in #212
- fix(website): fit-for-sale accessibility and preload cleanup by @scttbnsn in #214
- fix: 0.16.5 maintenance batch (Node security pin, MCP contract fields, annotations, docs) by @scttbnsn in #215
- fix: deep-review findings (rotate_api_key key loss, Clerk auth, limits, analytics, prompts) by @scttbnsn in #216
- perf: schema caching, response size limits, test gaps (deep review batch 3) by @scttbnsn in #217
- chore(release): 0.16.5 by @scttbnsn in #218
- chore(git): reconcile main into dev/0.16 before the 0.16.5 promotion by @scttbnsn in #219
- fix: CodeRabbit pass 1 on the 0.16.5 promotion by @scttbnsn in #221
- release: 0.16.5 by @scttbnsn in #220
Full Changelog: v0.16.4...v0.16.5