Skip to content

fix: inherit agent model in Skill Forge LLM calls#208

Open
guix4ever wants to merge 1 commit into
EverMind-AI:mainfrom
guix4ever:fix/skill_forge_model_inheritance
Open

fix: inherit agent model in Skill Forge LLM calls#208
guix4ever wants to merge 1 commit into
EverMind-AI:mainfrom
guix4ever:fix/skill_forge_model_inheritance

Conversation

@guix4ever

Copy link
Copy Markdown

Summary

  • pass the active agent model to the Skill Forge query rewriter
  • make the LLM gate inherit the active agent model when llm_gate_model is unset
  • preserve the explicit gate model override and document the fallback behavior
  • add regression coverage for model forwarding, inheritance, and override priority

Root cause

The context-engine factory did not pass the active agent model into either Skill Forge LLM stage. QueryRewriter had no model parameter, while LLMGateFilter received None when no gate-specific override was configured. Both calls could therefore fall back to a provider-level default that differed from agents.defaults.model, including models unavailable in the user's region.

Impact

The rewriter and gate now use the same configured model as the agent by default. Deployments that set skillForge.llmGateModel continue to use that explicit model for gate calls.

Follow-up consideration

A future change could add an optional rewrite_model override, with agents.defaults.model as its fallback. That would let operators pin a cheaper or lower-latency model for query rewriting without relying on an implicit provider default. This PR intentionally does not add a new configuration field so the fix remains focused on model inheritance.

Validation

  • uv run pytest tests/test_skill_forge_rewriter.py tests/test_skill_forge_gate.py tests/test_phase_a_default_engine.py -q — 33 passed
  • uv run --extra dev ruff check on all changed Python files
  • uv run --extra dev ruff format --check on all changed Python files
  • git diff --check

Closes #155.

@guix4ever
guix4ever marked this pull request as ready for review July 24, 2026 06:14
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.

Skill Forge rewriter/gate ignore agents.defaults.model, fall back to region-blocked provider default

1 participant