Skip to content

fix(ocap-kernel): keep a queued send's result when its sender is terminated - #1325

Open
sirtimid wants to merge 2 commits into
mainfrom
sirtimid/clear-send-result-decider
Open

sirtimid wants to merge 2 commits into
mainfrom
sirtimid/clear-send-result-decider

Conversation

@sirtimid

@sirtimid sirtimid commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Terminating a vat, or giving up on a peer, while one of its messages was still queued rejected that message's result. The receiver was then terminated when it answered, and the run loop died.

A queued message's result now has no decider until it is delivered, as in SwingSet, so the sender's death leaves it alone. A send that names a result the sender does not decide is refused (#1276's third item).

Tested with a real kernel: a terminateVat queued ahead of a vat's send killed the run loop before, and now the receiver answers.

Known gaps: a refused send rarely terminates the vat (#1165), a peer's refused message is not acknowledged (#1326), a send to its own result is never settled (#1327), and a restarted vat can reuse a promise ID (#1328).

Closes #1324
Refs #1276

🤖 Generated with Claude Code

sirtimid and others added 2 commits November 24, 2026 18:34
A send's result kept its sender as decider until delivery, so terminating
the sender rejected it, the receiver was terminated at its resolve, and
the run loop died. As SwingSet does, the translation now checks that the
result is the sender's to give and clears its decider.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 75.63%
⬆️ +0.02%
11240 / 14861
🔵 Statements 75.36%
⬆️ +0.01%
11403 / 15130
🔵 Functions 74.71%
🟰 ±0%
2657 / 3556
🔵 Branches 71.81%
⬆️ +0.05%
4958 / 6904
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/ocap-kernel/src/KernelRouter.ts 96.01%
🟰 ±0%
88.59%
🟰 ±0%
100%
🟰 ±0%
96.01%
🟰 ±0%
196, 258, 275, 377, 432, 539, 564, 567
packages/ocap-kernel/src/store/methods/promise.ts 100%
🟰 ±0%
95.23%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ocap-kernel/src/store/methods/translators.ts 98.59%
⬆️ +0.11%
97.36%
⬆️ +0.70%
100%
🟰 ±0%
98.59%
⬆️ +0.11%
163
Generated in workflow #5911 for commit b2baad3 by the Vitest Coverage Report Action

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminating a vat with a send still queued gets the receiver terminated and kills the run loop

1 participant