- URL constructor was too strict and failing on valid domains
- new regex pattern validates common URL formats more permissively
- ensures scheme prepending works in both main logic and fetchRemotePageHTML
- fixes issues with domains like www.inrupt.com
- replace hardcoded "Hermes AI" with actual selected model
- progress now shows "Translating with <model-name>..."
- makes progress messages accurate for all model selections
- cap all max_tokens to model's max completion tokens limit
- fixes sendMessageWithCustomHistory in chat.js
- fixes intro generation in ui.js
- fixes TTS processing token calculation
- prevents "max_tokens must be less than or equal to 8192" errors
Fetch and store maxCompletionTokens from models endpoint to respect
each model's specific output limits. This fixes 400 errors from
Groq models that have different completion limits than context windows.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
When upstream tokenization fails (404, errors), cache the endpoint
and automatically use JS tokenizer for future requests. This fixes
chunking for APIs like Groq that don't have tokenize endpoints.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changed from broken buffer calculation to 40% output reserve which gives
individual chunks much more room for translation output. Reverted
preservation mode changes to keep original behavior.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Consolidated duplicate imports in translate-modal.js that were causing
SyntaxError: redeclaration of const getSelectedModel.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Previous buffer calculation used 1.5x input tokens which exceeded model
context window for large content. Changed to fixed 1000 token reserve
and improved chunk sizing to use reasonable portions of model capacity.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>