nemo_gym.agents.utils.verify_call
nemo_gym.agents.utils.verify_call
An agent’s verify call, with a bounded retry of a verify call lost in transport.
A verify call whose reply was lost (the body cut off mid-read, the peer dropped the connection, a timeout) has no
verdict, and an agent that masks its row then keeps a completed answer ungraded. The call is tried again, up to
VERIFY_CALL_MAX_ATTEMPTS attempts with the judge call’s full-jitter backoff, before the failure reaches the agent.
A verify request that may have been delivered is sent again only to a verifier that reports itself STATELESS
(GET /reverify_mode): grading the same saved answer again is then safe. An HTTP reply (any status) is the
verifier’s own answer and is never retried here.
Module Contents
Functions
Data
API
Full-jitter exponential backoff after failed attempt attempt (1-based), as a judge call waits.
Whether the verifier reports STATELESS; a verifier that cannot say is not resent a delivered request.
Whether a failed verify call lost its reply in transport, so another attempt can succeed.
answer (the verify request, with the generated response) as a masked zero for a verify call that failed.
Return this from /run instead of raising: the HTTP boundary would drop the generated answer, and a resume
would generate again. The typed failure is the one verify_with_transport_retry raised.
A verifier that replied with a server error or a rate limit could not grade the answer: the row is a
judge_failed mask, which recovery grades again from the saved answer with /verify only. A call lost in
transport keeps its agent_route_failed kind, which recovery selects too. A verifier that cannot grade one saved
answer alone (regradable=False, a verifier that grades only full batches) keeps agent_route_failed for
every cause, so recovery does not claim it can settle the row.
The agent boundary’s failure of one verify attempt, caused by error; agent_route_failure for verify with
the attempt named, so a retried call keeps every attempt as an observation.
Await call (one verify request and its parsed reply), retrying a reply lost in transport.
Every failed attempt is observed as its own agent_route_failed event of operation verify (one
operation_id per call, the attempt in attempt_id). A transport failure is tried again, up to
VERIFY_CALL_MAX_ATTEMPTS attempts, only against a STATELESS verifier. The last failure is raised as that
event, from its cause; any other failure is raised the same way at once.
Attempts of one verify call (the first one included) before its transport failure reaches the agent.