Skip to content

Keep load_skill tool bound; remove dynamic tool gating and refine active-skill handling#41

Open
weilixu wants to merge 1 commit intoskills_devfrom
codex/implement-active-skill-text-injection-5r7nz7
Open

Keep load_skill tool bound; remove dynamic tool gating and refine active-skill handling#41
weilixu wants to merge 1 commit intoskills_devfrom
codex/implement-active-skill-text-injection-5r7nz7

Conversation

@weilixu
Copy link
Contributor

@weilixu weilixu commented Jan 22, 2026

Motivation

  • Avoid mutating self.graph.tools at runtime and keep the load_skill tool bound to the agent at all times to simplify behavior and avoid errors when self.graph lacks a tools attribute.
  • Ensure active skill text is injected into LLM inputs as an internal system message and that skill outputs are captured correctly during both invoke and streaming flows.

Description

  • Removed dynamic tool gating: deleted _apply_active_skill_tool_gating() and any code paths that mutated self.graph.tools, so load_skill remains statically available when skills are enabled.
  • Added automa_ai/skills/active_skill.py with ActiveSkillState, ACTIVE_SKILL_HEADER, and format_active_skill_message() to manage active-skill state and formatting.
  • Integrated active-skill state into the agent by adding _active_skill_state, injecting formatted active-skill system messages in _build_stream_inputs() ahead of retriever/memory context, and adding _capture_skill_tool_outputs() to mark skills loaded from tool responses.
  • Added clear_active_skill() and request_clear_active_skill() helpers and adjusted invoke/stream flows to build inputs using the active-skill injection and to capture load_skill tool outputs from both synchronous responses and streaming ToolMessages.

Testing

  • Ran pytest automa_ai/agents/langgraph_chatagent_test.py in this environment and test collection failed with ModuleNotFoundError: No module named 'langchain_core', so automated tests could not be executed here.
  • Updated unit tests in automa_ai/agents/langgraph_chatagent_test.py to remove gating-related assertions and to verify active-skill injection, ordering, absence when unset, and capture of load_skill outputs, which should be exercised in a local environment where langchain_core is available.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant