Cline answers a free model's daily cap with 429 "Daily free limit reached on model X. Try again in 23h 59m". failure() reads "daily" as quota, so the whole key rested for 15 minutes and every other free model on the account was refused without being asked; the reporter saw the account sent to the back of the list after one model's limit. The limit is per model by Cline's own words, and Cline's client treats it so (CLINE_FREE_MODEL_LIMIT_MARKER "free limit reached on model" and the "try again in" reset parse in cline/cline sdk errors.ts). So for a Cline provider (ClinePinnable: ClinePass, a cline.bot host, the Cline plugin) that refusal now rests restID() (that model) for the time it names (By "resets"). Another vendor's same words, and a Cline 429 that doesn't name a model's limit (5-hour/weekly, "Rate limit exceeded"), rest the key as before. No per-provider toggle: it would make account-wide 429s hit the account once per model, the risk-control pattern the gateway avoids. The Cline plugin's "usage limit reached: <body>" keeps the words (checked with node on its failure() for all three body shapes), so moved users get it too with no plugin change. Run on95e7c6bcc(origin/main) + this change: - gofmt -l internal/gateway: empty. GOOS=darwin, linux and windows go vet -tags nogui ./internal/gateway/: ok. Before the rebase (at69d7ee33a) also go vet ./... for darwin, linux nogui and windows, and darwin, linux nogui and windows builds: ok. - Full suite: SUITE_LINE - internal/gateway package: left to the batch suite. At69d7ee33athe first full run was green in every other package and red in gateway only through the leak below (fixed since); later runs died on a pruned shared cache, a 30m timeout under load ~100, and a kill for disk. - go test -run 'TestCline' with -count=3 -shuffle=on: ok (at69d7ee33a). - Broken by hand: with routing.go at HEAD both new tests fail; the end-to-end one answers mimo with 429 "ClinePass: Daily free limit ... (out of its allowance: not asked again before ...)", the reporter's symptom. With the duration parse off: "rests 14m59s by quota, want 23h59m by resets". - The first full run caught the new test's rest leaking through restingUntil into TestClinePinsDeepSeek; the test now clears it on cleanup. Not tried against a real Cline account (none here); the fixture is the literal message from Cline's own tests.
Subsystem design references
These pages describe current responsibilities, runtime paths, state, and contracts. Start with the subsystem relevant to your task, then follow its source links to verify the implementation you change.
| Subsystem | Reference |
|---|---|
| Built-in subscriptions moving to plugins | Provider and plugin ownership |
| Built-in plugins: registry, lifecycle, plugins.yml, presets, settings schemas, the window's kernel (slots, error boundary, kit) | Plugin runtime |
| Plugins that run on the gateway's requests and replies | Gateway middleware |
| Tools that plugins give, offered to every agent as an MCP server | Plugin tools |
| Claude subscription turns across Claude Code runs | Claude subscription bridge |
| How the gateway picks a provider, key or account, and falls back | Gateway routing and fallback |
| Gateway Session Aggregation | Gateway Session Aggregation |
| Connecting an agent's config to the gateway, drift, disconnect, WSL twins | Agent wiring |
| Providers, keys, subscription accounts, refresh and allowance | Providers and accounts |
| Instructions, MCP servers, skills and RTK written into agents | Library |
Tray, panel, window, magpie web and the page's JSON API |
GUI app shell |
| Encrypted backups and setup synchronization over WebDAV, S3 or GitHub | Sync and backup |
A subsystem can span several packages or repositories. Its reference describes the behavior those parts provide together; it does not need to list every function.
Maintain a reference
Update the owning reference in the same PR when a change alters a documented responsibility, interface, state transition, runtime path, compatibility rule, or failure behavior. An internal refactor that preserves these contracts does not require a prose change.
Keep each fact in one reference and link to it from agent instructions or other pages. Link to source files and named symbols rather than copying implementation details that change frequently. Explain field meanings and constraints that signatures alone do not express.
For a new reference, include the responsibilities and boundaries, source of truth, main runtime paths, state transitions, important constraints, and existing verification commands. Include failure and compatibility behavior where relevant. Document current behavior separately from proposed changes; the proposal belongs in its issue or PR.
Describe a PR's semantic changes
For each affected subsystem, explain the observable change with its trigger and before/after behavior. Include changes to interfaces, state, compatibility, and failure behavior when relevant. Link the affected reference, implementation, and verification evidence. State when a refactor preserves the documented behavior.
For example, a change to plugin adoption should explain which migration state and account condition trigger it, which implementation handles requests before and after adoption, and which test exercises that transition.
This is an author-provided explanation that a reviewer verifies against the diff and surrounding code. It is not an automatically proven compatibility verdict.
Review a change
- Identify the affected subsystem and the actual runtime path, including plugin or built-in ownership.
- Compare the claimed before/after behavior with the base and head implementation. Trace relevant callers and state transitions beyond the changed lines.
- Check that changed contracts appear in the owning reference and that source links still resolve.
- Check that the cited tests or runtime evidence exercise the claimed behavior. Report checks that were not run.
A documentation update alone does not prove the implementation. Existing tests and runtime evidence remain necessary for behavior changes.