MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / reserve

Method reserve

uncommon_route/proxy.py:222–228  ·  view source on GitHub ↗
(self, reservation_id: str, estimated_cost: float)

Source from the content-addressed store, hash-verified

220 return total
221
222 async def reserve(self, reservation_id: str, estimated_cost: float):
223 async with self._lock:
224 pending_total = self._gc(time.time())
225 result = self._spend.check(estimated_cost, additional_committed=pending_total)
226 if result.allowed:
227 self._pending[reservation_id] = (estimated_cost, time.time())
228 return result
229
230 async def update_reserve(self, reservation_id: str, estimated_cost: float):
231 """Re-reserve a request under a new estimated cost (e.g. fallback model)."""

Callers 1

_handle_chat_coreFunction · 0.80

Calls 2

_gcMethod · 0.95
checkMethod · 0.80

Tested by

no test coverage detected