Skip to content

Release v0.16.5

Choose a tag to compare

@github-actions github-actions released this 18 Nov 22:52
· 35 commits to main since this release
09f9d05

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 on portkey.codeswhat.com, and the site's CSP allows that one origin for scripts and connections.
  • create_mcp_server accepts workspace_id (required with an organisation admin key) and create_mcp_integration accepts organisation_id, matching the Portkey API.
  • update_mcp_server_user_access accepts default_user_access (allow or deny); users is now optional as long as one of the two is given. update_mcp_integration_workspaces accepts an empty workspaces list plus global_workspace_access and override_existing_workspace_access.
  • list_mcp_servers accepts id and search, the two capability list tools accept a type filter, and list_mcp_server_user_access accepts search.

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 structuredContent counted 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 with PORTKEY_MAX_UPSTREAM_BODY_BYTES and PORTKEY_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; raise PORTKEY_MAX_TOOL_RESULT_BYTES if a large list call that worked before now errors.
  • update_* and archive_* tools now report destructiveHint: true unless a tool sets its own, since they overwrite or retire existing state and MCP treats false as additive-only. This includes update_config, update_organisation_defaults and the MCP integration capability and workspace updates, which had overridden it to false.
  • The Docker image builds on Node 26.13 (26.13.1), pinned to the current multi-arch digest.
  • tools/list is 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/list are shorter, which trims the catalog by about 25 KB (518,112 to 493,280 bytes). Validation is unchanged.
  • The README no longer says tools/list is 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 to PORTKEY_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_days is now carried over and sent without periodic_reset, and an explicit periodic_reset replaces inherited days. get_secret_reference no longer fails on a status other than ACTIVE.
  • An empty PORTKEY_BASE_URL no 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_DOMAINS at startup and exits on an unknown domain. It used to start, report /ready healthy and then answer every /mcp request with a 500.
  • rotate_api_key returned an output-validation error after the rotation had already run upstream, which dropped the one-time new key. This happened when Portkey sent key_transition_expires_at with an offset such as +00:00, or left it out. The schema now accepts both. list_secret_references and get_secret_reference accept offset timestamps too, and the list no longer fails on a status other than ACTIVE.
  • Virtual key, API key and provider results include usage_limits.type, so a tokens budget no longer looks like a cost one.
  • run_prompt_completion returns the model's tool_calls and legacy function_call instead of response: null after a billable call that ended in a tool request. They come back as data and the server never runs them.
  • get_workspace and list_workspaces now return is_default, usage_limits and rate_limits. Portkey sends the default flag at the top level with defaults set 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_analytics and get_cache_hit_rate read fields that Portkey's spec doesn't return and dropped the ones it does. Token results now carry total and avg (the graph has no prompt/completion split), user results carry the unique-user total, and cache hit-rate results carry simple_hits, semantic_hits, rate and both cumulative savings fields per bucket, with summary.total_hits and summary.hit_rate.
  • update_virtual_key, update_api_key and update_provider no longer overwrite an existing budget. Changing only the alert threshold used to send type: cost and 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 no usage_limits and 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_provider and update_provider no longer drop limit inputs. usage_limit_type and periodic_reset on their own used to be discarded while the call reported success, and a lone rate_limit_value or rate_limit_unit was silently ignored. Updates now forward only the usage fields you pass, and a half rate-limit pair is rejected.
  • promote_prompt into 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 old tools and tool_choice in place. It also fails before writing when the source version has no model (model, ai_model_id or finetune_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.rol without its org: prefix, so CLERK_ALLOWED_ROLES=org:admin never matched, and permissions packed into fea, o.per and o.fpm were dropped, so CLERK_REQUIRED_PERMISSIONS could never be met. Both are rebuilt the way Clerk's own parser does it. v1 tokens with flat org_* claims keep working. On v2 tokens, top-level permissions and roles arrays (custom session-template claims) still count toward CLERK_REQUIRED_PERMISSIONS and CLERK_ALLOWED_ROLES, next to the decoded o claims.
  • 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_key sent reset_usage as a number, but the Portkey API takes a boolean. It now accepts true/false, as update_provider does.

Security

  • /ready no longer returns the upstream Portkey error text when MCP_READY_CHECK_MODE=portkey. The route is unauthenticated, so the message could expose admin-key state. It returns a fixed Upstream readiness check failed and 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 no sts claim still pass.
  • Clerk auth mode now requires CLERK_ALLOWED_SUBJECTS or CLERK_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