Skip to content

Studio: keep the nudge wiring test collectable without the unsloth stack - #6924

Merged
danielhanchen merged 1 commit into
mainfrom
danielhanchen/fix-backend-ci-nudge-import
Jul 7, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
danielhanchen/fix-backend-ci-nudge-import

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What

test_nudge_tool_calls_wiring.py (added in #6883) imports InferenceBackend
from core.inference.inference at module scope. That module does
from unsloth import FastLanguageModel, FastVisionModel, which requires
unsloth_zoo. The Backend CI matrix job ((Python 3.10/3.11/3.12/3.13)) is
deliberately dependency-light and does not install unsloth_zoo, so the import
raised PackageNotFoundError at collection time and pytest aborted the whole
job before running anything:

ERROR collecting studio/backend/tests/test_nudge_tool_calls_wiring.py
importlib.metadata.PackageNotFoundError: No package metadata was found for unsloth_zoo
ImportError: Unsloth: Please install unsloth_zoo via `pip install unsloth_zoo` then retry!
Interrupted: 1 error during collection

This turned Backend CI red on main (all ~831 backend tests skipped by the
collection abort).

Fix

Guard the one offending import and fold the safetensors InferenceBackend
checks in only when the unsloth stack is importable. The other entry points
(InferenceOrchestrator, LlamaCppBackend, run_safetensors_tool_loop) never
needed unsloth and are still asserted unconditionally, so the wiring guard keeps
working in the light job; local runs and any full-stack job still exercise the
InferenceBackend path.

Verified

  • Collection no longer aborts; the light suite runs.
  • Full stack (unsloth present): 6 passed, InferenceBackend folded in.
  • Simulated light job (unsloth import blocked): InferenceBackend is None, all
    tests pass, no collection error.
  • ruff clean.

test_nudge_tool_calls_wiring.py imported InferenceBackend from
core.inference.inference, which pulls in unsloth (and thus unsloth_zoo)
at module scope. The dependency-light backend CI matrix job does not
install unsloth_zoo, so the import raised at collection time and aborted
the whole job (831 tests never ran). Guard that one import and fold the
safetensors InferenceBackend checks in only when the unsloth stack is
importable; the orchestrator/llama_cpp/safetensors_agentic wiring is
still asserted unconditionally, and local/full-stack runs keep the
InferenceBackend coverage.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies test_nudge_tool_calls_wiring.py to make the import of InferenceBackend optional. This prevents test failures in dependency-light CI environments where the unsloth stack is not installed. The tests have been updated to conditionally execute checks for InferenceBackend only when it is successfully imported. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 8a96079fce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Jul 7, 2026
@danielhanchen
danielhanchen merged commit 3506371 into main Jul 7, 2026
39 checks passed
@danielhanchen
danielhanchen deleted the danielhanchen/fix-backend-ci-nudge-import branch July 7, 2026 04:57
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