Repository navigation
Conversation
`proxyContext` gives Core `timeout_ms + 1000`, and every client helper fills
the omitted budget up to `HOST_CONTEXT_TIMEOUT_MS` (8s), so a normal /context
round trip is allowed to run for nine seconds. The suite kept vitest's 5s
default, so a loaded runner could fail a passing assertion: run 44341072396
lost "does not pass a legacy-shaped context response through" and "rejects
invalid request {"query":"x","limit":true}" to 5000ms timeouts with no broker
fault, and a re-run of the same commit is green.
The timeout also dragged in a misleading second failure. `broker.stop()`
writes the "stopped" discovery on the way out, so a file can land between
`rm()`'s readdir and its rmdir; the race surfaced as ENOTEMPTY and vitest
reported it against the test that had just failed, hiding the timeout.
Size the file's budget from the protocol constant and let `rm()` retry the
race instead of throwing. No production code changes.
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
Two lines in
memhub/packages/host-bridge/src/context-integration.test.ts:HOST_CONTEXT_TIMEOUT_MSinstead of vitest's 5s default;rm()instead of throwingENOTEMPTY.No production code changes.
Why
The suite's budget is below the budget it exercises.
proxyContextgives Coretimeout_ms + 1000, andcontextThroughBroker/McpSessionfill an omittedtimeout_msup toHOST_CONTEXT_TIMEOUT_MS(8s) — so a legitimate/contextround trip is allowed to take nine seconds while the test that drives it is killed at five.On 2026-11-18 that showed up on
main(d8138b5, run 44341072396):Both cases are a
fixture()plus onepost(); neither depends on timing, and re-running the same commit is green, so the runner was simply slow enough that the fixture's three writes and two listens no longer fit in 5s. Thememhubjob has been re-run green several times since (e.g. #503, #504), which is what makes this a budget problem rather than a behaviour problem.The timeout then produced a second, misleading failure.
RecallBroker.stop()writes thestoppeddiscovery on its way out, so a file can land betweenrm()'sreaddirand itsrmdir:vitest reports that against the test that just failed, so the log shows two failures where there was one, and the visible error (
ENOTEMPTY) is not the real one (the timeout).maxRetries/retryDelayare the documented remedy for exactly this race.Verification
In a Linux checkout (the fixture requires POSIX grant storage):
pnpm --filter @one-memory/host-bridge typecheck— cleanvitest run src/context-integration.test.ts --maxWorkers=1— 91/91 passedvitest run --maxWorkers=1— greenbiome checkon the file (LF) — clean