Skip to content

chore: Remove JSON-RPC static processor wrapper#1558

Merged
hatayama merged 3 commits into
v3-betafrom
codex/json-rpc-processor-instance-tests
Jul 6, 2026
Merged

chore: Remove JSON-RPC static processor wrapper#1558
hatayama merged 3 commits into
v3-betafrom
codex/json-rpc-processor-instance-tests

Conversation

@hatayama

@hatayama hatayama commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • migrate JSON-RPC processor tests to construct JsonRpcRequestProcessor with injected registrar services instead of using the JsonRpcProcessor static compatibility wrapper
  • delete JsonRpcProcessor.cs and preserve the extension-facing UnityCliLoopToolRegistrar facade for CompositionRoot and public registrar APIs
  • update the IPC reminder fixture and stale comment to point at JsonRpcRequestProcessor

Verification

  • dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)" -> 0 errors / 0 warnings
  • related EditMode: JsonRpcRequestProcessorCliVersionGateTests|JsonRpcHeartbeatTests|StaticFacadeStateGuardTests|UnityCliLoopToolRegistryTests|OnionAssemblyDependencyTests -> 153/153 passed
  • dead-code scanner: no JsonRpcProcessor type remains; only JsonRpcRequestProcessor DTO reflection keeps reported
  • grep: no JsonRpcProcessor.cs, static class JsonRpcProcessor, or JsonRpcProcessor. references remain
  • scripts/check-go-cli.sh -> passed

Notes

  • ApplicationRegistrar.Service usage is removed from JSON-RPC tests; the registrar facade remains intentionally covered by UnityCliLoopToolRegistryTests and registered from CompositionRoot.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hatayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4d28573f-16e4-484f-a560-662ec0dfda69

📥 Commits

Reviewing files that changed from the base of the PR and between 199ad68 and c4e6cce.

⛔ Files ignored due to path filters (2)
  • Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs.meta is excluded by none and included by none
  • Packages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs.meta is excluded by none and included by none
📒 Files selected for processing (6)
  • Assets/Tests/Editor/JsonRpcHeartbeatTests.cs
  • Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs
  • Packages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs
  • Packages/src/Editor/Infrastructure/Api/JsonRpcRequestProcessor.cs
  • Packages/src/Editor/Infrastructure/CLI/CliPinReaderService.cs
  • cli/release-automation/internal/automation/ipc_protocol_reminder_test.go
📝 Walkthrough

Walkthrough

The static JsonRpcProcessor class and its ProcessRequest method are removed from the Infrastructure API. Test suites, an inline comment, and IPC protocol reminder automation checks are updated to reference the instance-based JsonRpcRequestProcessor instead, with new test helper methods for processor creation.

Changes

JsonRpcProcessor to JsonRpcRequestProcessor Migration

Layer / File(s) Summary
Remove static entrypoint
Packages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs
The static JsonRpcProcessor class and its ProcessRequest method are deleted entirely.
Add processor test harness helpers
Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs
New private helpers CreateRegistrarService(), CreateProcessor(), and CreateProcessor(service) construct an instance-based JsonRpcRequestProcessor; test class renamed from JsonRpcProcessorCliVersionGateTests.
Update version-gate tests
Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs
All protocol match/mismatch, missing/malformed metadata, single-flight busy, dynamic-code scheduling, compile dispatch policy, hierarchy/logs sequencing, internal bridge, and cancellation tests now use the processor instance; old ApplicationRegistrar restore teardown removed.
Update heartbeat tests
Assets/Tests/Editor/JsonRpcHeartbeatTests.cs
Dispatch-accepted response and heartbeat response calls switched to JsonRpcRequestProcessor.
Update supporting comments and automation checks
Packages/src/Editor/Infrastructure/CLI/CliPinReaderService.cs, cli/release-automation/internal/automation/ipc_protocol_reminder_test.go
Inline comment and IPC protocol reminder test expectations updated to reference JsonRpcRequestProcessor.cs.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#1240: Both PRs modify the same JsonRpcProcessorCliVersionGateTests*.cs suite, swapping call sites between JsonRpcProcessor.* and JsonRpcRequestProcessor.*.
  • hatayama/unity-cli-loop#1215: Updates the same CLI version-gate test suite's server_busy assertions and hierarchy/logs regression test touched here.
  • hatayama/unity-cli-loop#1321: Also modifies Packages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs, related to its removal in this PR.

Poem
A rabbit hopped through code so neat,
Retired JsonRpcProcessor's old seat,
JsonRpcRequestProcessor takes the stage,
Tests rewritten, turn the page,
Helpers built, the gate stands tall,
One clean hop instead of all. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing the static JSON-RPC processor wrapper.
Description check ✅ Passed The description matches the changeset by describing the processor migration, wrapper removal, and related test and fixture updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/json-rpc-processor-instance-tests

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 added 2 commits July 6, 2026 23:13
Construct JsonRpcRequestProcessor with local registrar services in the JSON-RPC tests so they no longer depend on ApplicationRegistrar.Service. Keep the assertions and async coordination patterns intact while preserving the registrar facade for extension API coverage.
Remove the compatibility wrapper once the tests use injected JsonRpcRequestProcessor instances and the scanner shows no production dependency. Update the IPC reminder fixture and pin-reader comment to reference the remaining request processor file.
@hatayama
hatayama force-pushed the codex/json-rpc-processor-instance-tests branch from 199ad68 to 57bfe15 Compare July 6, 2026 14:14

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs (1)

176-191: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a shared helper for the repeated registrar+tool+processor setup.

The CreateRegistrarService()service.RegisterCustomTool(...)CreateProcessor(service) sequence is repeated across ~8 test methods. A small overload like CreateProcessor(IUnityCliLoopTool tool) would collapse this into a one-liner per test.

♻️ Example helper
+        private static JsonRpcRequestProcessor CreateProcessor(IUnityCliLoopTool customTool)
+        {
+            UnityCliLoopToolRegistrarService service = CreateRegistrarService();
+            service.RegisterCustomTool(customTool);
+            return CreateProcessor(service);
+        }

Also applies to: 226-251, 284-306, 308-330, 332-357, 359-384, 386-410, 509-522, 551-567

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs` around
lines 176 - 191, The registrar/tool/processor setup is duplicated across
multiple tests, so add a shared helper to centralize it. Introduce an overload
like CreateProcessor(IUnityCliLoopTool tool) or a similarly named helper that
calls CreateRegistrarService(), RegisterCustomTool(...), and
CreateProcessor(service) in one place, then update the affected tests (including
the SingleFlightTestTool cases) to use it instead of repeating the sequence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs`:
- Around line 176-191: The registrar/tool/processor setup is duplicated across
multiple tests, so add a shared helper to centralize it. Introduce an overload
like CreateProcessor(IUnityCliLoopTool tool) or a similarly named helper that
calls CreateRegistrarService(), RegisterCustomTool(...), and
CreateProcessor(service) in one place, then update the affected tests (including
the SingleFlightTestTool cases) to use it instead of repeating the sequence.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 833e8560-4655-4dfd-a64d-0b04f2a22ab7

📥 Commits

Reviewing files that changed from the base of the PR and between 7a45175 and 199ad68.

⛔ Files ignored due to path filters (2)
  • Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs.meta is excluded by none and included by none
  • Packages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs.meta is excluded by none and included by none
📒 Files selected for processing (5)
  • Assets/Tests/Editor/JsonRpcHeartbeatTests.cs
  • Assets/Tests/Editor/JsonRpcRequestProcessorCliVersionGateTests.cs
  • Packages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs
  • Packages/src/Editor/Infrastructure/CLI/CliPinReaderService.cs
  • cli/release-automation/internal/automation/ipc_protocol_reminder_test.go
💤 Files with no reviewable changes (1)
  • Packages/src/Editor/Infrastructure/Api/JsonRpcProcessor.cs

Remove the overloaded test helper shape and update remaining JSON-RPC log tags to the surviving request processor name after deleting the static wrapper.
@hatayama
hatayama merged commit 3242495 into v3-beta Jul 6, 2026
10 checks passed
@hatayama
hatayama deleted the codex/json-rpc-processor-instance-tests branch July 6, 2026 14:23
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