Releases: PereViader/UnityLeanMcp
Release list
UnityLeanMcp v1.1.0
feat: Bump version to 1.1.0
feat: Simplify UnityMCP architecture and harden tool execution
UnityLeanMcp v1.0.0
feat: Bump version to 1.0.0
fix(tools): comprehensive fixes for refresh, eval, test, and coverage tools
- unity_refresh: capture non-CS errors (shader, missing MonoBehaviour, asset import) from LogEntries, synchronize success state, broaden diagnostic regex, fix busy heuristic, and eliminate premature IDLE
- unity_eval: use Roslyn AST Span over FullSpan to preserve comments preceding using directives, add AnonymousTypeFormatter, enforce InvariantCulture on math formats, and guard targetObject
- unity_test: prioritize pre-execution failures over empty filter notice, format failedOnly zero-count cleanly, and handle Cancelled state symmetrically
- unity_coverage: normalize project root path without trailing slash quirks, fix uncovered line calculation with Any(hitCount == 0), and add version boundary check for PlayMode coverage
- tests & docs: add comprehensive unit/integration tests and update DESIGN.md and LEARNINGS.md
UnityLeanMcp v0.8.0-preview.16
fix(process): support batchmode auto-start via UNITY_BATCHMODE environment variable
docs: streamline MCP tools documentation in README
feat: Bump version to 0.8.0-preview.16
fix(eval): support unreferenced assemblies, add dynamic assembly resolve, and clean build sync
feat(coverage): extract recursive method discovery and add comprehensive coverage type tests
fix(coverage): harden path normalization, fail-fast on Release mode, and retire obsolete test mode default
- Normalize '.' and './' to empty string in GetCoverageHandler to match all project files on whole-project queries.
- Add TryResolveExistingPath to resolve leading slash paths (e.g. '/Assets/...') relative to projectRoot cross-platform.
- Add fail-fast check in GetCoverageHandler when CompilationPipeline.codeOptimization is Release mode.
- Retire obsolete 'all' default in RunTestsArgs.Mode in Models.cs, aligning with canonical enum validation.
- Refactor UnityClient.GetCoverageAsync to use typed deserialization instead of manual JSON DOM enumeration.
- Add regression and validation tests across Mcp.Tests and Unity3d Editor tests.
- Update DESIGN.md and LEARNINGS.md.
fix(coverage): harden profiler lifecycle, deduplicate nested types, and remove bounded query timeout
- Defer coverage initialization in RunTestsHandler until operation ownership is acquired and tests are ready to run, preventing counter wipes on BUSY responses and profiler leaks.
- Guarantee Coverage.enabled = false is restored on early exits (--failed-only with 0 failed tests) and dispatch exceptions.
- Deduplicate nested types via visitedTypes set and skipping nested types in outer assembly scan in GetCoverageHandler.
- Harvest static constructor (.cctor) sequence points via type.TypeInitializer.
- Align empty compiled paths by returning SUCCESS with empty files, presenting informational results in MCP layer.
- Enforce strict array element validation across MCP, client, and Editor boundaries.
- Support unbounded timeoutSeconds <= 0 in UnitySocketTransport and remove arbitrary 15s timeout from GET_COVERAGE.
- Centralize path normalization and project root resolution in GetCoverageHandler, removing redundant IUnityClient interface overload.
- Add regression tests covering array validation, empty files, and unbounded socket commands.
fix(coverage): handle busy compile and active operations with fail-fast diagnostics and grace periods
- Fail fast on BUSY compile with actionable message explaining in-memory coverage invalidation
- Add BusyGracePeriod handling and retry loop on GetCoverageAsync for active operations
- Evaluate RequiresCompilationSettled and active operations on worker threads for non-worker handlers
- Add IProgress parameter to GetCoverageAsync and UnityCoverageAsync
- Update DESIGN.md and LEARNINGS.md with coverage lifecycle documentation
- Add subsystem tests for coverage busy handling and progress notifications
feat(coverage): add in-memory code coverage tool and rename unity_run_tests to unity_test
refactor(mcp): remove unity_stop MCP command and streamline tool surface
- Remove unity_stop tool from UnityTools, reducing public catalog to 3 tools
- Update foreign operation busy diagnostic in UnityClient to instruct killing the project-owned Unity process if hung
- Update UnityIntegrationFixture teardown to use UnityProcessManager directly
- Update McpProtocolTests, TieredAutowaitingTests, and ToolFormattingTests
- Update README.md and record the architectural decision in DESIGN.md
feat(process): auto-start Unity in interactive GUI mode instead of batchmode
UnityLeanMcp v0.8.0-preview.15
feat: Bump version to 0.8.0-preview.15
fix: require explicit test mode and remove ambiguous 'all' mode (fixes #118, fixes #119)
docs: add concise selective failure re-run guidance for failedOnly in unity_run_tests
docs: document anonymous object return pattern in unity_eval description and design docs
feat: add high-density UnityMathFormatter for vectors, quaternions, colors, and bounds
feat: add actionable missing-namespace hints in unity_eval failure trailer
fix: complete unhandled operations on domain reload and simplify composite test filter validation
fix: propagate cancellation token, avoid bounded CTS timeout, and atomic update counts
refactor: eliminate obsolete poller overloads, unify compilation handlers, and remove dead code
fix: improve transactional write resilience and operation resource cleanup
refactor: consolidate subsystem test infrastructure with shared MockUnityServer and shared stubs (fixes #117)
refactor: streamline foreign lock detection, clean tracker reflection, and eliminate dead code (fixes #116)
refactor: optimize and streamline Roslyn dynamic compilation and evaluation engine (fixes #115)
refactor: unify protocol status parsing and deduplicate compilation command handlers (fixes #114)
refactor: unbounded dispatcher waiting and direct mutating refresh dispatch
refactor: simplify tool result creation, test failure formatting, and uri percent encoding
refactor: unify test running state updates, filter array checks, and delete retries
refactor: simplify process liveness, stop sequencing, and socket readiness in UnityProcessManager
refactor: simplify fault handling, settle polling, and path resolution
refactor: simplify command dispatch, terminal polling resolution, path access, and test lifecycle
- Unify mutating command dispatch and autowaiting loop into UnityClient.DispatchMutatingCommandAsync
- Consolidate repeated disk checks into OperationPoller.ResolveTerminalStateAsync
- Eliminate redundant Worker* shadow path properties in UnityLeanMcpPaths
- Centralize test run cleanup across completion, cancellation, and interruption into RunTestsHandler.CleanupTestRun
- Update DESIGN.md and LEARNINGS.md
fix: store unity_background_log.txt under Unity Temp folder (fixes #113)
UnityLeanMcp v0.8.0-preview.14
feat: Bump version to 0.8.0-preview.14
refactor: simplify polling loop, eliminate refresh latency tax, and streamline process verification
- Decouple process liveness inspection from active 500ms polling loop, querying process table only on socket transport failure
- Return terminal results immediately from custom response handler on READY/COMPILATION_ERROR, eliminating 500ms delay
- Streamline batchmode identity verification to read typed store in single pass
- Eliminate redundant duplicate socket readiness probes on process startup
- Support relative -projectPath arguments (. and ./) in CommandLineTargetsProject
- Broaden compiler error diagnostic regex to support UPM package paths (@) and Unicode
- Update DESIGN.md and LEARNINGS.md with new architectural decisions and edge cases
fix: harden multiplatform process discovery, lockfile handling, and argument parsing
- Fix macOS sysctl(KERN_PROCARGS2) parsing to skip exec_path and padding, preserving all argv arguments
- Treat macOS paths as case-insensitive in PathsEqual matching default APFS/HFS+ semantics
- Resolve symlink targets when verifying process executable paths
- Never delete UnityLockfile on failed lock probe and improve GUI process liveness detection
- Update UnityLogScanner regex to detect compilation errors from package cache (@) and Unicode paths
- Trim trailing directory separators from ProjectRoot and LogFile before quoting in ProcessStartInfo
- Add default Linux Unity Hub path (~/.local/share/unity3d/Hub/Editor) to candidate discovery
- Add case-insensitive and relative path matching for .vscode/mcp.json in installer
- Document platform behaviors and edge cases in LEARNINGS.md
UnityLeanMcp v0.8.0-preview.13
feat: Bump version to 0.8.0-preview.13
docs: record learning on external termination of stdio MCP server child processes
refactor: remove redundant filter variables and correct indentation in UnityRunTestsAsync
fix: ensure fail-safe shutdown interruption, refresh dispatch cancellation, and prune dead parameters
refactor: dispatch test cancellation on main thread and prune dead lifecycle methods
refactor: prune dead parameters, no-op attributes, and orphaned test fixtures
refactor: remove obsolete compatibility handlers and dead code
- Remove CANCEL_TESTS handler and legacy command registration in favor of CANCEL_OPERATION
- Remove legacy CLI argument parsing fallback and tokenization from RUN_TESTS
- Remove dead execute-method leftovers (ParameterTypeConverter, MethodResolver, ExecuteResultFile)
- Align test filter validation on RunTestsHandler to reject null elements synchronously
- Update DESIGN.md and LEARNINGS.md
fix(mcp): avoid displaying 0 skipped in test results (#111)
UnityLeanMcp v0.8.0-preview.12
fix: Tests failing due to file reading edge case
feat: Bump version to 0.8.0-preview.12
feat: Multiple improvements and cleanups of the MCP functionality
UnityLeanMcp v0.8.0-preview.11
fix: Mcp generation and publishing issue
feat: Bump version to 0.8.0-preview.11
fix(mcp): update MCP configs to use CWD as MCP~ folder and call mcp dll
- Set CWD to package MCP~ directory and execute dotnet with UnityLeanMcp.Mcp.dll across configurations
- Use \ for VS Code and \ for Claude Code
- Use absolute paths in CWD for Antigravity, Cursor, and Codex
- Add dynamic package and MCP~ directory resolution in UnityLeanMcpInstaller and McpConfigurationPaths
- Update tests, README.md, DESIGN.md, and LEARNINGS.md
UnityLeanMcp v0.8.0-preview.10
fix(mcp): resolve CI test failures in containerized and Linux environments
feat: Bump version to 0.8.0-preview.10
feat: strengthen process isolation, thread safety, operation lifecycle, and output bounding
- Implement durable PID identity store, OS command-line readers, and cross-process startup lock
- Protect Unity main-thread affinity with worker diagnostics logging and managed snapshots
- Decouple lifecycle cancellation handlers and support pre-acknowledgement dispatch cancellation
- Bound result formatting across depth, cycle, item count, and UTF-8 byte budgets
- Add test mode and filter validation with whitespace-retaining SingleOrArray deserialization
- Restore C# 9.0 compatibility for Unity 2021.3 and portable relative MCP configurations
fix: resolve correctness and SOLID issues across operation store, poller, client, and tools
- Catch UnauthorizedAccessException in UnityLeanMcpOperationStore.Read retry loop
- Return cached in-memory snapshot in ReadThreadSafeSnapshot under cache lock
- Dispose native OS process handles in UnityProcessManager.StopUnityAsync and FindProjectUnityPid
- Route ProjectRoot in UnityTools through injected IUnityPathResolver
- Strip status prefixes and unescape payloads in UnityClient.RunTestsAsync and OperationPoller
- Synchronize Success=false on compilation errors in EnrichRefreshResultWithDiagnostics
- Protect shared static result files (unity_refresh_result.json) across poll completions in OperationPoller
- Blank matched using directive characters with spaces in RoslynCompilerHelper.ExtractUsingDirectivesFallback
- Encapsulate IReadOnlyList in SingleOrArray with collection builder support
- Update DESIGN.md and LEARNINGS.md with newly discovered patterns and edge cases
refactor: resolve priority 2 SOLID and architectural improvements
- refactor(server): open UnityLeanMcpServer to extension via public ICommandHandler and RegisterHandler (OCP)
- refactor(formatter): decompose UnityResultFormatter into modular IUnityTypeFormatter priority registry (OCP)
- refactor(paths): streamline IUnityPathResolver with type-safe UnityOperationKind enum and eliminate redundant forwarding in UnityProcessManager (ISP)
- test: update path resolution and process manager tests for streamlined interfaces
- docs: document architectural decisions and learnings in DESIGN.md and LEARNINGS.md
fix: resolve priority 1 correctness and resilience issues
- fix(transport): restrict SO_REUSEADDR to non-Windows platforms to prevent socket hijacking on Winsock
- fix(unity): scope log capture disposal to active operation and tear down CTS outside locks
- fix(models): restore property symmetry on UnityTestRunResult.Interrupted setter
- fix(process): catch UnauthorizedAccessException in ReadFileWithRetry for transient NTFS file contention
- test: add unit tests for Interrupted symmetry and ReadFileWithRetry retry semantics
- docs: record architectural decisions and OS/threading quirks in DESIGN.md and LEARNINGS.md
fix(mcp): enhance SingleOrArray equality and optimize test failure diagnostics
- Implement operator == and operator != on SingleOrArray for value equality per CA2231.
- Make SingleOrArray constructors null-safe against null arrays or collections.
- Map empty and whitespace-only JSON strings to null in SingleOrArrayJsonConverter.
- Cap StructuredTestFailure allocations strictly to detailedCount in UnityTools.
- Read summary test failures directly from results without intermediate allocations.
- Replace bang operators with pattern matching in test runner filter formatting.
- Safeguard short maxLineLength handling in ExtractOneLineSummaryMessage.
- Update DESIGN.md and LEARNINGS.md with design decisions and edge cases.
feat(mcp): consolidate test filter parameters and cap failure stack traces
- Expose only canonical plural filter parameters (testNames, groupNames, categoryNames, assemblyNames) in unity_run_tests tool schema.
- Implement SingleOrArray parameter type with custom JsonConverter to polymorphically accept both raw strings and string arrays from AI agents without schema ambiguity.
- Clarify .NET Regular Expression requirements in groupNames parameter documentation.
- Cap detailed test failure diagnostics (full stack traces, location links, multi-line messages) to first 5 failures.
- Render failures 6 through 25 as concise single-line summaries and cap total failure listing to 25.
- Update DESIGN.md and LEARNINGS.md with design decisions and edge cases.
docs: split FINDINGS.md into DESIGN.md and LEARNINGS.md
docs(mcp): clarify unity_eval top-level script model and namespace requirements (#95)
fix(test-runner): strip internal framework plumbing from test failure stack traces (#93)
fix(test-runner): accept string/array test filters and fix error masking (#91)
- Expose verbatim testNames, groupNames, categoryNames, and assemblyNames to Unity Test Runner Filter API.
- Support both single string aliases (testName, group, category, assembly) and string arrays with clean de-duplication.
- Prioritize surfacing test runner failures over zero-count filter messages to prevent test execution exceptions from being masked.
- Align parameter docstrings to document exact Unity Test Framework filter semantics (.NET regex vs exact name matching).
- Document learnings in FINDINGS.md and add unit/protocol tests.
Closes #91
fix(mcp): format synthetic eval locations and isolate process detection in tests (#92)
-
Disambiguate dynamic snippet compilation from pre-refresh script failures in unity_eval
-
Format synthetic eval locations directly without hallucinating file:/// URIs
-
Split pipe-delimited compiler diagnostics in DiagnosticFormatter
-
Prevent ambient Unity processes from leaking into isolated test directories in UnityProcessManager
-
Document learnings and edge cases in FINDINGS.md
fix(client): strip protocol status prefix on initial error responses (#94)
refactor(mcp): extract UnityExecutableLocator from UnityProcessManager (#96)
Extract Unity executable discovery, editor version parsing, Unity Hub path generation, and PATH resolution from UnityProcessManager into a dedicated UnityExecutableLocator service to satisfy Single Responsibility Principle.
Closes #96
UnityLeanMcp v0.8.0-preview.9
feat: Bumo VERSION to 0.8.0-preview.9
fix(diagnostics): handle cross-platform path rooting in BuildFileUri on Unix
test: modernize test strategy for faster execution and sub-3s local loop
- Add static test assets (DummyTest.cs, DummyExecuteClass.cs) to eliminate dynamic fixture swapping and 22+ domain reloads
- Reuse SharedClient in UnityIntegrationFixture to eliminate 70+ dotnet.exe child process spawns
- Add BusyGracePeriod to UnityClient to accelerate mock tiered autowaiting tests
- Partition tests into Unit, Subsystem, and UnityIntegration xUnit traits for fast local loops
- Record test performance learnings in FINDINGS.md
fix(runner): eliminate NTFS completion race condition via operation-scoped result files (#87)
feat(diagnostics): wire compiler diagnostic parser, cap warnings, and add file URIs (#86)
- Implement unified diagnostic formatting in DiagnosticFormatter with RFC 8089 file URIs
- Cap warnings at 10 to preserve agent context window and omit truncation notice when <= 10
- Position unfiltered compilation errors at the end of the message for LLM recency attention
- Display category headers (Warnings: and Errors:) only when both categories exist
- Unify compilation diagnostics formatting across unity_refresh, unity_run_tests, and unity_eval
- Add comprehensive test cases and record learnings in FINDINGS.md
refactor(mcp): resolve issues #88, #89, and #90
-
Replace hardcoded mutating command checks in UnityLeanMcpServer with polymorphic ICommandHandler properties (IsMutating, RequiresCompilationSettled) (#88)
-
Decompose UnityClient and UnityProcessManager to respect Single Responsibility Principle by extracting UnityLogScanner, UnitySocketTransport, and OperationPoller (#89)
-
Remove unused Structured* response models in Models.cs and deprecate ExecuteMethodAsync (#90)
-
Add DecomposedComponentsTests test suite and update documentation / FINDINGS.md
refactor(mcp): optimize agent workflow and eliminate dual payload returns
- Eliminate dual payload returns (human text + JSON) across all MCP tools to halve token consumption
- Disambiguate void statement completions from explicit null returns in unity_eval
- Clarify unity_refresh tool descriptions and server instructions regarding auto-refresh
- Protect interactive Unity GUI Editor instances from accidental termination in unity_stop via force parameter
- Update build.sh to handle Windows locked DLL publishing using .old fallback
refactor(mcp): retire unity_status and implement tiered autowaiting (#84)
- Remove unity_status from the public MCP tool catalog to reduce prompt token overhead and eliminate redundant pre-flight LLM reasoning turns, while preserving IUnityClient.GetStatusAsync internally for testing and status inspection.
- Implement tiered autowaiting across all mutating operations (refresh, eval, run_tests):
- Autowait without arbitrary timeouts for transient compilation/updating states (BUSY compile, COMPILING, UPDATING) while streaming progress notifications.
- Observe a 3-second grace period for foreign mutating operations (BUSY ) before failing fast with an actionable recovery message directing users/agents to unity_stop.
- Add early worker-thread rejection for mutating commands in UnityLeanMcpServer to prevent main-thread dispatching deadlocks and queue pollution during active operations.
- Update PollRefreshHandler and GetStatusAsync to prioritize durable operation records.
- Update README.md and record architectural learnings in FINDINGS.md.
- Add comprehensive TieredAutowaitingTests test suite and update existing test fixtures.
feat(eval): support multiline C# snippets with using hoisting and zero default usings
-
Detect and extract top-level using statements to file scope outside runner method
-
Blank out extracted using characters with spaces to preserve line offsets for Roslyn diagnostics
-
Preserve IDisposable using statements and using var declarations inside method body
-
Remove implicit default using statements from EvalHandler.cs to eliminate namespace collisions
-
Fully qualify runner method signature with System.Threading.Tasks types so zero-using snippets compile cleanly
-
Update unity_eval tool and parameter descriptions to clarify raw multiline statements and no default imports
-
Add defensive unwrapping for JSON-encoded string inputs
-
Update test suite and documentation; all 206 tests passing
refactor(eval): require explicit returns and enable single-pass AST classification
-
Require explicit 'return ;' statements when returning values to the caller
-
Support natural void completion and early exits with 'return;' without code modification
-
Compile user snippets verbatim as valid C# in a single pass without speculative wrapping
-
Inspect snippet syntax trees via lightweight Roslyn reflection (<0.05ms) in HasTopLevelValueReturn
-
Update MCP tool descriptions, unit tests, and integration tests accordingly
-
Record Roslyn reflection quirks and dynamic evaluation findings in FINDINGS.md
refactor(mcp): retire unity_execute_method in favor of unity_eval
refactor(mcp): merge unity_recompile into unity_refresh with optional clean flag
refactor: rename project from UnityCliRunner to UnityLeanMcp
- Rename Unity package to com.pereviader.unityleanmcp and Editor assembly to UnityLeanMcp.Editor
- Rename .NET MCP server project, assembly, and namespaces to UnityLeanMcp.Mcp
- Update server identifier to unity-lean-mcp across configs, workflows, and documentation
- Remove legacy unity-cli fallbacks
refactor(mcp): streamline unity_status output to concise raw state token
feat(install): Update install api to allow not displaying the success popup
feat: auto-refresh in eval and guide AI tools to avoid redundant refresh calls