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:
diegosouzapw
2026-09-16 21:22:55 -03:00
parent 0321bc8e2e
commit f288786fff

View File

@@ -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({