refactor(core): bind standalone skill activation to Session - #46077
Merged
Conversation
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.
Why
Standalone skill activation still lives in the public Session service after
prompts and controls moved into ID-bound handles. It therefore cannot
be used through a retained Session handle with the same captured host services
and current-placement lookup as prompts and controls.
What Changes
Move the existing activation operation into the lower Session factory and make
the public service delegate to it. A retained handle resolves the Session's
current Location each time it runs, including after movement.
The standalone contract remains distinct from prompt-attached skills:
SkillNotFoundError, without recording or schedulingSessionEvent.Skill.Activatedimmediately with raw registered skill contentresume: trueresume: falseStandalone activation still does not become prompt admission. The change does
not add prompt preparation, inbox delivery, or a different scheduling policy.
Scope
This is the standalone skill ownership follow-up to #46019. It is independent of
the projected-read cleanup in #46075 and intentionally does not change skill readiness or
model-facing formatting.
Verification
Initial validation at
135fe3bd97:Focused Core: 110 passed, 0 failed, 455 assertions across six files, including
detached handles, movement, ambient event context, validation order, and host-owned
resume lifetime. SDK: 26 passed, 0 failed. Server: 45 passed, 3 skipped,
0 failed. All three package typechecks and all 33 pre-push typecheck tasks
passed at
135fe3bd97.Full Core: 3,977 passed, 40 skipped, 0 failed, 79,563 assertions across 225
files (191.25 seconds).
Three simplify passes reviewed the complete diff for reuse, quality, and
efficiency. No changes were warranted; the implementation retains the established
native binding and structural pass-through patterns. Formatting, both Effect AST
scans, and diff checks passed. Oxlint reported zero errors and four pre-existing
warnings, including one on the relocated implementation.
After integrating
v2at171947787c, including the confirmed test-race fix in#46083, the focused Core suite again passed 110/110 and all 33 pre-push
typecheck tasks passed at
8c55494b11. The refactor diff is byte-identical tothe reviewed version; only its base changed.
A final reuse, quality, and efficiency review led to a test-only simplification
in
009477ebcd: an uncompletedDeferredbecameEffect.never, preservingall ordering and host-shutdown assertions. No production changes were needed.
After that edit, the focused suite passed 110/110 again (455 assertions),
Core
bun typecheckpassed, and Prettier andgit diff --checkpassed.All 33 pre-push typecheck tasks also passed for the final commit.