Hi all!! noobie here. I just installed OpenClaw today.
Environment:
OS: macOS (Mac Studio)
Version: OpenClaw 2026.4.15 (041266a)
Primary Model: gpt-4o
The Issue:
I am unable to successfully authenticate using OpenAI OAuth directly within OpenClaw. As a workaround, I have been forced to use the GitHub Copilot provider. While it works initially, it leads to a critical failure:
- Context Overflow: Since GitHub Copilot has a strict 64k token limit, my sessions quickly exceed this threshold (reaching ~66k tokens).
- System Crash: The Gateway crashes with a disconnected (1006) error and enters a restart loop.
- Configuration Failure: I’ve attempted to manually limit the context in openclaw.json using keys like contextWindow, maxContext, or maxContextWindow under agents.defaults, but the system rejects them as Unrecognized key, making the config invalid.
I need help with:
- How can I fix the OpenAI OAuth connection to properly use my OpenAI subscription instead of the Copilot bridge?
- What is the correct schema for version 2026.4.15 to hard-limit the contextWindow and prevent these recursive crashes?
Logs:
[agent/embedded] error=LLM request failed: prompt token count of 66862 exceeds the limit of 64000
Problem: - agents.defaults: Unrecognized key: "maxContext"