Skip to content

refactor(libsy): separate task context from judge instructions - #899

Closed
nachiketb-nvidia wants to merge 1 commit into
mainfrom
nachiketb/switch-1687-capability-input
Closed

nachiketb-nvidia wants to merge 1 commit into
mainfrom
nachiketb/switch-1687-capability-input

Conversation

@nachiketb-nvidia

@nachiketb-nvidia nachiketb-nvidia commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #900, which includes this input refactor and the judge configuration refactor. Review and merge #900 → #901.

What

Separate conversation selection from the LLM judge's trailing routing instruction. Both judge types can use the same task window and reasoning removal; LLM requests keep their existing messages and prompt.

Why

Decision requests need conversation data without an instruction to emit LLM routing JSON. This is the first part of SWITCH-1687.

How

Extract TaskInput::messages and have the existing ClassifierInput implementation append its LLM instruction afterward. Routing, thresholds, affinity, and fallback are unchanged.

Validation

  • All 26 existing capability classifier tests passed before and after the refactor.
  • cargo fmt --all --check and commit-hook workspace Clippy.
  • No new test functions; no live provider calls.

Notes for reviewers

This change is included in #900. The active stack is #900 → #901.

One file, +10 / −2 lines.

Summary by CodeRabbit

  • Refactor
    • Updated internal message selection for classification requests; no user-visible behavior changes are expected.

Signed-off-by: nachiketb <nachiketb@nvidia.com>
@nachiketb-nvidia
nachiketb-nvidia requested a review from a team as a code owner October 1, 2026 22:29
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://NVIDIA-NeMo.github.io/Switchyard/pr-preview/pr-899/

Built to branch gh-pages at 2026-10-01 22:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA-NeMo/Switchyard/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0946bc34-3815-4fb8-bc58-38214da3a1f4

📥 Commits

Reviewing files that changed from the base of the PR and between 12922d5 and 80a16a7.

📒 Files selected for processing (1)
  • crates/libsy/src/algorithms/llm_class.rs

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

TaskInput now selects messages through an inherent messages method. ClassifierInput::build_messages delegates message selection to that method and retains the trailing instruction for windowed requests.

Changes

Message Selection

Layer / File(s) Summary
Message selection and build delegation
crates/libsy/src/algorithms/llm_class.rs
TaskInput::messages contains the existing selection and reasoning-removal logic. ClassifierInput::build_messages delegates selection to it and retains the conditional trailing instruction.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 80a16

The refactor is mergeable with no identified behavior or availability risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main refactor: separating shared task context from judge-specific instructions.
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


A rabbit checks each message in a row
Then sends the chosen words along
A window adds its routing note
The helper keeps the old path clear
Hop, hop, the messages flow!

Comment @coderabbitai help to get the list of available commands.

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.

1 participant