Skip to content

Conversation

@dsarno
Copy link
Collaborator

@dsarno dsarno commented Jan 29, 2026

fix uv test for ci

Summary by CodeRabbit

  • Tests
    • Enhanced test coverage for cache-clearing functionality to better capture and verify logging behavior, improving reliability of cache management verification.

✏️ Tip: You can customize this high-level summary in your review settings.

dsarno and others added 30 commits January 27, 2026 15:41
- Add .claude/OVERVIEW.md with repository structure snapshot for future agents
  * Documents 10 major components/domains
  * Maps architecture layers and file organization
  * Lists 94 Python files, 163 C# files, 27 MCP tools
  * Identifies known improvement areas and patterns

- Add results/REFACTOR_PLAN.md with comprehensive refactoring strategy
  * Synthesis of findings from 10 parallel domain analyses
  * P0-P3 prioritized refactor items targeting 25-40% code reduction
  * 23 specific refactoring tasks with effort estimates
  * Regression-safe refactoring methodology:
    - Characterization tests for current behavior
    - One-commit-one-change discipline
    - Parallel implementation patterns for verification
    - Feature flags for instant rollback (EditorPrefs + environment)
  * 4-phase parallel subagent execution workflow:
    - Phase 1: Write characterization tests (10 agents in parallel)
    - Phase 2: Execute refactorings (10 agents in parallel)
    - Phase 3: Fix failing tests (10 agents in parallel)
    - Phase 4: Cleanup legacy code (parallel)
  * Domain-to-agent mapping and detailed prompt templates
  * Safety guarantees and regression detection strategy

This plan enables structured, low-risk refactoring of the unity-mcp codebase
while maintaining full backward compatibility and reducing code duplication.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…ion blocker

Characterization test fixes:
- Fix ManageEditor test to expect NullReferenceException (actual behavior)
- Fix FindGameObjects test to expect ErrorResponse (actual behavior)

Discovered issues:
- Inconsistent null handling: ManageEditor throws, FindGameObjects handles gracefully
- Running all EditMode tests triggers domain reloads that break MCP connection

Documentation updates:
- Add null handling inconsistency to REFACTOR_PLAN.md P1-1 section
- Create REFACTOR_PROGRESS.md to track refactoring work
- Document blocker: domain reload tests break MCP during test runs

Files:
- TestProjects/UnityMCPTests/Assets/Tests/EditMode/Tools/Characterization/EditorTools_Characterization.cs:32-47
- results/REFACTOR_PLAN.md (P1-1 section)
- REFACTOR_PROGRESS.md (new file)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Root causes identified:
1. Tests calling ManageEditor.HandleCommand with "play" action entered play mode
2. Test executing "Window/General/Console" menu item opened Console window
Both actions caused Unity to steal focus from terminal

Fixes:
- Replaced "play" actions with "telemetry_status" (read-only) in 5 tests
- Fixed FindGameObjects tests to use "searchTerm" instead of "query" parameter
- Marked ExecuteMenuItem Console window test as [Explicit]

Result: 37/38 characterization tests pass without entering play mode or stealing focus

Tests fixed:
- HandleCommand_ActionNormalization_CaseInsensitive
- HandleCommand_ManageEditor_DifferentActionsDispatchToDifferentHandlers
- HandleCommand_ManageEditor_ReturnsResponseObject
- HandleCommand_ManageEditor_ReadOnlyActionsDoNotMutateState
- HandleCommand_ManageEditor_ActionsRecognized
- HandleCommand_ExecuteMenuItem_ExecutesNonBlacklistedItems (marked Explicit)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated REFACTOR_PROGRESS.md:
- Status: Ready for refactoring
- Completed characterization test validation (37/38 passing)
- Documented fixes for play mode and focus stealing issues
- Next steps: Begin Phase 1 Quick Wins

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Root cause: ServerManagementService_StopLocalHttpServer_PrefersPidfileBasedApproach
calls service.StopLocalHttpServer() which actually stops the running MCP server,
causing the MCP connection to drop and test framework to crash.

Fix: Marked test as [Explicit("Stops the MCP server - kills connection")]

Result: 25/26 ServicesCharacterizationTests pass without killing MCP server

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Validated both characterization test suites:
- EditorToolsCharacterizationTests: 37 passing, 1 explicit
- ServicesCharacterizationTests: 25 passing, 1 explicit

Total characterization tests: 62 passing, 2 explicit (64 total)
Combined with 280 existing regression tests: 342 C# tests
Total project coverage: ~545 tests (342 C# + 203 Python)

All tests run without:
- Play mode entry
- Focus stealing
- MCP server crashes
- Assembly reload issues

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive characterization tests documenting UI patterns:
- EditorPrefs binding patterns (3 tests)
- UI lifecycle patterns (6 tests)
- Callback registration patterns (4 tests)
- Cross-component communication (5 tests)
- Visibility/refresh logic (2 tests)

All 29 tests pass (validated in EditMode).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added 29 Windows/UI characterization tests (all passing)
- Updated total C# tests: 371 passing, 2 explicit
- Updated total coverage: ~574 tests (371 C# + 203 Python)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive characterization tests documenting model patterns:
- McpStatus enum (3 tests)
- ConfiguredTransport enum (2 tests)
- McpClient class (20 tests) - documents 6 capability flags
- McpConfigServer class (10 tests) - JSON.NET NullValueHandling
- McpConfigServers class (4 tests) - JsonProperty("unityMCP")
- McpConfig class (5 tests) - three-level hierarchy
- Command class (8 tests) - JObject params handling
- Round-trip serialization (1 test)

All 53 tests pass (validated in EditMode).

Captures P2-3 target: McpClient over-configuration issue.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added 53 Models characterization tests (all passing)
- Updated total C# tests: 424 passing, 2 explicit
- Updated total coverage: ~627 tests (424 C# + 203 Python)
- All characterization test domains now complete
- Documented McpClient.SetStatus() NullReferenceException bug

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Reduces token usage from 13K+ to ~500 tokens for typical queries.

C# (Unity) Changes:
- Add pagination support (page_size, cursor, page_number)
- Add name filter parameter (case-insensitive contains)
- Default page_size: 50, max: 200
- Returns PaginationResponse with items, cursor, nextCursor, totalCount
- Both get_tests and get_tests_for_mode now support pagination

Python (MCP Server) Changes:
- Update resource signatures to accept pagination parameters
- Add PaginatedTestsData model for new response format
- Support both new paginated format and legacy list format
- Forward all parameters (mode, filter, page_size, cursor) to Unity
- Mark get_tests_for_mode as DEPRECATED (use get_tests with mode param)

Usage Examples:
- mcpforunity://tests?page_size=10
- mcpforunity://tests?mode=EditMode&filter=Characterization
- mcpforunity://tests?page_size=50&cursor=50

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
FastMCP resources require URI path parameters, not function parameters.
Simplified Python resource handlers to pass empty params to Unity.

Tested and verified:
- mcpforunity://tests - Returns first 50 of 426 tests (paginated)
- mcpforunity://tests/EditMode - Returns first 50 of 421 EditMode tests

Token savings: ~85% reduction (~6,150 → ~725 tokens per query)

C# handler (already committed) supports:
- mode, filter, page_size, cursor, page_number parameters
- Default page_size: 50, max: 200
- Returns PaginatedTestsData with nextCursor for pagination

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Audited existing utilities to avoid duplication and identify opportunities to patch in existing helpers rather than creating new ones.

Key findings:
- AssetPathUtility.cs already exists (QW-3: patch in, don't create)
- ParamCoercion.cs already exists (foundation for P1-1)
- JSON parser pattern exists but not extracted (QW-2: create)
- Search method constants duplicated 14 times in vfx.py alone (QW-4: create)
- Confirmation dialog duplicated in 5 files (QW-5: create)

Updated REFACTOR_PLAN.md to reflect Create vs Patch In actions.
Created UTILITY_AUDIT.md with full analysis.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Removed confirmed dead code:
- Server/src/utils/reload_sentinel.py (entire deprecated file)
- Server/src/transport/unity_transport.py:28-76 (with_unity_instance decorator - never used)
- Server/src/core/config.py:49-51 (configure_logging method - never called)
- MCPForUnity/Editor/Services/Transport/TransportManager.cs:26-27 (ActiveTransport, ActiveMode deprecated accessors)
- MCPForUnity/Editor/Windows/McpSetupWindow.cs:37 (commented maxSize line)
- MCPForUnity/Editor/Windows/Components/Connection/McpConnectionSection.cs (stopHttpServerButton backward-compat code and references)

Updated characterization tests to document removal of configure_logging.

NOT removed (refactor plan was incorrect - these are actively used):
- port_registry_ttl (used in stdio_port_registry.py)
- reload_retry_ms (used in plugin_hub.py, unity_connection.py)
- STDIO framing config (used in unity_connection.py)

All 59 config/transport tests passing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
QW-1 (Delete Dead Code) completed - 86 lines removed.

Updated refactor plan to document:
- What was actually deleted (6 items, 86 lines)
- What was NOT dead code (port_registry_ttl, reload_retry_ms, STDIO framing config - all actively used)
- Test verification (59 config/transport tests passing)

Updated progress tracking with QW-1 completion details.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Created Server/src/cli/utils/parsers.py with comprehensive JSON parsing utilities:
- parse_value_safe(): JSON → float → string fallback (no exit)
- parse_json_or_exit(): JSON with quote/bool fixes, exits on error
- parse_json_dict_or_exit(): Ensures result is dict
- parse_json_list_or_exit(): Ensures result is list

Updated 8 CLI command modules to use new utilities:
- material.py: 2 patterns replaced (JSON → float → string, dict parsing)
- component.py: 3 patterns replaced (value parsing, 2x dict parsing)
- texture.py: Removed local try_parse_json (14 lines), now uses utility
- vfx.py: 2 patterns replaced (list and dict parsing)
- asset.py: 1 pattern replaced (dict parsing)
- editor.py: 1 pattern replaced (dict parsing)
- script.py: 1 pattern replaced (list parsing)
- batch.py: 1 pattern replaced (list parsing)

Eliminated ~60 lines of duplicated JSON parsing code.
All 23 material/component CLI tests passing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
QW-2 (Create JSON Parser Utility) completed - ~60 lines eliminated.

Created comprehensive parser utility with 4 functions:
- parse_value_safe(): JSON → float → string (no exit)
- parse_json_or_exit(): JSON with fixes, exits on error
- parse_json_dict_or_exit(): Ensures dict result
- parse_json_list_or_exit(): Ensures list result

Updated 8 CLI modules, eliminated ~60 lines of duplication.
All 23 CLI tests passing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replaced duplicated path normalization patterns with AssetPathUtility.NormalizeSeparators():

Files updated:
- ManageScene.cs: 2 occurrences (lines 104, 131)
- ManageShader.cs: 2 occurrences (lines 69, 85)
- ManageScript.cs: 4 occurrences (lines 63, 66, 81, 82, 185, 2639)
- GameObjectModify.cs: 1 occurrence (line 50)
- ManageScriptableObject.cs: 1 occurrence (line 1444)

Total: 10+ path.Replace('\\', '/') patterns replaced with utility calls.

AssetPathUtility.NormalizeSeparators() provides centralized, tested path normalization that:
- Converts backslashes to forward slashes
- Handles null/empty paths safely
- Is already used throughout the codebase

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
QW-3 (Patch in AssetPathUtility) completed - 10+ patterns replaced.

Patched existing AssetPathUtility.NormalizeSeparators() into 5 Editor tool files:
- ManageScene.cs: 2 patterns
- ManageShader.cs: 2 patterns
- ManageScript.cs: 4 patterns
- GameObjectModify.cs: 1 pattern
- ManageScriptableObject.cs: 1 pattern

Replaced duplicated path.Replace('\\', '/') patterns with centralized utility.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Created centralized constants module to eliminate duplicated search method
choices across CLI commands. This establishes a single source of truth for
GameObject/component search patterns.

Changes:
- Created Server/src/cli/utils/constants.py with 4 search method sets:
  * SEARCH_METHODS_FULL (6 methods) - for gameobject commands
  * SEARCH_METHODS_BASIC (3 methods) - for component/animation/audio
  * SEARCH_METHODS_RENDERER (5 methods) - for material commands
  * SEARCH_METHODS_TAGGED (4 methods) - for VFX commands

- Updated 6 CLI command modules to use new constants:
  * vfx.py: 14 occurrences replaced with SEARCH_METHOD_CHOICE_TAGGED
  * gameobject.py: Multiple occurrences with FULL and TAGGED
  * component.py: All occurrences with BASIC
  * material.py: All occurrences with RENDERER
  * animation.py: All occurrences with BASIC
  * audio.py: All occurrences with BASIC

Impact:
- Eliminates ~30+ lines of duplicated Click.Choice declarations
- Makes search method changes easier (single source of truth)
- Prevents inconsistencies across commands

Testing: All 49 CLI characterization tests passing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Created centralized confirmation utility to eliminate duplicated confirmation
dialog patterns across CLI commands. Provides consistent UX for destructive
operations.

Changes:
- Created Server/src/cli/utils/confirmation.py with confirm_destructive_action()
  * Flexible message formatting for different contexts
  * Respects --force flag to skip prompts
  * Raises click.Abort if user declines

- Updated 5 CLI command modules to use new utility:
  * component.py: Remove component confirmation
  * gameobject.py: Delete GameObject confirmation
  * script.py: Delete script confirmation
  * shader.py: Delete shader confirmation
  * asset.py: Delete asset confirmation

Impact:
- Eliminates 5+ duplicate "if not force: click.confirm(...)" patterns
- Consistent confirmation message formatting
- Single location to enhance confirmation behavior

Testing: All 49 CLI characterization tests passing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
All Quick Wins (QW-1 through QW-5) now complete and fully verified with:
- 108/108 Python tests passing
- 322/327 C# Unity tests passing (5 explicit skipped)
- Live integration tests successful

Total impact: ~180+ lines removed, 3 new utilities created, 16 files refactored
…ability

Added explicit URI documentation to every MCP resource description to prevent
confusion between resource names (snake_case) and URIs (slash/hyphen separated).

Changes:
- Updated 21 MCP resources across 14 Python files
- Format: description + newline + URI: mcpforunity://...
- Added MCP Resources section to README.md explaining URI format
- Emphasized that resource names != URIs (editor_state vs editor/state)

Impact:
- Future AI agents will not fumble with URI format
- Self-documenting resource catalog
- Clear distinction between name and URI fields

Files updated (14 Python files, 21 resources total):
- tags.py, editor_state.py, unity_instances.py, project_info.py
- prefab_stage.py, custom_tools.py, windows.py, selection.py
- menu_items.py, layers.py, active_tool.py
- prefab.py (3 resources), gameobject.py (4 resources), tests.py (2 resources)
- README.md (added MCP Resources documentation section)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add ToolParams helper class for unified parameter validation
- Add Result<T> type for operation results
- Implements snake_case/camelCase fallback automatically
- Add comprehensive unit tests for ToolParams
- Refactor ManageEditor.cs to use ToolParams (fixes null params issue)
- Refactor FindGameObjects.cs to use ToolParams

This eliminates repetitive IsNullOrEmpty checks and provides consistent
error messages across all tools. First step towards removing 997+ lines
of duplicated validation code.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Refactor ManageScript.cs to use ToolParams wrapper
- Refactor ReadConsole.cs to use ToolParams wrapper
- Simplifies parameter extraction and validation
- Maintains backwards compatibility with snake_case/camelCase

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Rename Result<T>.Error property to ErrorMessage to avoid conflict with Error() static method
- Update all references to use ErrorMessage instead of Error
- Fix SearchMethods constant reference in FindGameObjects
- Rename options variable to optionsToken in ManageScript to avoid scope conflict
- Verify compilation succeeds with no errors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The P1-1 ToolParams refactoring fixed ManageEditor to handle null params
gracefully by returning an ErrorResponse instead of throwing NullReferenceException.
Update the characterization test to validate this new, correct behavior.
Identified gap: C# ToolParams provides snake_case/camelCase flexibility,
but Python MCP layer (FastMCP/pydantic) rejects non-matching parameter names.
This creates user friction when they guess wrong on naming convention.

Plan adds parameter normalization decorator to Python tool registration,
making the entire stack forgiving of naming conventions.

Scope: ~20 tools, ~50+ parameters
Estimated effort: 2 hours
Risk: Low (additive, does not modify existing behavior)
Impact: High (eliminates entire class of user errors)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
dsarno and others added 24 commits January 28, 2026 14:34
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- VfxGraphControl: Return error for unknown actions instead of success
- focus_nudge.py: Remove pointless f-string, narrow bare except
- test_transport_characterization.py: Fix unused params (_ctx), remove unused vars, track background task
- test_core_infrastructure_characterization.py: Use _ for unused loop variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- VfxGraphCommon: Add null guard in FindVisualEffect before accessing params
- run_tests.py: Parse Name@hash format before session lookup for multi-instance focus nudging
- WebSocketTransportClient: Use Path.GetFileName/GetDirectoryName for robust trailing separator handling
- focus_nudge.py: Safe float parsing for environment variables with fallback + warning logging
- LineWrite: Add debug logging to diagnose LineRenderer position persistence issue

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- CLAUDE.md: Add language identifiers to markdown code blocks, fix "etc" -> "etc."
- StringCaseUtility: Fix ToSnakeCase regex to match digit→Uppercase boundaries (param1Value -> param1_value)
- VfxGraphWrite: Add validation for unsupported vector dimensions (must be 2, 3, or 4)
- conftest.py: Improve telemetry reset error handling with safe parser and logging

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- VfxGraphWrite.SendEvent: Use safe float? parsing for size/lifetime to avoid ToObject exceptions
- run_tests.py: Remove unused 'os' import, narrow exception types to (AttributeError, KeyError), use else block for clarity
- conftest.py: Add noqa comment for pytest hook args (pytest requires exact parameter names)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- TryLoadConfig now returns null on JSON errors (was returning empty object)
- Configure() preserves existing config and other MCP servers
- Only adds schema when creating new file
- Safely updates only unityMCP entry, preserves antigravity + other servers
- Better error logging for debugging config issues

Fixes issue where Configure button wiped entire config for Codex/OpenCode.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Escape double quotes in app_name parameter before interpolation into AppleScript
- Prevents command injection via untrusted app names in focus_nudge.py:251
- Escaping follows AppleScript string literal requirements

Fixes high-severity vulnerability identified in security review.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
## Changes

### TestJobManager: Auto-fail stalled initialization
- Add 15-second initialization timeout for jobs that fail to start tests
- Jobs in "running" state that never call OnRunStarted() are automatically failed
- Prevents "tests_running" deadlock when tests fail to initialize (e.g., unsaved scene)
- GetJob() now checks for initialization timeout on each poll

### OpenCodeConfigurator: Fix misleading comment
- Update TryLoadConfig() comment to accurately describe behavior when JSON is malformed
- Clarify that returning null causes Configure() to create fresh JObject, losing existing sections
- Note that preserving sections would require different recovery strategy

### run_tests.py: Improve exception handling
- Change _get_unity_project_path() to catch general Exception (not just AttributeError/KeyError)
- Re-raise asyncio.CancelledError to preserve task cancellation behavior
- Ensures registry failures are logged/swallowed while maintaining cancellation semantics
- Add lazy project path resolution: re-resolve project_path when nudging if initially None
- Fixes multi-instance support when registry becomes ready after polling starts

### conftest.py: Future-proof pytest compatibility
- Change item.fspath to item.path in pytest_collection_modifyitems hook
- item.path is pytest 7.0.0+ replacement for deprecated fspath
- Prevents future compatibility issues with newer pytest versions

## Testing
- All 502 Python tests pass
- Verified job state transitions with timeout logic
- Confirmed exception handling preserves cancellation semantics

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
ProcessDetectorTests and ProcessTerminatorTests execute subprocess commands
(ps, lsof, tasklist, wmic) which can be slow on macOS, especially during
full test suite runs. These tests were blocking other tests from progressing
and causing excessive focus nudging attempts.

Marking both test classes as [Explicit] excludes them from normal test runs
and allows them to be run separately when needed for process detection validation.

Fixes: Tests taking 1+ minute and triggering focus nudge spam

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Move _consecutive_nudges increment to after verifying the focus attempt,
rather than before. This ensures the counter only reflects actual nudge
attempts, not potential nudges that were rate-limited or skipped.

Fixes CodeRabbit issue: Counter was incrementing even if _focus_app
failed or activation didn't complete, leading to unnecessarily long
backoff intervals on subsequent failed attempts.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
## Changes

### McpConnectionSection.cs
- Updated stale comment about stdio selection to correctly reference EditorConfigurationCache as source of truth

### find_gameobjects.py
- Removed unused AliasChoices import (never effective with FastMCP function signatures)
- Removed validation_alias decorations from Field definitions (FastMCP uses Python parameter names only)

### focus_nudge.py
- Updated _get_current_focus_duration to use configurable _DEFAULT_FOCUS_DURATION_S instead of hardcoded values
- Durations now scale proportionally from environment-configured default (base, base+2s, base+5s, base+9s)
- Ensures UNITY_MCP_NUDGE_DURATION_S environment variable is actually respected

### test_core_infrastructure_characterization.py
- Removed unused monkeypatch parameter from mock_telemetry_config fixture
- Added explicit fixture references in tests using mock_telemetry_config to suppress unused parameter warnings
- Moved CustomError class definition to test method scope for proper exception type checking in pytest.raises

## Testing
- All 502 Python tests pass
- No regressions in existing functionality

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
## Changes

### VfxGraphAssets.cs
- FindTemplate: Convert asset paths to absolute filesystem paths before returning
  (AssetDatabase.GUIDToAssetPath returns "Assets/...", now converts to full paths)

- FindTemplate/SetVfxAsset: Add path traversal validation to reject ".." sequences,
  absolute paths, and backslashes; verify normalized paths don't escape Assets folder
  using canonical path comparison

### VfxGraphWrite.cs
- SetParameter<T>: Guard valueToken.ToObject<T>() with try/catch for JsonException
  and InvalidCastException; return error response instead of crashing

### focus_nudge.py
- Move _last_nudge_time and _consecutive_nudges updates to only occur after
  successful _focus_app() call (prevents backoff advancing on failed attempts)

- _get_current_focus_duration: Scale base durations (3,5,8,12) proportionally by
  ratio of configured UNITY_MCP_NUDGE_DURATION_S to default 3.0 seconds
  (e.g., if env var = 6.0, durations become 6,10,16,24 seconds)

### test_core_infrastructure_characterization.py
- test_telemetry_collector_records_event: Mock threading.Thread to prevent worker
  from consuming queued events during test assertion

- reset_telemetry fixture: Call core.telemetry.reset_telemetry() function to
  properly shut down worker threads instead of just setting _telemetry_collector = None

## Testing
- All 502 Python tests pass
- Telemetry tests no longer flaky
- No regressions in existing functionality

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Removed .meta files for folders that were previously deleted, preventing Unity warnings about missing directories.
Add support for intuitive parameter formats that LLMs commonly use:
- Dict vectors: position={x:0, y:1, z:2}
- Dict colors: color={r:1, g:0, b:0, a:1}
- Hex colors: #RGB, #RRGGBB, #RRGGBBAA
- Tuple strings: (x, y, z) and (r, g, b, a)

Centralized normalization in utils.py with normalize_vector3() and
normalize_color() functions. Removed ~200 lines of duplicate code.

Updated type annotations to accept dict format in Pydantic schema.
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 20000 lines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The test modification adds logging capture and validation to the ClearUvxCache_DoesNotThrow test, extending it to verify that UV cache-related log messages are produced during cache clearing operations. The test now subscribes to log output events, executes the cache clearing operation, and asserts that specific log messages containing "uv cache" were generated.

Changes

Cohort / File(s) Summary
Test Enhancement
TestProjects/UnityMCPTests/Assets/Tests/EditMode/Services/Characterization/ServerManagementServiceCharacterizationTests.cs
Added using directives (UnityEngine, UnityEngine.TestTools). Enhanced ClearUvxCache_DoesNotThrow test to capture and validate log output via Application.logMessageReceived, verifying that UV cache-related messages are logged during execution with proper event handler subscription/cleanup.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A test now hops with sharper sight,
Capturing logs in the pale moonlight,
UV caches whisper their tales so true,
Handler events dance the whole night through! ✨

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@dsarno dsarno merged commit 4e6e27a into CoplayDev:beta Jan 29, 2026
1 check was pending
@dsarno dsarno deleted the fix/uvx-logassert branch January 29, 2026 19:41
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