Skip to content

feat: expose watch expression tools#1731

Merged
hatayama merged 4 commits into
feat/pause-point-watchfrom
feat/pause-point-watch-tools
Jul 12, 2026
Merged

feat: expose watch expression tools#1731
hatayama merged 4 commits into
feat/pause-point-watchfrom
feat/pause-point-watch-tools

Conversation

@hatayama

@hatayama hatayama commented Jul 12, 2026

Copy link
Copy Markdown
Owner

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

Review in cubic

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.
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cf6d7b57-e85a-4a4b-a217-46d69254cb11

📥 Commits

Reviewing files that changed from the base of the PR and between 6d7111e and ece8a86.

⛔ Files ignored due to path filters (8)
  • Assets/Tests/Editor/UnityCLILoop.Tests.Editor.asmdef is excluded by none and included by none
  • Assets/Tests/Editor/WatchResponseContractTests.cs.meta is excluded by none and included by none
  • Assets/Tests/Editor/WatchToolTests.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/UnityCLILoop.FirstPartyTools.Editor.asmdef is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Watch/AssemblyInfo.cs.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Watch/UnityCLILoop.FirstPartyTools.Watch.Editor.asmdef is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Watch/UnityCLILoop.FirstPartyTools.Watch.Editor.asmdef.meta is excluded by none and included by none
  • Packages/src/Editor/FirstPartyTools/Watch/WatchTools.cs.meta is excluded by none and included by none
📒 Files selected for processing (14)
  • .agents/skills/uloop-pause-point/SKILL.md
  • .claude/skills/uloop-pause-point/SKILL.md
  • Assets/Tests/Editor/WatchResponseContractTests.cs
  • Assets/Tests/Editor/WatchToolTests.cs
  • Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/AssemblyInfo.cs
  • Packages/src/Editor/FirstPartyTools/Watch/AssemblyInfo.cs
  • Packages/src/Editor/FirstPartyTools/Watch/WatchTools.cs
  • Packages/src/Editor/ToolContracts/UnityCliLoopConstants.cs
  • cli/common/tools/default-tools.json
  • cli/dispatcher/internal/dispatcher/help_test.go
  • cli/project-runner/internal/projectrunner/watch_response_contract_test.go
  • cli/project-runner/internal/projectrunner/watch_types.go
  • tests/contracts/watch_response_contract.json

📝 Walkthrough

Walkthrough

Added 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.

Changes

Watch expressions

Layer / File(s) Summary
Watch command and response contracts
Packages/src/Editor/ToolContracts/UnityCliLoopConstants.cs, Packages/src/Editor/FirstPartyTools/Watch/WatchTools.cs, cli/common/tools/default-tools.json
Adds watch command names, request schemas, response models, tool registrations, and default CLI schemas.
Watch execution and editor monitoring
Packages/src/Editor/FirstPartyTools/Watch/WatchTools.cs, Packages/src/Editor/FirstPartyTools/.../AssemblyInfo.cs
Validates requests, compiles and registers expressions, manages bounded history, starts the editor monitor, and shapes success, failure, and compilation responses.
Cross-language response contract
cli/project-runner/internal/projectrunner/watch_types.go, tests/contracts/watch_response_contract.json
Defines Go response DTOs and a shared JSON fixture for watch response field shapes.
Validation and usage documentation
Assets/Tests/Editor/Watch*, cli/.../help_test.go, cli/.../watch_response_contract_test.go, .agents/skills/..., .claude/skills/..., Packages/src/Editor/CliOnlyTools~/...
Adds validation, empty-state, help, serialization-contract tests, and documentation for watch registration, evaluation, history, errors, and lifecycle behavior.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding watch expression tools.
Description check ✅ Passed The description matches the changeset and covers tools, docs, contracts, and validation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pause-point-watch-tools

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.

hatayama and others added 3 commits July 12, 2026 21:11
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>
@hatayama
hatayama merged commit ec19976 into feat/pause-point-watch Jul 12, 2026
2 checks passed
@hatayama
hatayama deleted the feat/pause-point-watch-tools branch July 12, 2026 12:22
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