Repository navigation
refactor: realign fork-only helpers with upstream idioms - #12
Merged
Merged
Conversation
- Skill sync: detect a git-installed package with PackageInfo.FindForAssembly (source == PackageSource.Git, URL from packageId), like AssetPathUtility, instead of parsing Packages/manifest.json with host-name heuristics. - Skill sync: run git through ExecPath.TryRun and quote with AssetPathUtility.QuoteCommandLineArg, dropping the duplicate RunProcess and QuoteProcessArgument helpers. - run_tests: key the test job cache like the focus-nudge state (transport_mode, user_id, instance hash, job_id), reading user_id only when remote-hosted as get_test_job already did, and use OrderedDict for LRU. - Middleware: read the tool name from context.message.name instead of probing several attribute names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Part 3 of the fork alignment audit (follows #11): keep the fork-only behavior, but write it the way upstream already does. Net −132 lines.
PackageInfo.GetDefaultRepoUrlnow usesPackageInfo.FindForAssembly(same idiom asAssetPathUtility): whensource == PackageSource.Git, the repo URL is taken frompackageId(name@<url as written in manifest.json>). This replaces hand-parsingPackages/manifest.jsonplusLooksLikeGitPackageUrl, which guessed git-ness from host names (github/gitlab) and special-cased barefile:URIs. Unity already knows the source, so the heuristics are gone.ExecPath.TryRun. Drops the duplicateRunProcess(its ownProcessplumbing and 120s timeout) andQuoteProcessArgument, which used different quoting rules fromAssetPathUtility.QuoteCommandLineArg; both now go through the shared helpers.(transport_mode, user_id, instance_hash, job_id)instead of a custom"user:…|instance:…"string.user_idis read only when remote-hosted, exactly asget_test_jobalready did for the nudge (it is only ever resolved from API keys in remote-hosted mode, so production behavior is unchanged). LRU usesOrderedDict.move_to_end/popitem(last=False)like_nudge_states.context.message.name. Replaces_command_name_from_context, which probedname/tool_name/commandattributes plus a dict branch; mirrors how the same method already readscontext.message.arguments.Test plan
test_cached_test_jobs_are_scoped_by_user_for_same_instancenow setshttp_remote_hosted=True(the only mode whereuser_idexists); LRU test asserts the new key tuple.SkillSyncServiceTests6/6 (packageId parsing for https,git+https, scp-stylegit@, no@; non-git install falls back to upstream).https://github.com/onlyfeng/unity-mcp.git?path=/MCPForUnity#refactor/align-fork-helpers-with-upstreamreportssource=Git,packageId=com.coplaydev.unity-mcp@https://github.com/onlyfeng/unity-mcp.git?path=/MCPForUnity#refactor/align-fork-helpers-with-upstream, andGetDefaultRepoUrl()returnshttps://github.com/onlyfeng/unity-mcp.git.🤖 Generated with Claude Code