ERROR [2026-02-19 11:06:17.241 -0500] (Mastra): Error in agent stream runId: "2e73a7c0-59da-48d6-8d6f-8b9b1ebdd053" provider: "vercel" modelId: "openai/gpt-oss-120bs" error: { "message": "Invalid error response format: Gateway request failed", "name": "GatewayResponseError", "stack": GatewayResponseError: Invalid error response format: Gateway request failed at createGatewayErrorFromResponse (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-CXVMDV2B.js:2728:12) at process.processTicksAndRejections (node:internal/process/task_queues:104:5) at async asGatewayError (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-CXVMDV2B.js:2879:12) at async GatewayLanguageModel.doStream (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-CXVMDV2B.js:3111:13) at async AISDKV6LanguageModel.doStream (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-AIRMLZ43.js:54:12) at async pRetry.default.retries (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-MZIMV2BB.js:10754:34) at async Module.pRetry (file:///Users/bardo/Codigo/testing-mastra/node_modules/p-retry/index.js:197:19) at async createStream (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-MZIMV2BB.js:10751:16) at async Object.start (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-MZIMV2BB.js:10617:27) "cause": { "message": "Method Not Allowed", "name": "AI_APICallError", "stack": AI_APICallError: Method Not Allowed at file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-CXVMDV2B.js:2269:14 at process.processTicksAndRejections (node:internal/process/task_queues:104:5) at async postToApi (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-CXVMDV2B.js:2176:28) at async GatewayLanguageModel.doStream (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-CXVMDV2B.js:3064:52) at async AISDKV6LanguageModel.doStream (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-AIRMLZ43.js:54:12) at async pRetry.default.retries (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-MZIMV2BB.js:10754:34) at async Module.pRetry (file:///Users/bardo/Codigo/testing-mastra/node_modules/p-retry/index.js:197:19) at async createStream (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-MZIMV2BB.js:10751:16) at async Object.start (file:///Users/bardo/Codigo/testing-mastra/node_modules/@mastra/core/dist/chunk-MZIMV2BB.js:10617:27) "url": "https://ai-gateway.vercel.sh/v1/language-model", "requestBodyValues": { "tools": [ { "type": "function", "name": "weatherTool", "description": "Get current weather for a location", "inputSchema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "location": { "type": "string", "description": "City name" } }, "required": [ "location" ], "additionalProperties": false } } ], "toolChoice": { "type": "auto" }, "prompt": [ { "role": "system", "content": "\n You are a helpful weather assistant that provides accurate weather information and can help planning activities based on the weather.\n\n Your primary function is to help users get weather details for specific locations. When responding:\n - Always ask for a location if none is provided\n - If the location name isn't in English, please translate it\n - If giving a location with multiple parts (e.g. \"New York, NY\"), use the most relevant part (e.g. \"New York\")\n - Include relevant details like humidity, wind conditions, and precipitation\n - Keep responses concise but informative\n - If the user asks for activities and provides the weather forecast, suggest activities based on the weather forecast.\n - If the user asks for activities, respond in the format they request.\n\n Use the weatherTool to fetch current weather data.\n" }, { "role": "user", "content": [ { "type": "text", "text": "Based on the following weather forecast for Lima, suggest appropriate activities:\n {\n \"date\": \"2026-02-19T16:06:13.580Z\",\n \"maxTemp\": 25.8,\n \"minTemp\": 21.9,\n \"precipitationChance\": 40,\n \"condition\": \"Partly cloudy\",\n \"location\": \"Lima\"\n}\n For each day in the forecast, structure your response exactly as follows:\n\n 📅 [Day, Month Date, Year]\n ═══════════════════════════\n\n 🌡️ WEATHER SUMMARY\n • Conditions: [brief description]\n • Temperature: [X°C/Y°F to A°C/B°F]\n • Precipitation: [X% chance]\n\n 🌅 MORNING ACTIVITIES\n Outdoor:\n • [Activity Name] - [Brief description including specific location/route]\n Best timing: [specific time range]\n Note: [relevant weather consideration]\n\n 🌞 AFTERNOON ACTIVITIES\n Outdoor:\n • [Activity Name] - [Brief description including specific location/route]\n Best timing: [specific time range]\n Note: [relevant weather consideration]\n\n 🏠 INDOOR ALTERNATIVES\n • [Activity Name] - [Brief description including specific venue]\n Ideal for: [weather condition that would trigger this alternative]\n\n ⚠️ SPECIAL CONSIDERATIONS\n • [Any relevant weather warnings, UV index, wind conditions, etc.]\n\n Guidelines:\n - Suggest 2-3 time-specific outdoor activities per day\n - Include 1-2 indoor backup options\n - For precipitation >50%, lead with indoor activities\n - All activities must be specific to the location\n - Include specific venues, trails, or locations\n - Consider activity intensity based on temperature\n - Keep descriptions concise but informative\n\n Maintain this exact formatting for consistency, using the emoji and section headers as shown." } ] } ], "includeRawChunks": false, "temperature": 0 }, "statusCode": 405, "responseHeaders": { "cache-control": "public, max-age=0, must-revalidate", "content-disposition": "inline; filename=\"404\"", "content-type": "text/html; charset=utf-8", "date": "Thu, 19 Feb 2026 16:06:17 GMT", "server": "Vercel", "strict-transport-security": "max-age=63072000; includeSubDomains; preload", "transfer-encoding": "chunked", "x-matched-path": "/404", "x-next-error-status": "404", "x-vercel-cache": "BYPASS", "x-vercel-id": "gru1::7mv26-1771517177215-d029d438cb31" }, "responseBody": "", "isRetryable": false }, "statusCode": 405, "type": "response_error", "response": "", "validationError": { "name": "AI_TypeValidationError", "cause": { "name": "ZodError", "message": "[\n {\n \"expected\": \"object\",\n \"code\": \"invalid_type\",\n \"path\": [],\n \"message\": \"Invalid input: expected object, received string\"\n }\n]" }, "value": "" } }