Skip to content

Route llm rule criteria through the instruct service - #1433

Merged
iceljc merged 1 commit into
SciSharp:masterfrom
Lessen-AI:cherry-pick/llm-criteria-instruct-log-prod
Sep 11, 2026
Merged

Route llm rule criteria through the instruct service#1433
iceljc merged 1 commit into
SciSharp:masterfrom
Lessen-AI:cherry-pick/llm-criteria-instruct-log-prod

Conversation

@iceljc

@iceljc iceljc commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

LlmCriteriaEvaluator called the chat completion provider directly, so the criteria check never showed up in the instruction log. Run it through IInstructService.Execute instead, which emits the IInstructHook events that InstructionLogHook persists.

Two supporting changes make Execute a faithful drop-in:

  • IInstructService.Execute takes an optional renderData, threaded into RenderTemplate/RenderInstruction. The rule engine evaluates criteria before SetConversationId, so the conversation state is still empty and the default CollectRenderData path would render the criteria template with no state. The evaluator passes the trigger states instead.

  • CodeInstructOptions.Disabled skips RunCode. The llm evaluator's template name can be {trigger}_criteria, which collides with CodeCriteriaEvaluator's {trigger}_criteria.py, so an explicit mode "llm" could otherwise be hijacked into a code run.

(cherry picked from commit 8594362)

LlmCriteriaEvaluator called the chat completion provider directly, so the
criteria check never showed up in the instruction log. Run it through
IInstructService.Execute instead, which emits the IInstructHook events that
InstructionLogHook persists.

Two supporting changes make Execute a faithful drop-in:

- IInstructService.Execute takes an optional renderData, threaded into
  RenderTemplate/RenderInstruction. The rule engine evaluates criteria before
  SetConversationId, so the conversation state is still empty and the default
  CollectRenderData path would render the criteria template with no state. The
  evaluator passes the trigger states instead.

- CodeInstructOptions.Disabled skips RunCode. The llm evaluator's template name
  can be {trigger}_criteria, which collides with CodeCriteriaEvaluator's
  {trigger}_criteria.py, so an explicit mode "llm" could otherwise be hijacked
  into a code run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 8594362)
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@iceljc
iceljc merged commit faa4df5 into SciSharp:master Sep 11, 2026
4 checks passed
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