Repository navigation
Conversation
The CLI merges session defaults into the explicit args before the tool handler checks mutually exclusive pairs, and the CLI's own pair list did not include bundleId/pid. With sessionDefaults.bundleId set, `debugging attach --pid` reached debug_attach_sim with both keys and was rejected. Add the pair so an explicit pid drops the defaulted bundleId, as the MCP path already does.
This branch has not been deployed
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.
Fixes #551.
Cause
On the CLI path,
register-tool-commands.tsmerges the configured session defaults into the explicit arguments (mergeCliSessionDefaults) before it calls the tool handler. That merge drops a defaulted key when the user passes the other key of an exclusive pair, but the CLI's own pair list only hadprojectPath/workspacePathandsimulatorId/simulatorName.debug_attach_simdeclares['bundleId', 'pid']as exclusive, so withsessionDefaults.bundleIdset,debugging attach --pid <pid>reached the handler with both keys as explicit arguments and failed the mutual-exclusion check. Over MCP the handler's own merge already drops the default, which is why only the CLI was affected.Change
['bundleId', 'pid']toCLI_SESSION_DEFAULT_EXCLUSIVE_PAIRS, so an explicitpiddrops the configuredbundleId(and an explicitbundleIdwould drop a defaultedpid). The list is typed asExclusiveParameterGroup[]becausepidis not a session-default key.src/cli/__tests__/session-defaults.test.ts:--pidwith a configuredbundleId, and--json '{"pid":…,"bundleId":null}'. Both fail onmainand pass with the change.[Unreleased].debug_attach_simis the only tool that declarespid, and passingbundleIdandpidtogether explicitly is still rejected by the handler.Testing
On macOS 26 (arm64), Node 26.11:
npm run build,npm run typecheck,npm run lint,npm run format:check: all pass.npm test: 243 files, 2593 tests passed. The pre-commit hook passed on the commit..mobilebuildmcp/config.yamlsettingsessionDefaults.bundleIdandsimulatorId, thennode build/cli.js debugging attach --simulator-id <udid> --pid <pid> --continue-on-attach true --output json:main:Parameter validation failed: Invalid parameters: Mutually exclusive parameters provided: bundleId, pid.(MUTUALLY_EXCLUSIVE_PARAMETERS)processId. In my run, lldb then declined because the session was non-interactive over ssh (cannot get permission to debug processes), which is a local debugger-permission limit, not part of this change.I also went through the
mobilebuildmcp-runtime-boundary-reviewguardrails by hand (shared handlers androuting.statefuldaemon routing are unchanged; the daemon receives the already-merged args). ThewardenCLI was not available here, so that review was not run through Warden.This change was prepared with AI assistance (Claude Code); the checks above were run as described.
🤖 Generated with Claude Code