#2549

Salvage from the closed September gateway routing stack

OpenDanielButler1opened 12d ago

Current review — 2026-10-20

Some failure-preserving bridge behavior was subsequently redone on main: phaseoteam/Phaseo#2990, phaseoteam/Phaseo#2991, phaseoteam/Phaseo#2992, and the provider simulator phaseoteam/Phaseo#2968. Re-audit this sub-item against those implementations before redoing it. Bounded buffering, failed-settlement recovery, advisory reporting and the schema/overage decisions remain unproven/open; the old stacked PRs remain closed unmerged.


The September gateway routing overhaul (phaseoteam/Phaseo#2465 and its ~60 stacked drafts, phaseoteam/Phaseo#2523–phaseoteam/Phaseo#2621, plus phaseoteam/Phaseo#2442) is being closed: none of it is on main, phaseoteam/Phaseo#2777 re-did the caching/lease work differently, and a trial merge onto main (9391271d1c) gives 146 conflict hunks. These ideas from it are not on main and are worth redoing as small PRs against current code. The closed PR descriptions hold the original designs and test notes.

Worth redoing

  • Bounded SSE parsing and stream buffering — phaseoteam/Phaseo#2542, phaseoteam/Phaseo#2555, phaseoteam/Phaseo#2556, phaseoteam/Phaseo#2557. core/sse-parser.ts (from phaseoteam/Phaseo#2777) and the text/Anthropic/Google stream paths have no size limits, which is a memory risk on Workers.
  • Recovery when usage settlement fails — phaseoteam/Phaseo#2613.
  • Chat ↔ Responses ↔ Messages stream bridges that preserve provider failures — phaseoteam/Phaseo#2545, phaseoteam/Phaseo#2547, phaseoteam/Phaseo#2549, phaseoteam/Phaseo#2551.
  • Batched advisory health reports — phaseoteam/Phaseo#2537 (only if the health work still matters).

Decisions needed

  • Free-model overage fees (phaseoteam/Phaseo#2604–phaseoteam/Phaseo#2609, phaseoteam/Phaseo#2621): wanted at all? main shipped a different free-model limit (phaseoteam/Phaseo#2690/phaseoteam/Phaseo#2790).
  • Prod schema with no code on main: phaseoteam/Phaseo#2622 committed four migrations from the stack because prod had already applied them (publication outbox from phaseoteam/Phaseo#2589, quota owner from phaseoteam/Phaseo#2594, free-model reservation from phaseoteam/Phaseo#2604, audit identity from phaseoteam/Phaseo#2607); the runtime snapshot migration came in via phaseoteam/Phaseo#2573. Drop with a migration, or document as reserved.

Test notes worth reading

phaseoteam/Phaseo#2593 and phaseoteam/Phaseo#2604 describe concurrency and replay tests in detail.

Activity

1
linear-code[bot]12d ago