feat(swe-bench): gate dispatch on endpoint readiness - #484
Open
leopck wants to merge 6 commits into
Open
Conversation
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
leopck
force-pushed
the
swe-dist-5-predispatch-gates
branch
from
August 27, 2026 15:25
8fb1c98 to
fcd012a
Compare
leopck
force-pushed
the
swe-dist-5-predispatch-gates
branch
from
August 27, 2026 15:31
fcd012a to
a7013e0
Compare
leopck
force-pushed
the
swe-dist-5-predispatch-gates
branch
from
August 27, 2026 15:52
a7013e0 to
3bc0f3d
Compare
A run against a remote engine with no endpoint credential makes zero
progress and never ends.
`SweBenchRunner._base_env()` auto-filled `OPENAI_API_KEY="EMPTY"` only when
the endpoint hostname was `localhost`, `127.0.0.1` or `::1`. For any other
host with `endpoint_api_key` unset it did the opposite: it *removed* the
variable. litellm then refuses to build the request locally --
litellm.AuthenticationError: Missing credentials
-- mini-swe-agent classifies that as transient and retries it every 60s,
forever. Not one request reaches the engine, nothing is logged at ERROR,
the agent processes stay alive, and the run neither progresses nor
terminates. Observed on a 20-node run against a remote GB300 engine: 200
workers, 0 requests served, no failure surfaced.
The hostname gate is the defect. An unauthenticated OpenAI-compatible
server ignores the credential value whether it is reached over loopback or
over the network, so the placeholder is correct in both cases and the
distinction only ever suppressed it where it was needed most.
Replace the pop with the placeholder. The security property that motivated
the pop is kept and made explicit: an ambient `OPENAI_API_KEY` inherited
from the service host is still never forwarded to the endpoint -- it is
overwritten rather than deleted.
Tests: `test_base_env_always_supplies_a_credential_placeholder` covers
loopback and remote hosts; the existing
`test_base_env_supplies_api_key_only_to_agent_subprocess` encoded the old
behaviour and is corrected to assert the placeholder while still proving a
configured key wins and an ambient key never leaks.
run_gates() calls assert_scale() before check() and treats GateScaleError as a gate FAILURE, never a skip. This is the code-level form of the most expensive lesson available: a tool-call gate that exercised the right operation at a 278-token prompt passed, while prompts over 2k tokens silently returned empty, and the run scored 0/80. - CheckpointIdentityGate probes /get_model_info then /v1/models and compares the served model path with == , never startswith or in: the bf16 path is a strict prefix of the fp8 path, so any substring test passes an FP8 engine as bf16. Unidentifiable or ambiguous endpoints fail closed. - ToolCallGate requires a well-formed bash tool call at a prompt of at least min_prompt_tokens measured with the server's own /tokenize, not estimated from characters. No tokenizer means the gate cannot prove its scale, so it fails. - EndpointFingerprintGate records a per-endpoint identity the dispatcher re-checks at publish time, so an engine restarted under a live client cannot yield a 0%-accuracy run that still exits rc=0.
EndpointFingerprintGate hashed the whole /v1/models payload. vLLM stamps that response with a request-time `created` field and mints a fresh `permission[].id` on every call, so two reads of one healthy, untouched engine produce two different fingerprints -- four calls, four values. The dispatcher records a fingerprint when a unit is claimed and re-reads it when the unit is published, and treats any difference as `endpoint_changed`: an infrastructure fault, which requeues the unit. With an unstable fingerprint that comparison is always true, so every unit is retried until it exhausts max_attempts, is published as abandoned, and the merge gate refuses the run. The failure costs the full agent and evaluation time of every attempt first, and reports itself as infrastructure damage rather than as a bug here. Hash only the identity-bearing fields by dropping the per-request ones. The gate still fails closed on an endpoint whose identity cannot be read at all, which is the property it exists to provide.
leopck
force-pushed
the
swe-dist-5-predispatch-gates
branch
from
August 27, 2026 15:58
3bc0f3d to
ad7777c
Compare
leopck
marked this pull request as ready for review
August 27, 2026 19:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds fail-closed pre-dispatch checks for checkpoint identity, scaled tool calling, and stable endpoint fingerprints.
Fleet execution begins only after the configured inference endpoints prove they are ready for the requested SWE-bench workload.