docs(v2): PR 2/7 - Mode migration guide and normalization tests#2019
docs(v2): PR 2/7 - Mode migration guide and normalization tests#2019jxnl wants to merge 2 commits intofeat/v2-pr1-core-infrastructurefrom
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
instructor | 9bb9d7b | Commit Preview URL Branch Preview URL |
Jan 18 2026, 06:50 PM |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
tests/v2/test_mode_normalization.py
Outdated
|
|
||
| for mode in expected_modes: | ||
| if mode in registered_modes: | ||
| assert mode_registry.is_registered(provider, mode) |
There was a problem hiding this comment.
Test assertion is tautological and ineffective
Low Severity
The conditional if mode in registered_modes: followed by assert mode_registry.is_registered(provider, mode) creates a tautology. If a mode exists in registered_modes, then is_registered will inherently return true. This test won't catch missing mode registrations when providers are added in future PRs—it only asserts for modes already registered, silently passing when expected modes are missing.
|
|
||
| # Different mode should warn | ||
| normalize_mode(provider, Mode.TOOLS_STRICT) | ||
| assert len(w) == 2 |
There was a problem hiding this comment.
Test uses wrong provider-mode combinations for Anthropic
Medium Severity
The test_deprecated_mode_warning_only_once test is parameterized with both Provider.OPENAI and Provider.ANTHROPIC, but it only tests Mode.FUNCTIONS and Mode.TOOLS_STRICT which are OpenAI-specific legacy modes. When run with Provider.ANTHROPIC, the test calls normalize_mode(Provider.ANTHROPIC, Mode.FUNCTIONS) which is semantically incorrect. The test should use Anthropic-appropriate modes like ANTHROPIC_TOOLS and ANTHROPIC_JSON when testing with Provider.ANTHROPIC, similar to how test_deprecated_mode_emits_warning correctly pairs providers with their respective modes.
8b77563 to
d0a96e2
Compare
370e3cf to
921fec0
Compare
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
- Add docs/concepts/mode-migration.md explaining legacy mode deprecation - Add tests/v2/test_mode_normalization.py for mode normalization logic - Update mkdocs.yml with mode migration guide link - Tests skip gracefully when handlers not yet registered This PR was written by [Cursor](https://cursor.com)
921fec0 to
26e1795
Compare
- Fix tautological test assertion to verify handler exists - Use provider-specific deprecated modes in warning test

Description
This is PR 2 of 7 in the stacked PR series implementing Instructor V2 registry-based architecture.
Base: PR 1 (feat/v2-pr1-core-infrastructure)
Changes
Documentation
docs/concepts/mode-migration.md)ANTHROPIC_TOOLS->TOOLS)mkdocs.ymlwith navigation linkTests
tests/v2/test_mode_normalization.py)normalize_mode()function for all legacy modesDEPRECATED_MODE_MAPPINGis completeTesting
Stacked PRs
This PR was written by Cursor
Note
Introduces guidance and validation for moving from provider-specific modes to core modes.
docs/concepts/mode-migration.mdwith legacy→core mapping, provider examples (e.g.,ANTHROPIC_TOOLS→TOOLS), notes on deprecation warnings and v3.0 removalmkdocs.ymlto include "Mode Migration" in Concepts navigationtests/v2/test_mode_normalization.pycoveringnormalize_mode()across providers, deprecation warnings (including once-per-mode behavior), no-warn on generic modes, and completeness ofDEPRECATED_MODE_MAPPING; handler-dependent tests skip until providers are registeredWritten by Cursor Bugbot for commit 370e3cf. Configure here.