feat: expose watch expression tools#1731
Merged
Merged
Conversation
Expose watch registration, clearing, and history retrieval through Unity tools and the CLI command catalog. Mirror the response shape in Go, document per-step evaluation and domain-reload behavior, and preserve explicit compile and evaluation errors for agent-visible diagnostics.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (8)
📒 Files selected for processing (14)
📝 WalkthroughWalkthroughAdded watch-expression CLI tools for registering, clearing, and retrieving expressions evaluated during paused Play Mode. The change includes editor monitoring, bounded history, response contracts across C# and Go, validation tests, shared fixtures, command help coverage, and documentation. ChangesWatch expressions
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant EnableWatchTool
participant WatchUseCase
participant WatchExpressionCompiler
participant WatchExpressionRegistry
participant EditorUpdateMonitor
CLI->>EnableWatchTool: enable-watch request
EnableWatchTool->>WatchUseCase: ExecuteAsync(parameters)
WatchUseCase->>WatchExpressionCompiler: Compile expression
WatchUseCase->>WatchExpressionRegistry: Register watch with max history
WatchUseCase->>EditorUpdateMonitor: Ensure monitor started
EditorUpdateMonitor->>WatchExpressionRegistry: Evaluate watches on changed frame
WatchExpressionRegistry-->>CLI: Watch history and errors
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Keep the Unity WatchResponse DTO aligned with the shared CLI contract the same way pause-point-status already does, so C# field drift is caught without relying only on Go round-trip coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Watch enable/clear/get-values already execute through runDynamicProjectTool with no project-runner handlers, so native registry entries and the help/completion shims only added special-case complexity. Keep the default-tools.json schemas and let the existing FindDefaultTool fallback serve help and completion. Co-authored-by: Cursor <cursoragent@cursor.com>
Call out that enable-watch fails on an existing id so agents clear before re-registering, and remove the ValidateEnable parameters null guard that the tool host never hits. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary\n\n- add enable-watch, clear-watch, and get-watch-values with bounded histories, baseline evaluation, compile diagnostics, and typed evaluation errors\n- register the watch commands in the CLI catalog, preserve schema-driven help and completion, and add a field-for-field Go response contract\n- document watch expressions, raw pause-point values, per-Step evaluation, error history, and domain-reload lifetime in the source skill and regenerated copies\n\n## Validation\n\n- Unity compile: 0 errors, 0 warnings\n- targeted Watch EditMode tests: 14/14 passed\n- scripts/check-go-cli.sh: passed\n- CLI help exposes --expression, --id, and --max-history (1-100)\n- E2E with dist/darwin-arm64/uloop: baseline frame 846 grew to 846, 847, 848, 849 across three Editor Steps\n- a throwing expression recorded System.FormatException and its message while Step continued\n- compile/domain reload cleared the in-memory watch registry\n- no dedicated jumping-ball scene exists in this checkout, so the equivalent Update path in SimulateMouseDemoScene was used; no PATH-resolved uloop was used