Skip to content

feat(skills): execute session-scoped command hooks - #3251

Merged
nonoqing merged 1 commit into
mainfrom
codex/skill-scan-diagnostics
Sep 29, 2026
Merged

nonoqing merged 1 commit into
mainfrom
codex/skill-scan-diagnostics

Conversation

@nonoqing

Copy link
Copy Markdown
Collaborator

Summary

Claude-format skills with command hooks were rejected as invalid during discovery. Invoking a supported skill now activates its command hooks in the existing session Hook engine, and the UI distinguishes unsupported capabilities from actual scan failures.

Type and Areas

Type: Feature / bug fix

Areas: Rust Agent Runtime, Core skill/tool/permission/session owners, Desktop skill DTO, Web UI diagnostics, locales, docs, Cargo boundary contracts.

Motivation / Impact

  • Register hooks only on skill invocation, isolate them by session/workspace, preserve idempotence and once, and cancel/remove them during session teardown.
  • Match Claude Bash hooks to ExecCommand, translate Bash/Write inputs and updatedInput, and retain original-input constraints and permission denials. Hook ask requires a fresh reply through the existing permission mailbox, including in bypass mode.
  • Make skill activation a preflight barrier so later tools in the same model response see the new hooks. Unknown execution semantics reject the entire skill.
  • Keep discovery/import passive and retain imported Claude dialects. Split unsupported-capability notices from missing-file/format errors in both skill surfaces.

Verification

270 focused Rust tests passed (Core pipeline 52, Core hooks 19, Core skills/imports 82, interaction contracts 47, process contracts 29, skill contracts 41):

cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git,external-sources --lib agentic::tools::pipeline::tool_pipeline::tests
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git,external-sources --lib native_hooks
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git,external-sources --lib agentic::tools::implementations::skill
cargo test --locked -p openbitfun-agent-runtime --no-default-features --features agent-runtime --test native_hook_execution_contracts --test agent_interaction_contracts
cargo test --locked -p openbitfun-agent-runtime --no-default-features --features agent-runtime --test agent_definition_contracts skill
cargo check --locked -p openbitfun-agent-runtime --no-default-features --features definition-contracts

After integrating current upstream/main, these also passed:

pnpm --dir src/web-ui run test:run src/app/scenes/skills/hooks/useInstalledSkills.test.tsx src/flow_chat/components/ChatContextPickerOverlay.test.tsx src/infrastructure/api/service-api/ConfigAPI.test.ts
pnpm run check:web
pnpm run i18n:audit
pnpm run check:core-boundaries
node scripts/check-git-object-sizes.mjs --base upstream/main --head HEAD

The three frontend files passed 43 tests; i18n reported zero warnings. The architecture checker regression suite also passed 148 tests.

Reviewer Notes

AI-assisted implementation with focused automated testing. No packaged-app UI capture or full multi-device E2E was performed. Local execution and remote-workspace rejection are covered; Remote Control, Peer Device, and Detached Dispatch E2E remain unverified.

Only synchronous command handlers and the engine's existing lifecycle events are supported. Project skills require the project-hook gate. Registrations are process-local and must be reactivated after a runtime restart. SSH/remote-workspace activation fails explicitly without running commands on the controller. Native hooks.json retains its existing Codex decision contract.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@nonoqing
nonoqing merged commit 4e51019 into main Sep 29, 2026
13 checks passed
@nonoqing
nonoqing deleted the codex/skill-scan-diagnostics branch September 29, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant