Skip to content

refactor(core): bind standalone skill activation to Session - #46077

Merged
kitlangton merged 3 commits into
v2from
session-skill-activation
Aug 30, 2026
Merged

refactor(core): bind standalone skill activation to Session#46077
kitlangton merged 3 commits into
v2from
session-skill-activation

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

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:

Activation Preserved behavior
Missing Session Fail before acquiring Location services
Missing skill SkillNotFoundError, without recording or scheduling
Successful activation Record SessionEvent.Skill.Activated immediately with raw registered skill content
Supplied message ID Preserve the existing message-to-event ID mapping
Default / resume: true Start the existing detached resume in the host Scope after recording
resume: false Record only

Standalone 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:

# packages/core
bun typecheck
bun run test test/session-owned.test.ts test/session-skill.test.ts test/session-prompt.test.ts test/session-prompt-hooks.test.ts test/session-run-coordinator.test.ts test/bus-session-routing.test.ts
bun run test

# packages/sdk
bun typecheck
OPENCODE_DISABLE_MODELS_FETCH=true bun run ../core/script/test.ts

# packages/server
bun typecheck
bun run ../core/script/test.ts

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 v2 at 171947787c, 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 to
the reviewed version; only its base changed.

A final reuse, quality, and efficiency review led to a test-only simplification
in 009477ebcd: an uncompleted Deferred became Effect.never, preserving
all ordering and host-shutdown assertions. No production changes were needed.
After that edit, the focused suite passed 110/110 again (455 assertions),
Core bun typecheck passed, and Prettier and git diff --check passed.
All 33 pre-push typecheck tasks also passed for the final commit.

@kitlangton
kitlangton merged commit 4a977b2 into v2 Aug 30, 2026
14 of 15 checks passed
@kitlangton
kitlangton deleted the session-skill-activation branch August 30, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant