fix(vm): propagate ANON/waif/primitive type into caller variable#19
Open
daiverd wants to merge 1 commit into
Open
fix(vm): propagate ANON/waif/primitive type into caller variable#19daiverd wants to merge 1 commit into
daiverd wants to merge 1 commit into
Conversation
When a verb call is made from a frame whose `this` is an anonymous object (or waif/primitive), the `caller` variable in the called verb must carry the same value type — not a plain OBJ wrapping the same ObjID. Without this fix, verbs that test `caller == this` where `this` is ANON always fail: OBJ(-X) != ANON(-X) because the type tags differ. This broke the MCP session chain in databases like chatmud.db where #103:send guards with `caller == this`. The guard raised E_PERM, the session create failed silently, and `out_of_band_session` was never set, ultimately causing E_INVIND in `@edit` when the nil session was called as an object. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
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
thisis an anonymous object (or waif/primitive), thecallervariable in the called verb was set as plainOBJwrapping the same ObjID — causingcaller == thisto always return false (OBJ ≠ ANON even at the same ID).thiscarries a non-NoneThisValue(ANON/waif/primitive), propagate that value directly intocallerinstead of wrapping the bare ObjID as OBJ.#103:sendguards withcaller == thison an anonymous MCP session object. The mismatch raised E_PERM, silently aborting session creation, leavingplayer.out_of_band_sessionunset, and ultimately causing E_INVIND in@edit.Test plan
moo-conformance-tests(anonymous::caller_type_is_anon_inside_anonymous,anonymous::caller_equals_this_inside_anonymous) — both fail on unpatched barn, both pass on Toast and on this branch🤖 Generated with Claude Code