OpenAI/ChatGPT returns "You have hit your ChatGPT usage limit (plus plan)"
when users exceed their plan quota. This error wasn't being recognized as a
rate limit, so fallback to alternative models wasn't triggering.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Images were previously converted to markdown data URLs which Claude API
treats as plain text, not as actual images.
Changes:
- Add parseMessageWithAttachments() that returns {message, images[]}
- Pass images through the stack to session.prompt() as content blocks
- Filter null/empty attachments before parsing
- Strip data URL prefix if client sends it
This enables iOS and other clients to send images that Claude can actually see.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace model catalog with 11 current models: gpt-5.1-codex, claude-opus-4-5,
gemini-3-pro, alpha-glm-4.7, gpt-5.1-codex-mini, gpt-5.1, glm-4.7-free,
gemini-3-flash, gpt-5.1-codex-max, minimax-m2.1-free, gpt-5.2
- Add accurate per-token costs from OpenCode Zen pricing
- Add accurate context windows and output limits
- Update aliases for new model families (codex, glm, minimax)
- Remove deprecated models (sonnet, haiku, o-series, gemini-2.5)
- Expand schema scrubber to strip additional constraint keywords rejected
by Cloud Code Assist (examples, minLength, maxLength, minimum, maximum,
multipleOf, pattern, format, minItems, maxItems, uniqueItems,
minProperties, maxProperties)
- Extend tool call ID sanitization to cover toolUse and toolCall block
types (previously only functionCall was sanitized)
- Update pi-tools test to include 'examples' in unsupported keywords
Fixes 400 errors when using google-antigravity/claude-opus-4-5-thinking:
- tools.N.custom.input_schema: JSON schema is invalid
- messages.N.content.N.tool_use.id: String should match pattern