{
  "model": "gemini-3.8-flash",
  "question": "How do I undo the last production deploy?",
  "server": "adk api_server --port 8765 --session_service_uri sqlite:///sessions.db --allow_origins http://localhost:3000 .",
  "apps": [
    "docs_assistant"
  ],
  "created": {
    "id": "s-run",
    "appName": "docs_assistant",
    "userId": "dev-1",
    "state": {
      "team": "payments"
    },
    "events": []
  },
  "run": {
    "lines": [
      "docs_assistant  final    call read_page({\"page\": \"rollback\"})",
      "docs_assistant  final    result read_page",
      "docs_assistant  final    'To undo the last production deploy, run:'"
    ],
    "answer": "To undo the last production deploy, run:\n\n`shipctl rollback --env production`\n\nWithout `--to`, `shipctl rollback` moves the environment back to the previous release. Note that database migrations are not rolled back automatically; if the release ran a migration, you must write a new migration to reverse it.",
    "events": [
      {
        "author": "docs_assistant",
        "invocationId": "e-b8b7dfcf-4870-4233-b345-a569917588a9",
        "content": {
          "parts": [
            {
              "functionCall": {
                "id": "call_638753",
                "args": {
                  "page": "rollback"
                },
                "name": "read_page"
              },
              "thoughtSignature": "<signature>"
            }
          ],
          "role": "model"
        },
        "finishReason": "STOP",
        "usageMetadata": {
          "candidatesTokenCount": 16,
          "promptTokenCount": 176,
          "promptTokensDetails": [
            {
              "modality": "TEXT",
              "tokenCount": 176
            }
          ],
          "thoughtsTokenCount": 54,
          "totalTokenCount": 246
        }
      },
      {
        "author": "docs_assistant",
        "invocationId": "e-b8b7dfcf-4870-4233-b345-a569917588a9",
        "content": {
          "parts": [
            {
              "functionResponse": {
                "id": "call_638753",
                "name": "read_page",
                "response": {
                  "page": "rollback",
                  "text": "# Roll back a release\n\n`shipctl rollback` moves an environment back to an earlier release. It does not rebuild anything; it points traffic at the release you name.\n\n    shipctl rollback --env production --to r41\n\nWithout `--to`, shipctl rolls back to the previous release. A rollback is itself recorded as a new release, so `shipctl releases` shows it.\n\nDatabase migrations are not rolled back. If the release you leave ran a migration, write a new migration that reverses it.\n\nshipctl 1.x used `shipctl release revert <release>`. That command was removed in shipctl 2.0.\n"
                }
              }
            }
          ],
          "role": "user"
        }
      },
      {
        "author": "docs_assistant",
        "invocationId": "e-b8b7dfcf-4870-4233-b345-a569917588a9",
        "content": {
          "parts": [
            {
              "text": "To undo the last production deploy, run:\n\n`shipctl rollback --env production`\n\nWithout `--to`, `shipctl rollback` moves the environment back to the previous release. Note that database migrations are not rolled back automatically; if the release ran a migration, you must write a new migration to reverse it.",
              "thoughtSignature": "<signature>"
            }
          ],
          "role": "model"
        },
        "finishReason": "STOP",
        "usageMetadata": {
          "candidatesTokenCount": 64,
          "promptTokenCount": 401,
          "promptTokensDetails": [
            {
              "modality": "TEXT",
              "tokenCount": 401
            }
          ],
          "thoughtsTokenCount": 76,
          "totalTokenCount": 541
        }
      }
    ],
    "model_turns": [
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "functionCall": {
                "id": "call_638753",
                "args": {
                  "page": "rollback"
                },
                "name": "read_page"
              }
            }
          ]
        },
        "partial": false
      },
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "text": "To undo the last production deploy, run:\n\n`shipctl rollback --env production`\n\nWithout `--to`, `shipctl rollback` moves the environment back to the previous release. Note that database migrations are not rolled back automatically; if the release ran a migration, you must write a new migration to reverse it."
            }
          ]
        },
        "partial": false
      }
    ]
  },
  "sse": {
    "lines": [
      "docs_assistant  partial  call read_page({\"page\": \"rollback\"})",
      "docs_assistant  partial  (no text)",
      "docs_assistant  final    call read_page({\"page\": \"rollback\"})",
      "docs_assistant  final    result read_page",
      "docs_assistant  partial  'To undo the last production deploy and r'",
      "docs_assistant  partial  '`\\n\\nWithout the `--to` flag, `shipctl rol'",
      "docs_assistant  partial  ' migrations are not rolled back automati'",
      "docs_assistant  partial  (no text)",
      "docs_assistant  final    'To undo the last production deploy and r'"
    ],
    "seconds": [
      1.98,
      1.99,
      2.0,
      2.0,
      3.75,
      3.98,
      4.22,
      4.23,
      4.23
    ],
    "answer": "To undo the last production deploy and roll back to the previous release, run:\n\n`shipctl rollback --env production`\n\nWithout the `--to` flag, `shipctl rollback` moves traffic back to the previous release. Note that database migrations are not rolled back automatically; if the release ran a migration, you must write a new migration that reverses it.",
    "stored": 4,
    "model_turns": [
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "functionCall": {
                "id": "call_616000",
                "args": {
                  "page": "rollback"
                },
                "name": "read_page"
              }
            }
          ]
        },
        "partial": true
      },
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "text": ""
            }
          ]
        },
        "partial": true
      },
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "functionCall": {
                "id": "call_616000",
                "args": {
                  "page": "rollback"
                },
                "name": "read_page"
              }
            },
            {
              "text": ""
            }
          ]
        },
        "partial": false
      },
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "text": "To undo the last production deploy and roll back to the previous release, run:\n\n`shipctl rollback --env production"
            }
          ]
        },
        "partial": true
      },
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "text": "`\n\nWithout the `--to` flag, `shipctl rollback` moves traffic back to the previous release. Note that database"
            }
          ]
        },
        "partial": true
      },
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "text": " migrations are not rolled back automatically; if the release ran a migration, you must write a new migration that reverses it."
            }
          ]
        },
        "partial": true
      },
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "text": ""
            }
          ]
        },
        "partial": true
      },
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "text": "To undo the last production deploy and roll back to the previous release, run:\n\n`shipctl rollback --env production`\n\nWithout the `--to` flag, `shipctl rollback` moves traffic back to the previous release. Note that database migrations are not rolled back automatically; if the release ran a migration, you must write a new migration that reverses it."
            },
            {
              "text": ""
            }
          ]
        },
        "partial": false
      }
    ]
  },
  "failures": {
    "unknown_session": {
      "status": 404,
      "body": {
        "detail": "Session not found: no-such-session"
      }
    },
    "origin": {
      "status": 403,
      "body": "Forbidden: origin not allowed"
    },
    "allowed_origin": {
      "status": 200,
      "allow_origin": "http://localhost:3000"
    },
    "deprecated_path": {
      "status": 200,
      "state": {
        "state": {
          "team": "payments"
        }
      }
    }
  },
  "cli_replay": {
    "command": "adk run --in_memory --replay replay.json docs_assistant",
    "stdout": [
      "[user]: How do I roll back production to release r41?",
      "[docs_assistant]: To roll back production to release r41, run:",
      "`shipctl rollback --env production --to r41`",
      "This points traffic to the specified release without rebuilding. Note that database migrations are not rolled back automatically.",
      "[user]: Does that also undo the database migration?",
      "[docs_assistant]: No, database migrations are not rolled back. If the release you are leaving ran a migration, you must write a new migration that reverses it."
    ],
    "exit": 0
  },
  "cli_jsonl": {
    "command": "adk run --in_memory --jsonl docs_assistant 'Which page explains tokens?'",
    "records": [
      {
        "author": "docs_assistant",
        "session_id": "6a0dc749-f1c8-41ea-b470-4e353ed8e778",
        "node_path": "docs_assistant@1",
        "id": "037796ae-5804-40e6-831a-66dfcf060a65",
        "modelVersion": "gemini-3.8-flash",
        "content": {
          "parts": [
            {
              "functionCall": {
                "id": "call_454943",
                "args": {
                  "page": "tokens"
                },
                "name": "read_page"
              },
              "thoughtSignature": "EpMDCpADAWkUfRN4W2qbiZnS73KWuAbRkimSEcVJKojv1qx9zRLftyu0efFKnDEnNTyuK_SIbCJZartHLbdn7CcB1CtbXdRq2nd6lb58o4kHAI9PYWBrVq1rlpb1cNxEZQfoJCgfFuAkIOONyG98GtIpUcDXy4BrQ2fZ4Zlo7vCMH9dktKCbLLEc3d2b1tJvLnvVxIKuAZNaD4sUIrVbtcj7xXjywk5NUe9oBxTPVShclLynSguAsFnCVUjHzCFu-vuEqnidVe3NIvQVKp3D3jOdoqPuQTQZf52qg53GRIKPHoC_7bBKYqYiBibzyPJLfpyYa0OwIBeLAcW1qwzxHP3oPoKY-ObNBlGiKJbF3HJesL6cVuYxsQ1LCB74czbgYvyaH6kEYQpGZXmgHjjg7ASvKjcypiWVPFSol3bmlVtqGmjzHIo1_Oy3M0VPWkV8JFv5IO20QSl-uIOkfUTjm6XY7WK4hq6vOQqJCRYZFQ4Csg_q2FcNzCzlaCgh7cHsYg4Dv2XYeuWACYxnMWi43kgNJ98Ndw=="
            }
          ],
          "role": "model"
        },
        "finishReason": "STOP",
        "usageMetadata": {
          "candidatesTokenCount": 16,
          "promptTokenCount": 172,
          "promptTokensDetails": [
            {
              "modality": "TEXT",
              "tokenCount": 172
            }
          ],
          "thoughtsTokenCount": 78,
          "totalTokenCount": 266
        },
        "invocationId": "e-c35d73cf-ce8a-4df7-95dc-9e783b8a6d14",
        "nodeInfo": {
          "path": "docs_assistant@1"
        },
        "longRunningToolIds": [],
        "timestamp": 1792628369.447583
      },
      {
        "author": "docs_assistant",
        "session_id": "6a0dc749-f1c8-41ea-b470-4e353ed8e778",
        "node_path": "docs_assistant@1",
        "id": "1f724bc1-7801-4c5e-bcb2-244c3f3806ec",
        "content": {
          "parts": [
            {
              "functionResponse": {
                "id": "call_454943",
                "name": "read_page",
                "response": {
                  "page": "tokens",
                  "text": "# Authenticate shipctl in CI\n\nCI jobs authenticate with a deploy token, not a personal login. Create one with:\n\n    shipctl tokens create --name ci-docs-api --scope deploy:staging\n\nThe token is shown once. Store it in your CI secret store as `SHIPCTL_TOKEN`. Tokens expire after 90 days; `shipctl tokens list` shows each token's expiry.\n"
                }
              }
            }
          ],
          "role": "user"
        },
        "invocationId": "e-c35d73cf-ce8a-4df7-95dc-9e783b8a6d14",
        "nodeInfo": {
          "path": "docs_assistant@1"
        },
        "timestamp": 1792628371.230488
      },
      {
        "author": "docs_assistant",
        "session_id": "6a0dc749-f1c8-41ea-b470-4e353ed8e778",
        "node_path": "docs_assistant@1",
        "id": "5e7df9fd-da33-4164-9385-013d8c8fb650",
        "modelVersion": "gemini-3.8-flash",
        "content": {
          "parts": [
            {
              "text": "The `tokens` page explains tokens.",
              "thoughtSignature": "EmkKZwFpFH0TXxHvDeD3c3pHcdVHn-u6AU2SYIPGg2lMBm74DDq3LyuhgvNrhzLlYT5Ojp_bnuRnsVTS04qKzikjvrdH2QD1QynHcD0WKPJd5e1E3qgxIEnqbx1FRwdZyFuf4EaKTNA6T2k="
            }
          ],
          "role": "model"
        },
        "finishReason": "STOP",
        "usageMetadata": {
          "candidatesTokenCount": 8,
          "promptTokenCount": 371,
          "promptTokensDetails": [
            {
              "modality": "TEXT",
              "tokenCount": 371
            }
          ],
          "totalTokenCount": 379
        },
        "invocationId": "e-c35d73cf-ce8a-4df7-95dc-9e783b8a6d14",
        "nodeInfo": {
          "path": "docs_assistant@1"
        },
        "timestamp": 1792628371.231196
      }
    ]
  }
}
