Carry the detector bundle's keyMap through the pool push - #3325
Merged
Merged
Conversation
`keyMap` is an opaque per-bundle decode parameter written alongside each bundle by the pool build, on the same contract as `payloadLayout`. The admin pool-replace body schema never declared it, so zod stripped it from every push, and persistDetectorBundlePool then wrote the bundle back to disk without it. The result was a pool the provider served but could not decode: the push returned success with persisted: true, bundles loaded, sessions were assigned them, and what they produced could not be read. Pools copied onto the volume were unaffected — that path never goes through the schema, which is why this survived staging. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
forgetso
force-pushed
the
fix/detector-pool-push-keymap
branch
from
September 22, 2026 19:01
b27b188 to
55acd30
Compare
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.
What was broken
keyMapis an opaque per-bundle decode parameter. The pool build writes one alongside each bundle, and it is meaningless without that bundle — the same contract aspayloadLayout.The HTTP pool-push route never accepted it. Its body schema didn't list
keyMap, and zod quietly deletes anything not listed, so it was thrown away on every push. The code that writes the bundle back to disk then left it out too.What effect it had
A pool the provider served and could not decode. The push said it worked (
persisted: true), the bundles loaded, sessions were assigned them — and what they produced could not be read. Nothing logged an error.This hit production earlier today, and the affected data went to zero the moment the pool was pushed, staying there until the pool was copied over SSH instead.
Pools copied straight onto the disk volume were always fine, because that path doesn't go through the schema. That is why this was never caught before — it only breaks the HTTP route.
What changed
keyMapadded toReplaceDetectorPoolBody, so the route stops discarding it.persistDetectorBundlePoolnow writes it back to disk, so it survives a restart.Test coverage
New test in
bundlePool.test.tsputs a bundle carrying the parameter through load → persist → reload and checks it is still there. Confirmed it fails without the fix and passes with it. Full file: 18 tests, all passing.Pairs with a fix in captcha-private, where the push script had to be taught to send the field in the first place.
🤖 Generated with Claude Code