Skip to content

Payload problem - #13

Merged
ayushkumar320 merged 2 commits into
mainfrom
payload-problem
Aug 11, 2026
Merged

ayushkumar320 merged 2 commits into
mainfrom
payload-problem

Conversation

@ayushkumar320

Copy link
Copy Markdown
Collaborator

No description provided.

ayushkumar320 and others added 2 commits August 11, 2026 21:20
Groq reports a tokens-per-minute overrun as HTTP 413 with
`code: "rate_limit_exceeded"`, not as 429. The OpenAI-compatible client read
that as a transport error, so it skipped the backoff, ignored `Retry-After`,
and the raw exception string reached the reader through `retrieval_path` as
"413 Payload Too Large" — which reads as "your question was too big" and sends
them off shortening a question that was never the problem. On a free-tier key
this was every second question inside a minute.

* Classify 413-with-a-rate-limit-marker as `RateLimitError` in both `chat` and
  `stream`, so it gets the backoff and the failover chain. A 413 without the
  marker is a genuinely oversized body and stays a hard error: waiting never
  shrinks it.
* Give the sufficiency judge chunk heads instead of the answer's full 24k
  chars. It only decides whether to spend another hop, but it ran on the same
  model against the same quota window, so one question cost roughly twice what
  the answer needed.
* Stop putting `str(exc)` in front of the reader; report the shape of the
  failure and leave the detail in the log line above it.
* Document `CEREBRAS_API_KEY`, which was missing from both deployment env
  blocks — without it the resolution chain has no second tier to fail over to.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Indexing is the expensive half of this product — clone, chunk, summarise,
embed — and the free-repository path ran it on the platform's key, so a
deployment could not bound its own cost or rate limits. Hugging Face was also
optional, which left `llm_hf_chat_fallback` off and the third failover tier
unreachable for the readers who most needed it.

* Both keys are now mandatory at connect time, each validated against its
  provider before anything is stored, and HF chat fallback is always on for a
  reader-built provider. A credential row saved before this reports as not
  connected rather than quietly falling back to the platform token.
* `POST /repos` resolves the reader's provider first and refuses with
  `PROVIDER_KEY_REQUIRED` without one. The web app already opens the key
  dialog on that code, so the reader sees a prompt, not an error.
* The arq worker no longer builds a platform-keyed provider at startup. The
  job carries a session id and resolves that reader's keys from the encrypted
  store itself, so no API key is ever written to the job queue. It is used only
  for account-bound keys, the one case another process can rebuild them;
  anonymous sessions keep indexing in-process as they already did.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 11, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ayushkumar320
ayushkumar320 merged commit 238668d into main Aug 11, 2026
2 checks passed
@ayushkumar320
ayushkumar320 deleted the payload-problem branch August 11, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants