feat(providers): switch accounts mid-thread and track usage limits #9181
Closedtamimbinhakim(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/9181/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/server/src/orchestration/Layers/ProviderRateLimitReactor.ts lines 267 to 267OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +247,21 @@247+ turnId: event.turnId,248+ createdAt: event.createdAt,249+ });250+ yield* retryTurnOnProvider({ thread, userMessage, to, createdAt: event.createdAt });251+ });252+253+ const processEvent = (event: ProviderRuntimeEvent) =>254+ recordRateLimit(event).pipe(255+ Effect.andThen(maybeSwitchFailedTurn(event)),256+ Effect.catchCause((cause) =>257+ Effect.logWarning("provider rate limit reactor failed to process runtime event", {258+ eventId: event.eventId,259+ eventType: event.type,260+ cause: Cause.pretty(cause),261+ }),262+ ),263+ );264+265+ const worker = yield* makeDrainableWorker(processEvent);266+267+ const start: ProviderRateLimitReactorShape["start"] = () =>apps/server/src/orchestration/Layers/ProviderRateLimitReactor.ts lines 286 to 286OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +266,21 @@266+267+ const start: ProviderRateLimitReactorShape["start"] = () =>268+ forkParked(269+ Stream.runForEach(providerService.streamEvents, (event) => {270+ if (271+ event.type !== "account.rate-limits.updated" &&272+ !(event.type === "turn.completed" && event.payload.state === "failed")273+ ) {274+ return Effect.void;275+ }276+ return worker.enqueue(event);277+ }),278+ );279+280+ return {281+ start,282+ drain: worker.drain,283+ } satisfies ProviderRateLimitReactorShape;284+});285+286+export const ProviderRateLimitReactorLive = Layer.effect(ProviderRateLimitReactor, make);apps/server/src/orchestration/Services/ProviderRateLimitReactor.ts lines 13 to 27OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +7,21 @@7+ * @module ProviderRateLimitReactor8+ */9+import * as Context from "effect/Context";10+import type * as Effect from "effect/Effect";11+import type * as Scope from "effect/Scope";12+13+export interface ProviderRateLimitReactorShape {14+ /**15+ * Start consuming provider runtime events. The returned effect must be run16+ * in a scope so the worker fiber is finalized on shutdown.17+ */18+ readonly start: () => Effect.Effect<void, never, Scope.Scope>;19+20+ /** Resolves when every queued event has been processed. Test use only. */21+ readonly drain: Effect.Effect<void>;22+}23+24+export class ProviderRateLimitReactor extends Context.Service<25+ ProviderRateLimitReactor,26+ ProviderRateLimitReactorShape27+>()("t3/orchestration/Services/ProviderRateLimitReactor") {}
- apps/server/src/orchestration/Layers/ProviderRateLimitReactor.ts line 232OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +212,21 @@212+213+ const to = selectRateLimitFallbackProvider({214+ providers,215+ instanceId: from.instanceId,216+ nowMs,217+ });218+ if (!to) {219+ yield* Effect.logInfo("provider rate limit reactor found no fallback account", {220+ threadId: event.threadId,221+ instanceId: from.instanceId,222+ });223+ return;224+ }225+226+ const thread = yield* resolveThreadDetail(event.threadId);227+ if (!thread) return;228+ const userMessages = thread.messages229+ .toReversed()230+ .filter((message) => message.role === "user" && message.text.trim().length > 0);231+ const userMessage =232+ userMessages.find((message) => message.turnId === event.turnId) ?? userMessages[0];apps/web/src/components/chat/ProviderInstanceIcon.tsx line 26OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -14,3 +14,13 @@1414 .join("");1515 }161617+/**18+ * Accounts with an accent colour paint the provider logo itself in that19+ * colour, so two Claude accounts read as a blue Claude and a green Claude20+ * instead of identical logos with a tiny corner badge. The inline style wins21+ * over the brand `fill-*` class and any `grayscale` dimming a caller applies.22+ */23+export function providerAccentIconStyle(24+ accentColor: string | undefined,25+): CSSProperties | undefined {26+ return accentColor ? { fill: accentColor, color: accentColor, filter: "none" } : undefined;@@ -0,0 +78,21 @@78+ : undefined;79+ if (status === undefined) return undefined;80+ return build({81+ status,82+ resetsAt: epochToIso(info.resetsAt),83+ window: asNonEmptyString(info.rateLimitType),84+ utilization: clampUtilization(info.utilization),85+ observedAt,86+ });87+}88+89+/**90+ * Codex app-server `account/rateLimits/updated`:91+ * `{ rateLimits: { primary?, secondary?, rateLimitReachedType? } }` where each92+ * window is `{ usedPercent, resetsAt, windowDurationMins }`.93+ */94+function readCodexRateLimit(95+ payload: Record<string, unknown>,96+ observedAt: string,97+): ServerProviderRateLimit | undefined {98+ const snapshot = asRecord(payload.rateLimits) ?? payload;apps/server/src/provider/Layers/ProviderRegistry.ts line 490OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -474,3 +483,8 @@474483 },475484 );476485486+ const setProviderRateLimit = Effect.fn("setProviderRateLimit")(function* (input: {487+ readonly instanceId: ProviderInstanceId;488+ readonly rateLimit: ServerProviderRateLimit | null;489+ }) {490+ yield* Ref.update(rateLimitStatesRef, (previous) => {apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 1240Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1127,0 +1163,21 @@1163+ Effect.map((settings) => settings.autoSwitchProviderOnRateLimit),1164+ Effect.orElseSucceed(() => false),1165+ );1166+ if (!autoSwitch) {1167+ return input.requestedModelSelection;1168+ }1169+ const fallback = selectRateLimitFallbackProvider({1170+ providers,1171+ instanceId: currentInstanceId,1172+ nowMs,1173+ });1174+ if (!fallback) {1175+ return input.requestedModelSelection;1176+ }1177+ yield* Effect.logInfo("provider command reactor routing turn to fallback account", {1178+ threadId: input.thread.id,1179+ fromInstanceId: currentInstanceId,1180+ toInstanceId: fallback.instanceId,1181+ resetsAt: current.rateLimit?.resetsAt,1182+ });1183+ yield* Effect.all({apps/server/src/provider/providerRateLimits.ts line 159OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +139,21 @@139+ if (!rateLimits) return undefined;140+ switch (input.driver) {141+ case "claudeAgent":142+ return readClaudeRateLimit(rateLimits, input.observedAt);143+ case "codex":144+ return readCodexRateLimit(rateLimits, input.observedAt);145+ default:146+ return undefined;147+ }148+}149+150+/**151+ * Some runtimes only surface a usage limit as the failing turn's error text.152+ * Treat that as a rejection with no known reset so the account is not retried153+ * blindly; the next structured update replaces it.154+ */155+export function readProviderRateLimitFromTurnError(input: {156+ readonly errorMessage: string | undefined;157+ readonly observedAt: string;158+}): ServerProviderRateLimit | undefined {159+ if (!input.errorMessage || !USAGE_LIMIT_ERROR_PATTERN.test(input.errorMessage)) {apps/server/src/provider/Layers/ClaudeAdapter.ts line 1746OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1731,3 +1743,4 @@17311743 const claudeEnvironment = yield* makeClaudeEnvironment(claudeSettings, options?.environment).pipe(17321744 Effect.provideService(Path.Path, path),17331745 );1746+ const claudeHomePath = yield* resolveClaudeHomePath(claudeSettings).pipe(apps/web/src/components/ChatView.tsx line 5932Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -5148,0 +5184,21 @@5184+ resolveAppModelSelectionForInstance(5185+ fallback.instanceId,5186+ settings,5187+ providerStatuses,5188+ currentModel,5189+ ) ?? currentModel;5190+ const nextModelSelection: ModelSelection = {5191+ instanceId: fallback.instanceId,5192+ model: resolvedModel,5193+ };5194+ const threadRef = scopeThreadRef(activeThread.environmentId, activeThread.id);5195+ setComposerDraftModelSelection(threadRef, nextModelSelection, { explicit: true });5196+ setStickyComposerModelSelection(nextModelSelection);5197+ // A turn that just failed on the limited account is worth re-sending5198+ // as-is; put it back in the composer when nothing else is drafted.5199+ if (activeThread.session?.status === "error" && !composerHasUnsentContent) {5200+ const lastUserMessage = activeThread.messages5201+ .toReversed()5202+ .find((message) => message.role === "user" && message.text.trim().length > 0);5203+ if (lastUserMessage) {5204+ setComposerDraftPrompt(threadRef, lastUserMessage.text);packages/shared/src/providerRateLimits.ts line 61OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +41,21 @@41+/**42+ * Pick another configured account that can continue a thread bound to43+ * `instanceId`: same driver, same continuation group, usable, and not limited44+ * itself. Ties break toward the account with the most headroom.45+ */46+export function selectRateLimitFallbackProvider<47+ Candidate extends RateLimitFallbackCandidate,48+>(input: {49+ readonly providers: ReadonlyArray<Candidate>;50+ readonly instanceId: ProviderInstanceId;51+ readonly nowMs: number;52+}): Candidate | null {53+ const current = input.providers.find((provider) => provider.instanceId === input.instanceId);54+ if (!current) return null;55+ const currentGroupKey = current.continuation?.groupKey;56+57+ let best: Candidate | null = null;58+ for (const candidate of input.providers) {59+ if (candidate.instanceId === current.instanceId) continue;60+ if (candidate.driver !== current.driver) continue;61+ if (candidate.continuation?.groupKey !== currentGroupKey) continue;
- apps/web/src/components/chat/ModelPickerSidebar.tsx lines 161 to 162OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -150,6 +158,5 @@150158 ? describeUnavailableInstance(entry)151159 : isContextDisabled152160 ? (props.getDisabledInstanceTooltip?.(entry) ?? entry.displayName)153- : showNewBadge154- ? `${entry.displayName} — New`155- : entry.displayName;161+ : (describeRateLimitedInstance(entry) ??162+ (showNewBadge ? `${entry.displayName} — New` : entry.displayName));apps/web/src/components/chat/ProviderInstanceIcon.tsx line 26OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -14,3 +14,13 @@1414 .join("");1515 }161617+/**18+ * Accounts with an accent colour paint the provider logo itself in that19+ * colour, so two Claude accounts read as a blue Claude and a green Claude20+ * instead of identical logos with a tiny corner badge. The inline style wins21+ * over the brand `fill-*` class and any `grayscale` dimming a caller applies.22+ */23+export function providerAccentIconStyle(24+ accentColor: string | undefined,25+): CSSProperties | undefined {26+ return accentColor ? { fill: accentColor, color: accentColor, filter: "none" } : undefined;@@ -5146,3 +5152,14 @@51465152 resumeCompactionPermanentlyDismissed,51475153 selectedProvider,51485154 ]);5155+ // Usage-limit suggestion: the thread's account is out of usage and the5156+ // server is not switching accounts on its own. Dismissal is per limit5157+ // window, so a fresh limit later resurfaces the banner.5158+ const [dismissedRateLimitKeys, setDismissedRateLimitKeys] = useState<ReadonlySet<string>>(5159+ new Set(),5160+ );5161+ const rateLimitSuggestion = useMemo(5162+ () =>5163+ activeThread5164+ ? resolveProviderRateLimitSuggestion({5165+ providers: providerStatuses,apps/web/src/components/chat/ProviderInstanceIcon.tsx line 78OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -59,4 +75,4 @@5975 aria-hidden6076 />6177 ) : null}62- {props.showBadge ? (78+ {props.showBadge && !props.accentColor ? (
- apps/server/src/orchestration/ProviderRateLimitReactor.ts line 167OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +147,21 @@147+ const commandId = yield* serverCommandId("provider-rate-limit-retry");148+ const messageId = MessageId.make(yield* crypto.randomUUIDv4);149+ const modelSelection: ModelSelection = {150+ ...input.thread.modelSelection,151+ instanceId: input.to.instanceId,152+ };153+ yield* orchestrationEngine.dispatch({154+ type: "thread.turn.start",155+ commandId,156+ threadId: input.thread.id,157+ message: {158+ messageId,159+ role: "user",160+ text: input.userMessage.text,161+ attachments: input.userMessage.attachments ?? [],162+ },163+ modelSelection,164+ runtimeMode: input.thread.runtimeMode,165+ interactionMode: input.thread.interactionMode,166+ createdAt: input.createdAt,167+ });apps/server/src/provider/Drivers/ClaudeHome.ts line 124Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -40,0 +82,21 @@82+ if (yield* fileSystem.exists(fromProjects)) {83+ for (const entry of yield* fileSystem.readDirectory(fromProjects)) {84+ if (entry !== preferredProject) candidates.push(entry);85+ }86+ }87+88+ for (const project of candidates) {89+ const fromTranscript = path.join(fromProjects, project, transcriptName);90+ if (!(yield* fileSystem.exists(fromTranscript))) continue;91+92+ const toProject = path.join(input.toHomePath, "projects", project);93+ yield* fileSystem.makeDirectory(toProject, { recursive: true });94+ yield* fileSystem.copyFile(fromTranscript, path.join(toProject, transcriptName));95+96+ const fromSidecar = path.join(fromProjects, project, input.sessionId);97+ if (yield* fileSystem.exists(fromSidecar)) {98+ yield* fileSystem.copy(fromSidecar, path.join(toProject, input.sessionId), {99+ overwrite: true,100+ });101+ }102+ return true;apps/server/src/provider/providerRateLimits.ts line 163OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +143,21 @@143+ case "codex":144+ return readCodexRateLimit(rateLimits, input.observedAt);145+ default:146+ return undefined;147+ }148+}149+150+/**151+ * Some runtimes only surface a usage limit as the failing turn's error text.152+ * Treat that as a rejection with no known reset so the account is not retried153+ * blindly; the next structured update replaces it.154+ */155+export function readProviderRateLimitFromTurnError(input: {156+ readonly errorMessage: string | undefined;157+ readonly observedAt: string;158+}): ServerProviderRateLimit | undefined {159+ if (!input.errorMessage || !USAGE_LIMIT_ERROR_PATTERN.test(input.errorMessage)) {160+ return undefined;161+ }162+ return build({ status: "rejected", observedAt: input.observedAt });163+}@@ -0,0 +257,21 @@257+ Effect.logWarning("provider rate limit reactor failed to process runtime event", {258+ eventId: event.eventId,259+ eventType: event.type,260+ cause: Cause.pretty(cause),261+ }),262+ ),263+ );264+265+ const worker = yield* makeDrainableWorker(processEvent);266+267+ const start: ProviderRateLimitReactorShape["start"] = () =>268+ forkParked(269+ Stream.runForEach(providerService.streamEvents, (event) => {270+ if (271+ event.type !== "account.rate-limits.updated" &&272+ !(event.type === "turn.completed" && event.payload.state === "failed")273+ ) {274+ return Effect.void;275+ }276+ return worker.enqueue(event);277+ }),
- apps/server/src/orchestration/ProviderRateLimitReactor.test.ts lines 29 to 34OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +14,21 @@14+import * as NodeServices from "@effect/platform-node/NodeServices";15+import { assert, describe, it } from "@effect/vitest";16+import * as Effect from "effect/Effect";17+import * as Layer from "effect/Layer";18+import * as Option from "effect/Option";19+import * as PubSub from "effect/PubSub";20+import * as Ref from "effect/Ref";21+import * as Stream from "effect/Stream";22+23+import { makeManualOnlyProviderMaintenanceCapabilities } from "../provider/providerMaintenance.ts";24+import { ProviderRegistry } from "../provider/Services/ProviderRegistry.ts";25+import { ProviderService } from "../provider/Services/ProviderService.ts";26+import { ServerSettingsService } from "../serverSettings.ts";27+import { OrchestrationEngineService } from "./Services/OrchestrationEngine.ts";28+import { ProjectionSnapshotQuery } from "./Services/ProjectionSnapshotQuery.ts";29+import {30+ layer as providerRateLimitReactorLayer,31+ mergeCodexRateLimit,32+ PROVIDER_INSTANCE_SWITCHED_ACTIVITY_KIND,33+ ProviderRateLimitReactor,34+} from "./ProviderRateLimitReactor.ts";
- apps/server/src/orchestration/ProviderRateLimitReactor.ts line 317OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +297,21 @@297+ yield* Effect.logInfo("provider rate limit reactor switching thread to fallback account", {298+ threadId: thread.id,299+ turnId: event.turnId,300+ fromInstanceId: from.instanceId,301+ toInstanceId: to.instanceId,302+ resetsAt: from.rateLimit?.resetsAt,303+ });304+ yield* appendSwitchActivity({305+ threadId: thread.id,306+ from,307+ to,308+ turnId: event.turnId,309+ createdAt: event.createdAt,310+ });311+ yield* retryTurnOnProvider({ thread, userMessage, to, createdAt: event.createdAt });312+ });313+314+ const processInput = (input: ReactorInput) =>315+ (input.source === "domain"316+ ? Effect.sync(() => {317+ latestTurnMessageByThread.set(apps/web/src/components/ChatView.tsx line 5253OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -5148,0 +5233,21 @@5233+ const reset = formatProviderRateLimitReset(5234+ rateLimitSuggestion.limited.rateLimit?.resetsAt,5235+ Date.parse(`${nowMinute}:00.000Z`),5236+ );5237+ const fallback = rateLimitSuggestion.fallback;5238+ return {5239+ id: `provider-rate-limit:${rateLimitSuggestion.key}`,5240+ variant: "warning",5241+ icon: <GaugeIcon />,5242+ title: `${providerInstanceLabel(rateLimitSuggestion.limited)} hit its usage limit`,5243+ description: fallback5244+ ? `${reset ? `${reset[0]!.toUpperCase()}${reset.slice(1)}. ` : ""}${providerInstanceLabel(fallback)} can continue this thread.`5245+ : (reset ?? undefined),5246+ actions: fallback ? (5247+ <Button size="xs" variant="ghost" onClick={handleSwitchRateLimitedAccount}>5248+ Switch to {providerInstanceLabel(fallback)}5249+ </Button>5250+ ) : undefined,5251+ dismissLabel: "Dismiss usage limit notice",5252+ onDismiss: () =>5253+ setDismissedRateLimitKeys((keys) => new Set(keys).add(rateLimitSuggestion.key)),
- @@ -184,4 +191,6 @@184191 driverKind={entry.driverKind}185192 displayName={entry.displayName}186193 accentColor={entry.accentColor}187- showBadge={showInstanceBadge}194+ // The tinted glyph is the account marker; initials only195+ // disambiguate siblings that have no colour.196+ showBadge={showInstanceBadge && entry.accentColor === undefined}apps/web/src/components/ChatView.tsx lines 5230 to 5230OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -5148,0 +5210,21 @@5210+ .toReversed()5211+ .find((message) => message.role === "user" && message.text.trim().length > 0);5212+ if (lastUserMessage && (lastUserMessage.attachments?.length ?? 0) === 0) {5213+ setComposerDraftPrompt(threadRef, lastUserMessage.text);5214+ }5215+ }5216+ setDismissedRateLimitKeys((keys) => new Set(keys).add(rateLimitSuggestion.key));5217+ scheduleComposerFocus();5218+ }, [5219+ activeThread,5220+ composerHasUnsentContent,5221+ providerStatuses,5222+ rateLimitSuggestion,5223+ scheduleComposerFocus,5224+ setComposerDraftModelSelection,5225+ setComposerDraftPrompt,5226+ setStickyComposerModelSelection,5227+ settings,5228+ ]);5229+ const rateLimitBannerItem = useMemo<ComposerBannerStackItem | null>(() => {5230+ if (!rateLimitSuggestion || dismissedRateLimitKeys.has(rateLimitSuggestion.key)) {
- @@ -0,0 +196,21 @@196+197+ const retryTurnOnProvider = (input: {198+ readonly thread: OrchestrationThread;199+ readonly userMessage: OrchestrationThread["messages"][number];200+ readonly to: ServerProvider;201+ readonly createdAt: string;202+ }) =>203+ Effect.gen(function* () {204+ const commandId = yield* serverCommandId("provider-rate-limit-retry");205+ const modelSelection: ModelSelection = {206+ ...input.thread.modelSelection,207+ instanceId: input.to.instanceId,208+ };209+ yield* orchestrationEngine.dispatch({210+ type: "thread.turn.start",211+ commandId,212+ threadId: input.thread.id,213+ message: {214+ // Same id as the original: the projection upserts instead of215+ // appending, so the transcript keeps a single bubble.216+ messageId: input.userMessage.id,apps/server/src/orchestration/ProviderRateLimitReactor.ts line 289OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +269,21 @@269+ const nowMs = Date.parse(event.createdAt);270+ const providers = yield* providerRegistry.getProviders;271+ const from = providers.find((p) => p.instanceId === event.providerInstanceId);272+ if (!from || !isProviderRateLimitActive(from.rateLimit, nowMs)) return;273+ if (!(yield* autoSwitchEnabled)) return;274+275+ const to = selectRateLimitFallbackProvider({276+ providers,277+ instanceId: from.instanceId,278+ nowMs,279+ });280+ if (!to) {281+ yield* Effect.logInfo("provider rate limit reactor found no fallback account", {282+ threadId: event.threadId,283+ instanceId: from.instanceId,284+ });285+ return;286+ }287+288+ const messageId = latestTurnMessageByThread.get(event.threadId);289+ if (messageId === undefined) return;apps/server/src/orchestration/ProviderRateLimitReactor.ts line 115OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +95,21 @@95+/**96+ * Codex reports windows sparsely: an update carrying only the 5-hour window97+ * says nothing about a still-rejected weekly window. Keep the previous98+ * rejection until its own reset passes or an update names that window.99+ */100+export function mergeCodexRateLimit(101+ previous: ServerProviderRateLimit | undefined,102+ next: ServerProviderRateLimit,103+ nowMs: number,104+): ServerProviderRateLimit {105+ if (106+ previous !== undefined &&107+ next.status !== "rejected" &&108+ isProviderRateLimitActive(previous, nowMs) &&109+ previous.resetsAt !== undefined &&110+ next.resetsAt !== previous.resetsAt111+ ) {112+ return previous;113+ }114+ return next;115+}apps/server/src/orchestration/Layers/OrchestrationReactor.ts line 10OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -7,3 +7,4 @@77 } from "../Services/OrchestrationReactor.ts";88 import { CheckpointReactor } from "../Services/CheckpointReactor.ts";99 import { ProviderCommandReactor } from "../Services/ProviderCommandReactor.ts";10+import { ProviderRateLimitReactor } from "../ProviderRateLimitReactor.ts";
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed
The new
Posted via Macroscope — Effect Service ConventionsProviderRateLimitReactorservice is defined in the legacyServices/+Layers/split with a standaloneShapeinterface and a...Livelayer export. New services should follow the canonical single-module layout already used by e.g.apps/server/src/orchestration/ThreadSettlementReactor.ts(tag with inline interface, exportedmake,export const layer). Individual findings are inline.