Skip to content

chore: bump version to 9.6.5#1027

Merged
github-actions[bot] merged 32 commits intomainfrom
release/v9.6.5
Apr 3, 2026
Merged

chore: bump version to 9.6.5#1027
github-actions[bot] merged 32 commits intomainfrom
release/v9.6.5

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 3, 2026

Automated version bump to 9.6.5.

zaferdace and others added 30 commits March 29, 2026 16:20
Adds a built-in `execute_code` tool that compiles and runs C# code
inside the Unity Editor via CSharpCodeProvider. No external dependencies
(Roslyn not required), no script files created.

## Actions
- `execute` — compile and run C# method body, return result
- `get_history` — list past executions with previews
- `replay` — re-run a history entry with original settings
- `clear_history` — clear execution history

## Safety
- `safety_checks` (default: true) blocks known dangerous patterns
  (File.Delete, Process.Start, AssetDatabase.DeleteAsset, infinite loops)
- Clearly documented as pattern-based blocklist, NOT a security sandbox
- `destructiveHint=True` annotation for MCP clients

## Features
- In-memory compilation with all loaded assembly references
- User-friendly error line numbers (wrapper offset subtracted)
- Execution history (max 50 entries) with code preview truncation
- Replay preserves original safety_checks setting
- CLI commands: `code execute`, `code history`, `code replay`, `code clear-history`

## Files
- C#: `MCPForUnity/Editor/Tools/ExecuteCode.cs` (329 lines)
- Python: `Server/src/services/tools/execute_code.py` (85 lines)
- CLI: `Server/src/cli/commands/code.py` (+89 lines)
- Tests: `Server/tests/test_execute_code.py` (17 tests, all passing)
- Manifest: added `execute_code` entry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix off-by-one in WrapperLineOffset (9 → 10)
- Cache resolved assembly paths in static field for performance
- Add encoding="utf-8" to CLI file read
- Add group="scripting_ext" to Python tool decorator

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address CodeRabbit nitpick — deduplicate result printing logic
between execute and replay commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
manage_gameobject already serializes isStatic in read output
(GameObjectSerializer, GameObjectResource) but the modify action
had no parameter to write it.

This adds is_static (bool) across all three layers:
- C#: GameObjectModify.cs calls GameObjectUtility.SetStaticEditorFlags()
- Python MCP tool: manage_gameobject.py with coerce_bool normalization
- Python CLI: gameobject.py with --static/--no-static flag

When true, all static flags are set; when false, all are cleared.
Omitting the parameter is a no-op (fully backwards compatible).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover: is_static=True, is_static=False, string coercion
("true" → True), and omission (isStatic excluded from params).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ects

targetGo.isStatic returns true when *any* flag is set, so a partially
static object (e.g. only Navigation) would skip the update when
is_static=true was requested. Compare GetStaticEditorFlags() against
the desired flags instead.

Also adds a "false" string coercion test per review feedback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…781673286

chore: sync main (v9.6.4) into beta
…04570893

chore: update Unity package to beta version 9.6.5-beta.2
…31441803

chore: update Unity package to beta version 9.6.5-beta.3
…tatic

feat(manage_gameobject): add is_static parameter to modify action
…33079179

chore: update Unity package to beta version 9.6.5-beta.4
feat: add execute_code tool for running arbitrary C# in Unity Editor
…67371489

chore: update Unity package to beta version 9.6.5-beta.5
Copy link
Copy Markdown
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 @github-actions[bot], your pull request is larger than the review limit of 150000 diff characters

@github-actions github-actions bot merged commit 940831f into main Apr 3, 2026
1 check passed
@github-actions github-actions bot deleted the release/v9.6.5 branch April 3, 2026 04:30
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.

3 participants