Repository navigation
Conversation
…er crash it `flush` wrote to the journal after awaiting the other machine's answer, with no check that the host or journal had closed meanwhile, and the timer fired it with `void`. A core stopping while bot events were in flight threw "Cannot use a closed database" as an unhandled rejection, which the core treats as fatal. The flush now stops once the host or journal is gone, and the timer logs any failure instead of leaving it unhandled.
|
This stops waiting bot-event deliveries from crashing a core that is shutting down. The pending delivery used to write to the journal after it was closed, raising an unhandled error. Late deliveries are now skipped and timer failures are logged instead. No comments posted: the reviewers raised no finding. Review details
|
HelasaZ
force-pushed
the
fix/group-host-flush
branch
from
November 11, 2026 15:08
47770d1 to
96abacb
Compare
1 of 8 tasks
klNuno
enabled auto-merge
November 11, 2026 16:36
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 11, 2026
1 of 6 tasks
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 11, 2026
This branch has not been deployed
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.
Kind of change
What changed
GroupBotHost.flushawaits the other machine'sbot.eventanswer, then writes to the journal (#drop,outbox) without checking whether the host or the journal closed meanwhile, and the timer calls it withvoid this.flush(...). A core stopping while bot events were in flight threwRangeError: Cannot use a closed databaseas an unhandled rejection, which the core treats as fatal.catch,flushreturns once the host is closed or the journal is gone.Verification
agents-group.test.ts: pc'sbot.eventrequest is held, pc stops, then the request returns. It fails onmainwithRangeError: Cannot use a closed databaseand passes with this change.bun test packages/core/test/agents-group.test.ts: 14 pass, 0 fail.bun run --cwd packages/core check: clean.Affected paths
Tick what this change touches and was checked on. Leave the rest empty.
lib/fake-client.tspackages/contracts/src/