Skip to content

Theory: anonymous-lane 429s are conversation-title requests, not quota #164

Closed

Description

@unrayed

Theory: the anonymous-lane 429s are OpenCode conversation-title requests, not quota

Status: theory only. Not confirmed. Needs further investigation before anyone acts on it.

We have been chasing 429 FreeUsageLimitError on the anonymous free tier, assuming a per-egress /64 plus UTC-day quota (see #158). After re-reading a fresh gateway log we think that explanation is at best incomplete, and the failing population may be a different class of request entirely.

Observation

Two requests, same session, same exit set, about 200 ms apart, opposite outcomes:

request status attempts upstream body bytes input tokens
req_ee9e0fc 200 1 - 20225
req_79ab35c 429 8 - 0
req_cf4ebf5 200 1 - 36630
req_b2f3ddf 429 8 2152 0
req_4096518 200 1 133437 37625

Every 200 is a large body. Every 429 is a small body. The 429s walk all 8 exits (8 x 429 at 150-250 ms, about 1.4 s) while the interleaved 200s succeed on the first exit.

If this were an exhausted quota, a request 200 ms earlier could not have succeeded on the same exits.

What the failing body is

We dumped the 2152-byte failing body. Its system message begins:

You name conversations so the user can find them later in a list of past sessions. ... Reply with a title for it and nothing else: one line, no quotes, no trailing period...

That is OpenCode conversation-title generation: single-turn, no tools, tiny. The passing 133 KB body is a real agent turn with full history and tool definitions.

Theory

The free tier only serves agent-shaped requests. We know this at the 403 FreeTierError level, and prepareAnonymousBody compensates by injecting the official system prompt, renaming client tools to clint_*, and appending the full official tool set.

A title request has no client tools to rename and nothing to complete, so the body stays small and effectively unshaped. We suspect such requests fail a shape check upstream and come back as FreeUsageLimitError, which the gateway then reads as a quota 429 and retries across every exit.

If true this explains the whole "some pass, some do not" experience: the visible conversation works while a background titling request fails every time and pollutes the log with 8-exit walks. It also explains why IP rotation, cooldowns, session perturbation and Retry-After handling never moved the success rate: none of them touch request shape.

What this does NOT explain

  • Why the error is FreeUsageLimitError with Retry-After at UTC midnight rather than a 403 or 400. Either the shape gate reuses the quota error, or two gates are being conflated.
  • Why in: 0 on the 429s. Consistent with rejection before tokenisation, but not specific to a shape gate.
  • Whether the small request would succeed if padded to look agent-shaped. This is the one experiment that would confirm or kill the theory, and we have not run it.

Suggested investigation

  1. Capture a title request as OpenCode emits it, replay it on one exit bare and again with the official tool set appended. If bare 429s and tool-completed 200s, the theory holds.
  2. Check whether the free tier documents a minimum shape requirement, or whether FreeUsageLimitError is overloaded for non-quota rejections.
  3. If confirmed, decide whether the gateway should detect title-shaped requests and fail fast (1 attempt instead of 8) or synthesise a local title so upstream is never called.

Non-goal

Not a request to defeat the quota. Rotation is explicitly not the fix: the exits are healthy and a neighbouring request 200s on the first try.

Related: #158 (quota model), #159, #160.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions