Skip to content

v0.68.0

Latest

Choose a tag to compare

@Teloz1870 Teloz1870 released this 27 Nov 22:53

Shops that ship parcels get the first half of a real delivery step: with shippingZones on, checkout charges the
zone's rates and lets the customer choose between them. Semantic product search works again on a shop with a
Gemini key (Google shut down the old default embedding model in January). With Resend configured in production, a
mail Resend refuses is no longer counted as sent, and a refused sign-in or password-reset link is no longer written
to a file on the server. API keys get tighter discount powers. This release
changes the schema: run pnpm db:push
(three columns on ShippingRate, seven on Order), then
pnpm embeddings:backfill once if the shop uses semantic search.

🔒 Security

  • hono and @hono/node-server move to patched lines (seven advisories published 2026-11-12). Both
    arrive only through @modelcontextprotocol/sdk, and the engine never loads them: /api/mcp uses the
    SDK's web-standard transport (server/webStandardStreamableHttp.js), and only the SDK's Node transport,
    which the engine does not import, pulls in @hono/node-server. The overrides in pnpm-workspace.yaml
    raise the hono floor from 4.13.5 to 4.13.16 and add one for @hono/node-server at 2.1.6; the lockfile
    resolves hono 4.13.18 and @hono/node-server 2.1.8, each public for at least three days.

    • hono below 4.13.16: GHSA-4m76-xfj5-7975 (mount() could forward a path past middleware scoped inside
      the mount prefix), GHSA-h7mg-cq63-vhpq (RegExpRouter skipped wildcard middleware for some routes),
      GHSA-46wx-v44x-9hh2 (csrf() did not check text/ping requests), GHSA-4h7h-rv7c-7m2v
      (validator('form') skipped multipart/form-data with extra parameters), all moderate, and
      GHSA-3gg2-335m-rxc6 (the css helper could be made to inject HTML), low.
    • @hono/node-server 2.x below 2.1.6: GHSA-qv5m-9pm6-hqp3 (an ECONNRESET during a WebSocket upgrade
      crashed the process) and GHSA-jpvv-r467-5p4w (a backslash in the path was read as a separator, past a
      reverse proxy's path rules), both moderate.

    pnpm audit --prod goes from nine findings to two; the two left are the build-time glob and minimatch
    advisories under @sentry/nextjs named under Changed. To fix it in your own shop: copy the two selectors
    into your pnpm-workspace.yaml overrides and run pnpm install.

Added

  • Checkout's delivery step: the customer chooses how the order is sent (SHIP0-b, part 2a). When the
    zone for the shop's country has more than one rate that fits the parcel, checkout lists them (name,
    delivery time, price) and the order summary follows the choice; the cart shows "Shipping from X". The
    order records the choice (rate, name, carrier, shipment template) and Shipmondo gets the chosen rate's
    template, else the shop's default. A choice that is no longer an option is refused, never swapped.
    Pickup rates are held back (neither offered nor charged) until the pickup-point picker (part 2b).
    Needs pnpm db:push (seven new columns on Order).
  • A shipping rate now says how the parcel reaches the customer. Each rate in /admin/shipping has a
    delivery type (to the door, or a pickup point), an optional carrier code and an optional shipment
    template id. A pickup rate needs a carrier, because it names whose pickup points to offer. The delivery
    step above reads these fields: checkout offers the delivery rates and records the chosen rate's carrier
    and shipment template; pickup rates are held back until the pickup-point picker (part 2b). Needs
    pnpm db:push
    (three new columns on ShippingRate).
  • Shipmondo: orders can carry a default shipment template (SHIPMONDO_SHIPMENT_TEMPLATE_ID). A first
    run against Shipmondo's sandbox showed that a sales order without a shipment template cannot be booked
    in one click or by an automation: Shipmondo answers "Shipment template is not set up". With the id set,
    every sales order is created with that template; /admin/shipmondo lists the account's templates with
    their ids and says when the chosen one does not exist. Unset, nothing changes.
  • Shipmondo: sending by hand (SHIPMONDO_SEND_MODE="manual"). A shop that sends some orders
    another way (a supplier ships them, the customer collects them) can keep every order out of
    Shipmondo until someone sends it from /admin/shipmondo: then neither payment nor the sweep
    sends anything, while tracking for the orders that were sent still comes back. Unset, the
    plugin sends at payment as before. /admin/shipmondo says which mode the shop is in.
  • Bounded API-key discounts (apiDiscountBounds, runtime flag, default off). With it on, a
    discount code an API key creates (discounts.create, marketing.create_campaign, over REST or
    MCP) must set usageLimit and validUntil, or nothing is created. A code above
    policies.apiDiscountCaps (default 50 % and 50000 øre = 500 kr) is created switched off, and the
    response says so; a campaign with such a code leaves the banner and preview mail alone, and the
    key cannot switch the code on with discounts.toggle. The admin chat and /admin are unchanged.
    marketing.create_campaign also takes an optional usageLimit, stored when given. Off, nothing
    changes.

Changed

  • The API-key discount bounds refuse with a 4xx and a code, not a 500 (TOOL-REFUSAL-4XX-b). With
    apiDiscountBounds on, an API key's discounts.create or marketing.create_campaign without usageLimit
    or validUntil now answers 409 discount_limit_and_expiry_required, and a key that tries to switch on
    (discounts.toggle) or re-price (a campaign on a live code) a code above the caps answers 409
    discount_above_cap, each with its message in detail; they used to be a 500 "internal service error".
    409, not 422: the body is valid against the published schema, and 422 stays validation_failed. The
    toggle's message now names the cap instead of the code's stored value. A campaign's draft code that
    collides with one created a moment earlier is 409 discount_code_exists, as in discounts.create. Both
    tools now cap the code at 64 characters (after the trim), so a refusal cannot echo an arbitrarily long
    string; a longer code is a 422. discounts.toggle keeps no cap, so a longer existing code stays reachable.
  • A tool's business refusal is a 4xx, not a 500 (TOOL-REFUSAL-4XX). Over REST (POST /api/v1/tools/<name>)
    and MCP, discounts.create on a code that already exists now answers 409 with code: "discount_code_exists",
    marketing.create_campaign on a switched-off code 409 with code: "discount_code_switched_off", and
    discounts.toggle on an unknown code 404 with code: "discount_not_found". Each keeps its own message in
    detail (MCP: the isError text and structuredContent.error), where it used to be a 500
    tool_execution_failed with the generic "internal service error" text and "Retry later". A caller that
    matched on 500 for these refusals must match the new status or code; retrying them unchanged is refused
    again. Every other handler failure is still a 500 with the generic text, so no handler, database or provider
    detail crosses the boundary. The OpenAPI document now lists 404 and 409 for every tool. Tools raise it with
    ToolRefusal (lib/tools/refusal.ts); other tools' refusals still answer 500 until they are converted.
  • Node 22.12 is the floor (engines.node is now >=22.12 <27). Tailwind 4.3.4 and later require()
    an ES-only package as it loads, which Node 22.11 and earlier cannot do: there Tailwind's PostCSS plugin fails
    to load with ERR_REQUIRE_ESM, so the CSS cannot build, while engines still allowed those versions. Only a shop building on Node 22.0–22.11 is affected;
    it needs a later 22, or 24 or 26. Vercel and the container image already ran a newer Node.
  • Checkout charges the shop's shipping rates (SHIP0-b, part 1). With shippingZones on in Features and a
    zone for the shop's country (policies.country), an order pays that zone's cheapest rate for the parcel's
    weight, and the cart, checkout, agent quotes and ACP sessions show the same price (checkout names the rate); once a
    customer picks another rate in checkout's delivery step (under Added), the order pays that one.
    With zones off, or no zone for the country, nothing changes: the flat rate, byte for byte. Zones that cannot
    be read now refuse the order instead of silently charging the flat rate (PAY1). The flag reads its runtime
    value, not the build-time one. Choosing between rates is the delivery step under Added.
  • Dependencies moved to their newest releases inside the current majors, each public for at least
    three days.
    ai 7.0.164 with @ai-sdk/anthropic 4.0.98, @ai-sdk/google 4.0.113,
    @ai-sdk/openai-compatible 3.0.86 and @ai-sdk/react 4.0.168, @modelcontextprotocol/sdk 1.32.2,
    @sentry/nextjs 10.78.0, @upstash/redis 1.41.0, botid 1.5.12, lucide-react 1.70.0, resend
    6.37.0, tailwindcss and @tailwindcss/postcss 4.3.5, postcss 8.5.32, vite 8.3.6,
    @playwright/test 1.65.0 and @typescript-eslint/parser 8.72.1. No schema change and no code
    change: a shop picks them up with pnpm install after pulling. next 16.4.5 is now older than
    the three-day cutoff, so its exception in pnpm-workspace.yaml is gone.
    Two moderate advisories stay open, both in build-time code: glob 13 (GHSA-3g3m-2fjr-6pw4) and
    minimatch 10 (GHSA-g3hv-75wg-m249) come in through @sentry/nextjs's source-map upload plugin,
    and the fixes exist only in the next majors (glob 14, minimatch 11), which no @sentry/nextjs 10
    release accepts yet. minimatch 10 is also in the development-only ESLint toolchain
    (@typescript-eslint/typescript-estree), so it leaves the lockfile only when both move.
  • The media library records the Gemini model that actually wrote an image's alt text. With
    altTextAi on, MediaAsset.aiModel (shown as "AI-model" in /admin/media/<id>) now stores the
    modelVersion Gemini reports in its answer instead of the model name the engine asked for, which
    Google can serve with a different model (it re-points gemini-2.5-flash on 2026-12-01). When the
    answer has no modelVersion, the requested name is stored as before. No schema change; rows
    written earlier keep their value.
  • marketing.create_campaign now also requires discounts:write. The campaign issues (or updates) a
    discount code, which discounts.create guards with discounts:write, so a key holding marketing:write
    alone was a way round that scope. A tool can now name further scopes beside its own (extraScopes), and
    every surface enforces them as it does the first: POST /api/v1/tools/<name> answers 403 naming the
    missing scope, MCP tools/list no longer lists the tool to such a key, and the admin chat (which holds
    both) is unaffected. The catalogue (/api/v1/tools, ?schema=true, /api/v1/tools/<name>) shows the
    extra scopes as extraScopes, and /openapi.json as x-cartwright-extra-scopes on the operation; tools
    without any keep exactly the fields they had.

Fixed

  • The magic-link form says why no link came. It looked for "rate" in the error Auth.js
    returned, but Auth.js only ever returns Configuration there, so a customer who asked too often
    and one whose link the mail provider refused both saw "Something went wrong". The provider now
    tells the form which it was (lib/auth/magic-link-errors.ts): "Too many requests. Wait a
    moment." for the per-address limit, and the new "We could not send the link. Try again later."
    (Login.magicSendFailed, English and Danish) for a refused send. Anything else keeps the generic
    message. Neither answer depends on whether the address has an account.
  • GET /api/v1/tools?scope= also lists the tools that need the scope on top of their own. The
    filter matched only a tool's primary scope, so ?scope=discounts:write left out
    marketing.create_campaign although a key now needs that scope to call it. A tool is listed when
    the scope is its primary scope or one of its extraScopes, in both the compact catalogue and
    ?schema=true; without ?scope= the catalogue is unchanged.
  • marketing.create_campaign no longer revives an expired discount code or makes a dated one endless
    (CAMPAIGN-EXPIRED-REVIVE).
    A campaign without validUntil on an existing, active code wrote
    validUntil: null, so an expired code became redeemable again and a dated one never expired. An omitted
    validUntil now leaves the stored date alone, and a campaign on a code whose validUntil has passed is
    refused before it writes anything (409 discount_code_expired; no discount, banner or preview).
  • marketing.create_campaign no longer switches a discount code back on that the owner switched
    off.
    An API key with only marketing:write could revive any disabled code by naming it in a
    campaign. The tool now refuses such a code before it writes anything (no discount, banner or
    preview), so it must be turned on in /admin/rabatkoder or with discounts.toggle; an active
    code is updated as before. A percent campaign above 100 is refused, as discounts.create already
    did. The tool's description and the MCP instructions no longer promise that audit.revert can
    undo a campaign's steps, which it never could.
  • Semantic product search works again on a shop with a Gemini key. The engine's default embedding
    model was text-embedding-004, which Google shut down on 2026-01-14: every embedding call failed,
    and product search (the storefront search and the products.search tool) ran on word matching
    alone, with nothing in the admin saying so. The default is now gemini-embedding-2,
    asked for 768 dimensions (the size the pgvector column and the Ollama default already use).
    After pulling, run pnpm embeddings:backfill once: vectors are stored per model, so the
    catalogue is re-embedded with the new one (a product is also re-embedded whenever it is saved), and
    search stays on word matching until then. A shop that set GEMINI_EMBED_MODEL keeps its model and
    that model's own dimensions; if the override names a model Google has shut down, the server log now
    says which day it closed and to unset the override. The override is now trimmed, and a blank one
    counts as unset. No schema change.
  • The v0.67.0 notes said /admin/shipmondo lists 30 days of paid orders; it lists 14, the same
    window the sweep sends from. Corrected in place.
  • A receipt or order mail that Resend refuses is no longer counted as sent. With Resend
    configured, a failed send was written to .mail-previews/ on the server instead, so the order
    was stamped as having its receipt, "Resend receipt" in admin said it went out, and a shipping
    notification got a "sent" note, though the customer received nothing. The order receipt and the
    shipping, refund, return and owner-order mails now pass Resend's error to their caller and log
    it on the server: the receipt stamp (confirmationEmailSentAt) stays empty, "Resend receipt"
    and "Send shipping notification" answer with an error, a Shipmondo shipment notes that its
    shipping email could not be sent, and the order still becomes paid. Receiving or refunding a
    return still succeeds when its mail fails; the log line is the trace. Outside production, or in
    production without a Resend key, mails are written to .mail-previews/ as before.
  • A sign-in link or password-reset link that Resend refuses is no longer written to disk. With
    Resend configured, a failed magic-link or password-reset mail was written to .mail-previews/ on
    the production server, link and raw token included, and the customer was told to check an inbox
    nothing reached. Both mails now pass Resend's error to their caller, log it without the link, and
    write no file. The magic-link form answers with its error message instead of "check your inbox"
    (Auth.js turns a thrown send into an error answer). The forgot-password answer is unchanged and
    the same whether the account exists or the send failed; the failure is logged on the server.
    Outside production, or without a Resend key, both mails are written to .mail-previews/ as before.

Upgrading

  • Run pnpm db:push after pulling: ShippingRate gains three columns and Order seven, each nullable or
    with a default, so existing orders read as "no delivery choice recorded" and existing rates as door delivery
    with no carrier or shipment template. The Prisma client names every column, so the new code fails on order
    and shipping queries against a database that has not been pushed.
    On Turso, which prisma db push cannot reach (P1013), run these statements through turso db shell
    (ShippingRate first, then Order):

    ALTER TABLE "ShippingRate" ADD COLUMN "kind" TEXT NOT NULL DEFAULT 'delivery';
    ALTER TABLE "ShippingRate" ADD COLUMN "carrierCode" TEXT;
    ALTER TABLE "ShippingRate" ADD COLUMN "shipmentTemplateId" INTEGER;
    ALTER TABLE "Order" ADD COLUMN "shippingRateId" TEXT;
    ALTER TABLE "Order" ADD COLUMN "shippingMethod" TEXT;
    ALTER TABLE "Order" ADD COLUMN "shippingCarrier" TEXT;
    ALTER TABLE "Order" ADD COLUMN "shipmentTemplateId" INTEGER;
    ALTER TABLE "Order" ADD COLUMN "pickupPointId" TEXT;
    ALTER TABLE "Order" ADD COLUMN "pickupPointName" TEXT;
    ALTER TABLE "Order" ADD COLUMN "pickupPointAddress" TEXT;
  • Run pnpm embeddings:backfill once if the shop uses semantic search with a Gemini key (see Fixed);
    search runs on word matching until it has.

  • Node 22.12 or later is required (see Changed).

  • An API key that runs marketing.create_campaign needs discounts:write as well as marketing:write.
    A key's scopes cannot be edited, so mint a new key with both in /admin/api-keys (and revoke the old
    one) before deploying, or the campaign call gets 403.