Uh oh!
There was an error while loading. Please reload this page.
fix(headless): measure the wire the Maka runtime actually dials - #2286
Merged
Conversation
The provider proxy inferred its usage protocol from the adapter kind, so every `openai-compatible` provider was parsed as Chat SSE. That inference silently went wrong when deepseek-v4-flash moved to the Responses API: the proxy never saw `data: [DONE]`, recorded all 20 requests of a cell as `interrupted` with zero usage and no reasoning tokens, and the runner's terminal-request check then threw the whole graded cell away as an infra failure -- a cell that had in fact passed with reward 1.0. The Maka arm runs the Maka runtime, so `resolveModelRuntime` is the authority on which wire it dials; ask it instead of guessing. Competitors run their own CLI and keep the adapter-kind path, which is what describes them. The A/B manifest's per-arm transport comes from the same call, so a run now records the protocol it measured rather than the one it assumed. Verified on the 5-task pilot the guess had been failing.
…s them
The retry allowlist spelled `ab-${arm}-r0-${task.id}` by hand while
`buildAbRoundId` normalizes `.` to `-`, so a retry naming a dotted task
never matched. Because the check throws instead of skipping, one such
task took the whole batch down: a rerun of three infra-failed cells
exited in twelve seconds without running any of them.…er spells the model Review found the fix's own API could re-admit the bug it closes: the model id was prefix-sensitive and optional, so a caller passing the catalog spelling `deepseek/deepseek-v4-flash` — which `resolveModelRuntime` does not recognize — silently got the Chat guess back, and a caller passing nothing at all got it too. Normalize inside the function and refuse to guess for the maka arm, which deletes the caller-side discipline at both runners rather than testing it. Also report every unknown retry round id at once.
… will build The proxy asked the runtime which wire it would dial, but asked about a connection the runtime never builds: an advertised protocol only reaches a model entry for GitHub Copilot and the Kimi Coding Plan, and `connectionFromEnv` drops it everywhere else. With MAKA_MODEL_API_PROTOCOL=openai-chat set against DeepSeek, the proxy resolved Chat SSE while the runtime dialled Responses — the wrong-wire failure this path exists to remove, readmitted through its own input. The gating rule is now one exported function that both sides read, and the test that pinned the divergent answer asserts the runtime's.
The proxy path parsed the three protocol names with its own copy of the check `provider-env` already owned, next to the gating rule it just started sharing with it. Two copies of a value whitelist is how one of them ends up accepting a name the other rejects.
Astro-Han
marked this pull request as ready for review
August 6, 2026 06:07
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Summary
Two independent measurement bugs in the harness, both surfaced by the #2245 two-arm rerun.
1. The proxy measured a wire the Maka arm was not dialing. The provider proxy inferred its usage protocol from
runtimeAdapter.kind, so everyopenai-compatibleprovider was parsed as Chat SSE. That inference went silently wrong when #2152 moveddeepseek-v4-flashto the Responses API: the proxy never sawdata: [DONE], recorded every request asinterruptedwith zero usage and no reasoning tokens, andincompleteTerminalProviderRequestthen threw the whole graded cell away as an infra failure — cells that had in fact passed with reward 1.0.The Maka arm runs the Maka runtime, so
resolveModelRuntimeis the authority on which wire it dials; ask it instead of guessing. Competitors run their own CLI and keep the adapter-kind path, which is what describes them. The A/B manifest's per-arm transport comes from the same call, so a run now records the protocol it measured rather than the one it assumed — the frozen three-way composition test assertedopenai-chatfor the Maka arm, describing a run that never happened.packages/runtimegains a./model-runtimeexport so the harness can reach the resolver.2. The infra-retry allowlist could not name a dotted task.
executeHarnessArmCohortspelled candidate round ids asab-${arm}-r0-${task.id}by hand, whilebuildAbRoundId— the helper that actually writes them — normalizes.to-. A retry naminginstall-windows-3.11was therefore rejected as unknown, and because the check throws rather than skips, that one task took the whole batch down with it: a rerun of three infra-failed cells exited in twelve seconds having run none of them, twice. Building the candidates with the same helper removes the second spelling.Refs #2245.
Verification
npm run -w @maka/headless test— 1424 pass / 0 fail.npm run -w @maka/runtime test— 3270 pass / 0 fail.npm run lintandnpm run formatclean.The dotted-retry regression test was verified red before the fix (
adjudicated infra retry names unknown round ab-maka-r0-install-windows-3-11) and green after.Reproduced (1) against the live 5-task Terminal-Bench 2.1 pilot on
deepseek-v4-flash(the same seed order as the 2026-08-04 four-arm run, socount-dataset-tokensis the same cell in all three columns):/chat/completions· chat-sse/responses· chat-sse/responses· responses-sseA second pilot cell (
regex-log) is likewise 15/15 completed with 17058 reasoning tokens measured.The full 89-task two-arm run then completed on this branch: 3479 Maka requests over 89 cells with 9 non-completed, versus every request non-completed before the fix.
Root cause
Not #2241/#2249.
fc581d855(#2152, provider-native web search) addeddeepseek-v4-flash → openai-responsestoopenAiAdapterApiProtocol. The 2026-08-04 benchmark ran on9dae4bee, which predates it and therefore dialled Chat Completions; the wire changed under a harness that kept guessing the old one.Review round 2
Review found the fix's own API could re-admit the bug it closes.
providerProxyUsageProtocoltook the model id as an optional, prefix-sensitive argument, and the two call sites applied the discipline while the manifest call did not.resolveModelRuntimedoes not recognize the catalog spellingdeepseek/deepseek-v4-flash, so a caller forwarding it raw silently got the Chat guess back — the exact wrong number this PR exists to remove — and a caller passing nothing at all got it too, with TypeScript unable to say so.The function now normalizes the id itself and refuses to guess for the maka arm. That deletes the caller-side discipline at both runners rather than testing it: there is no longer a spelling a call site can get wrong. Two assertions pin it, including the
assert.throwsfor a missing id.Unknown retry round ids are also now reported together, so an operator recovering a sweep with a batch of ids fixes every typo in one pass.