eca icon indicating copy to clipboard operation
eca copied to clipboard

Add on-demand rules (lazy-loading them) in a similar manner as mcpToolSearch deferral

Open erickisos opened this issue 3 weeks ago • 2 comments

Currently, static rules are always loaded by default, this has a significant impact on models with a small context-window like Apple Foundation Models (which only have 4k).

Rules support a model frontmatter field which helps, but it might be better to have a "load only when actually needed" that could be inferred via frontmatter configuration on those rules.

This would require:

  • A new rule frontmatter flag and a short description for catalog entry
  • modify the prompt.clj file to render only the description of available rules (on when to use them)
  • fetch_rule.clj changes to support fetching on demand rule by id.

erickisos avatar Nov 09 '26 03:11 erickisos

@erickisos Why don't you use skills for things that should be lazy loaded? That, in my opinion, is what sets rules apart from skills (and also the reason why a lot of people don't use rules at all). Rules are essentially something that is guaranteed to be loaded under a certain configuration; as soon as we were to delegate that to the model, we would break the contract.

zikajk avatar Nov 10 '26 08:11 zikajk

@erickisos Why don't you use skills for things that should be lazy loaded? That, in my opinion, is what sets rules apart from skills (and also the reason why a lot of people don't use rules at all). Rules are essentially something that is guaranteed to be loaded under a certain configuration; as soon as we were to delegate that to the model, we would break the contract.

Makes sense, from my understanding they serve different semantic purposes so putting rules in a skill feels wrong, but at the same time, delegating those rules would also be a problem.

I will try moving my rules to skills then, thank you!

erickisos avatar Nov 10 '26 13:11 erickisos