Repository navigation
Isolate SPAWN_AGENT body EXIT on -run-bc - #109
Merged
Merged
Conversation
Post-#102 swarm slice: stop re-panicking VmExit from SPAWN_AGENT child bodies so parent/siblings continue. Emit one EXIT diagnostic with the child exit code, set failed, skip completion. LIMIT_EXCEEDED still propagates. Regression tests: body/nested exit isolated.
howlcipher
commented
Oct 6, 2026
howlcipher
left a comment
Owner
Author
There was a problem hiding this comment.
Motoko COMMENT on head 47a461abdee36a458382bd351aa86af1aebf1607 (base 6502d615).
Verdict: merge-ready once CI build is green. Diff matches the claimed leftover after #102: stop re-panicking VmExit from SPAWN_AGENT child recovery so parent/siblings continue.
Checked
OpSpawnAgentrecoverswitch e := r.(type):case VmExitnow emits ErrOut diagnostic withe.code(field exists onVmExit), sets existingfailed, skips completion line — same shape asVmReturn.LIMIT_EXCEEDEDstill re-panics; ordinary*VMError/ default isolation unchanged; stack truncate +executedaccounting still before the switch.- Tests:
body exit isolatedandnested exit isolatedparallel the RETURN cases (exit 7, parent continues, exit 0, no RuntimeFailure, no completion for failed child). - Scope: one-line VM change + tests + journal/changelog. Hard nos intact: no prod
-compile-bc/ HFIR flip, tip-lock untouched, no DOM, #90 Partial, no C1/C2/C4/harness.
Non-blocker: older change_log.md RETURN bullet still says “VmExit and limits still propagate”; the new EXIT bullet supersedes the VmExit half. Harmless historical wording — optional one-line tidy later.
Draft left draft. Okabe: undraft + squash-merge when CI is green.
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.
Summary
Post-#102 swarm slice (Owner option: isolate): isolate
VmExitfrom inside aSPAWN_AGENTtask body on the independent-run-bcbytecode path so a bareexitis a child failure instead of escaping and aborting the parent run.OpSpawnAgentre-panickedVmExit(case VmExit: panic(r)), which reached the top-level runner and became the process exit code (e.g. exit 7), with no child diagnostic and no parent continuation.VmExit. Emit one ErrOut diagnostic —[Swarm VM] Agent "Name" failed task: "desc": EXIT: exit N from spawn agent body— set the existingfailedflag, skip that agent's completion line, restore parent stack / sharedexecutedaccounting as before, and let the parent/siblings continue (exit 0).LIMIT_EXCEEDED(budget + depth), parentSPAWN_AGENTprocessgate, and non-string taskTYPE_ERROR. Ordinary child*VMErrorisolation from Isolate nested SPAWN_AGENT child failures on -run-bc #101 andVmReturnisolation from Isolate SPAWN_AGENT body RETURN on -run-bc #102 are unchanged.CALLstill recovers normal function returns inside a spawn body.body exit isolated(parent print after exit 7) andnested exit isolated(inner exit; outer prints and completes). Existing nesting/isolation/RETURN cases remain.Constraints honored
-compile-bc→ HFIR flip4d74dbcfnot retakenVerification
gofmt -l internal/vm/vm.go internal/vm/spawn_agent_test.go(empty),git diff --checkgo vet ./internal/vm/ ./internal/bytecode/ ./examples/ .go build ./...go test ./internal/vm/ -count=1 -run 'TestVMTaskAndSpawnAgent|SpawnAgent'go test ./... -count=1(full suite green)Journal
docs/journals/2026-10-05_spawn_agent_exit_isolation.mdBase tip:
6502d615ef40025d3e4bdc9240a4cf54927fc6af(#108)