{
  "slug": "cookie-commands-become-retryable-queries-7bc8933b7b9a",
  "title": "Cookie commands become retryable queries",
  "tools": [
    "cypress"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-01T00:00:00.000Z",
  "announced_at": "2026-09-01T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When overwriting any cookie read query in Cypress 16, register it with `Cypress.Commands.overwriteQuery()`; chained `.should()` assertions retry cookie reads until they pass or the command timeout expires.",
    "examples": [
      "Cypress.Commands.overwriteQuery('getCookie', function (originalFn, ...args) { return originalFn.apply(this, args) })",
      "cy.getCookie('<name>').should('exist')",
      "cy.getCookies().should('have.length', <count>)"
    ],
    "gotchas": [
      "Version: 16.0.0",
      "name (required): Query name string passed to `overwriteQuery`, such as `getCookie`, `getCookies`, or `getAllCookies`.",
      "callbackFn (required): Overwrite callback; its first argument is the original query function. It must return an inner function; use `function`, not an arrow function, because the query API uses `this` for timeouts.",
      "defaultCommandTimeout: Default timeout in milliseconds for most DOM based commands; cookie query options also default to this timeout.",
      "options.domain: For `cy.getCookies()`, select cookies from the specified domain; defaults to the application hostname.",
      "options.log: Show the cookie query in the Command log; defaults to `true`.",
      "options.timeout: Time in milliseconds to wait for the cookie query; defaults to `defaultCommandTimeout`.",
      "Prerequisite: Use Cypress 16.0.0 or later for these cookie reads to be queries.",
      "Prerequisite: Cookie queries must be chained from `cy`; use chained `.should()` assertions to drive retry behavior. A `.then()` callback itself is not retried.",
      "These commands can no longer be overwritten with `Cypress.Commands.overwrite()`.",
      "The retry behavior is governed by `defaultCommandTimeout`."
    ]
  },
  "why_it_matters": "Update custom overwrites and assertions for Cypress cookie query commands.",
  "before": "Use `Cypress.Commands.overwrite()` to overwrite `cy.getCookie()`, `cy.getCookies()`, or `cy.getAllCookies()`; the commands were not retryable queries.",
  "sources": [
    "https://docs.cypress.io/app/references/changelog#16-0-0",
    "https://docs.cypress.io/api/cypress-api/custom-queries",
    "https://docs.cypress.io/api/commands/getcookie",
    "https://docs.cypress.io/api/commands/getcookies",
    "https://docs.cypress.io/app/references/configuration#Timeouts"
  ],
  "rank": 0.95041,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-6d36062861832e83-10:gate",
    "evidence_hash": "bfb253efa25c476508053eff19d72e8789fa70be04071a80b9a86cf6562828b1"
  },
  "review": {
    "draft_hash": "5364d39a083402156762bd977886d3f87559a41265637cd75df156f219df6d3e",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.70 (>= 0.6 needed)."
  }
}
