mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-17 12:22:34 +03:00
fix(sse): widen the Antigravity lease reservation result so auth.ts narrows it
The discriminated-union form of reserveAntigravityLeaseForSelection's return type did not narrow under tsconfig.typecheck-api.json, so reading `reserved.lease` after the `reserved.busy` early return raised TS2339 in the API Route Typecheck gate. A single optional-property shape carries the same information and type-checks everywhere. Co-authored-by: Ardem2025 <openclaw-auto@example.invalid>
This commit is contained in:
@@ -25,7 +25,7 @@ export function reserveAntigravityLeaseForSelection(
|
||||
connection: { id: string } | null | undefined,
|
||||
requestedModel: string | null | undefined,
|
||||
options: { reserveAntigravityLease?: boolean; routingRequestId?: string | null }
|
||||
): { busy: AntigravityLeaseUnavailable } | { busy?: undefined; lease?: AntigravityLease } {
|
||||
): { busy?: AntigravityLeaseUnavailable; lease?: AntigravityLease } {
|
||||
if (provider !== "antigravity" || !connection || options.reserveAntigravityLease !== true)
|
||||
return {};
|
||||
const acquired = tryAcquireAntigravityLease({
|
||||
|
||||
Reference in New Issue
Block a user