Repository navigation
fix(runtime): refuse turns and sessions while a bot is clearing - #156
Merged
juancguerrerodev merged 2 commits intoNov 28, 2026
Merged
juancguerrerodev merged 2 commits into
juancguerrerodev merged 2 commits into
Conversation
…ocales Signed-off-by: Santino Fuentes <santinofuentesAI@users.noreply.github.com>
…CodingLabs#108) Signed-off-by: Santino Fuentes <santinofuentesAI@users.noreply.github.com>
juancguerrerodev
force-pushed
the
fix/bot-clearing-race
branch
from
November 28, 2026 23:25
a01fde8 to
6b37497
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 and why
Closes #108
Closes the concurrency gap between checking
busy/runningand completing SQLCipher deletes inbots.remove,bots.reset, andclearConversation.clearingstate inpackages/runtime/src/hermit.tsand exposessetClearingthroughBotsApiDeps(packages/runtime/src/bots.ts), set synchronously before anyawaitand cleared infinally(errors included).inTurn,startSession, andresumeSessionwhile a bot is clearing; a refusedsend()returns code's words usingHM-BOT-02.clearing(packages/copy/locales/en.jsonandes-419.json), preventing orphanchat_turnsrows or foreign-key failures.packages/runtime/test/bots.test.tscoveringbots.reset,bots.remove, andclearConversation.Vision fit
Serves Principle 7 ("Small, typed and tested") and Principle 5 ("Spanish and English, first-class": adds matching
HM-BOT-02.clearingcopy in bothes-419anden), keeping local encrypted state consistent under concurrent turns.Non-negotiables
Checklist
acceptedproposal.FOREIGN KEY constraint failedduringbots.removeand missing refusal copy duringbots.reset/clearConversationbefore the fix.)pnpm check:privacy,pnpm typecheck,pnpm lint,pnpm testandnode scripts/guard/check.mjs --base origin/main --patterns scripts/guard/patterns.txt.packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes.Model path
packages/model,agent,skillsoreval, the prompt, the router, tool descriptions, normalizers, examples or the model file.Screenshots
New dependencies and network calls
n/a
AI agents
packages/runtimeandpackages/copy, ran all five gates againstorigin/main(6f0d47e), and drafted this PR description.