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 PR has been inactive for 21 days. It will be closed in 7 days if no further activity occurs. Add a comment to keep it open, or apply the |
|
Still current as of today's I merged this branch onto Happy to rebase or adjust anything if that helps review. |
|
A quick CI update: the fork workflow for this PR is marked failed, but it recorded zero jobs, so there is no test failure to diagnose. The linked issue #551 was also closed by the stale bot on November 20. Could a maintainer help queue a fresh CI run and add |
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