Skip to content

fix: load workspace skills before building system prompt#1

Open
AL-ZiLLA wants to merge 7 commits intomainfrom
fix/skill-loading
Open

fix: load workspace skills before building system prompt#1
AL-ZiLLA wants to merge 7 commits intomainfrom
fix/skill-loading

Conversation

@AL-ZiLLA
Copy link
Owner

@AL-ZiLLA AL-ZiLLA commented Mar 2, 2026

Summary

  • Workspace-scoped skills (e.g. sidecar-api in Rex's workspace) were never injected into agent system prompts
  • Root cause: build_skill_summary() and collect_prompt_context() read from the global skill registry, which doesn't include workspace skills. The workspace skill snapshot was created after the prompt was already built
  • Fix: create the workspace-aware skill snapshot before building the prompt, and use new _from_registry() static methods that accept the snapshot directly
  • Both streaming and non-streaming message paths in kernel.rs had the same bug

Test plan

  • cargo build --workspace --lib — compiles clean
  • cargo test --workspace — 1830+ tests pass, 0 failures
  • cargo clippy -p openfang-kernel --all-targets -- -D warnings — zero warnings
  • Deploy and verify Rex reads sidecar-api skill endpoints from his system prompt

Deploy note

On macOS Sequoia (arm64), cp invalidates the ad-hoc code signature. After deploying:

cp target/release/openfang ~/.openfang/bin/openfang
codesign --force --sign - ~/.openfang/bin/openfang

🤖 Generated with Claude Code

zillajr and others added 7 commits February 28, 2026 00:51
The [approval_policy] TOML section was silently ignored because the
Rust struct maps to [approval]. This caused require_approval to fall
back to the hardcoded default (["shell_exec"]).

Also adds `blocked_tools` field to ManifestCapabilities. Tools listed
in blocked_tools are filtered out of available_tools() for both the
ToolAll and ToolInvoke capability paths, giving operators a way to
deny specific tools per agent without rebuilding the allowlist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Workspace skills were loaded AFTER the system prompt was built in kernel.rs.
Both streaming and non-streaming code paths had the same ordering bug.
Added build_skill_summary_from_registry() and collect_prompt_context_from_registry()
static methods. Reordered both paths to create workspace-aware skill snapshot
before prompt construction.

Also: deploy requires codesign --force --sign - after cp on macOS Sequoia.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants