Fix Together AI 404 errors caused by inconsistent fingerprint generation#96
Merged
Fix Together AI 404 errors caused by inconsistent fingerprint generation#96
Conversation
Co-authored-by: OEvortex <[email protected]>
Co-authored-by: OEvortex <[email protected]>
…ency Co-authored-by: OEvortex <[email protected]>
Copilot
AI
changed the title
[WIP] Fix Together Ai 404 error after multiple messages
Fix Together AI 404 errors caused by inconsistent fingerprint generation
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Together AI requests fail with 404 after 2-3 messages because each fingerprint generation creates a new
LitAgentinstance with a different random IP pool, triggering anti-bot measures.Changes
Root cause: Static
generate_fingerprint()method instantiates newLitAgenton every call, causing IPs to jump between unrelated pools:Fix: Instance-based fingerprint generation using shared
LitAgent:Modified files
Provider/TogetherAI.py: Added_generate_consistent_fingerprint()instance method, updatedrefresh_identity()to maintain IP header consistencyProvider/TTI/together.py: Cache fingerprint per session inbuild_headers(), added_generate_consistent_fingerprint()toImagesclassProvider/OPENAI/TogetherAI.py: Replaced static fingerprint call with instance methodAll implementations include defensive
hasattr()check forrandom_idmethod.Result
IPs now rotate predictably (e.g.,
192.168.1.1→192.168.1.2→192.168.1.3) instead of randomly jumping pools, eliminating 404s while maintaining anti-fingerprinting rotation.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.