Title: Move simulatorPlatform out of sessionDefaults into an internal cache · Issue #366 · getsentry/XcodeBuildMCP · GitHub
Open Graph Title: Move simulatorPlatform out of sessionDefaults into an internal cache · Issue #366 · getsentry/XcodeBuildMCP
X Title: Move simulatorPlatform out of sessionDefaults into an internal cache · Issue #366 · getsentry/XcodeBuildMCP
Description: Problem sessionDefaults.simulatorPlatform is declared as a session default (see src/utils/session-defaults-schema.ts:35-38, described as "Cached inferred simulator platform"), but it does not behave like one. Session defaults are meant t...
Open Graph Description: Problem sessionDefaults.simulatorPlatform is declared as a session default (see src/utils/session-defaults-schema.ts:35-38, described as "Cached inferred simulator platform"), but it does not behav...
X Description: Problem sessionDefaults.simulatorPlatform is declared as a session default (see src/utils/session-defaults-schema.ts:35-38, described as "Cached inferred simulator platform"), but it does...
Opengraph URL: https://github.com/getsentry/XcodeBuildMCP/issues/366
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Move simulatorPlatform out of sessionDefaults into an internal cache","articleBody":"## Problem\n\n`sessionDefaults.simulatorPlatform` is declared as a session default (see `src/utils/session-defaults-schema.ts:35-38`, described as \"Cached inferred simulator platform\"), but it does not behave like one.\n\nSession defaults are meant to be values an agent sets to influence tool calls. `simulatorPlatform` violates that contract:\n\n- It is written automatically by `src/utils/simulator-defaults-refresh.ts` (lines 80, 87) as a side effect of resolving a simulator — not by an agent.\n- It is keyed to another default (`simulatorId` / `simulatorName`) and only trusted when those still match (`src/utils/infer-platform.ts:113-139`, `resolveCachedPlatform`).\n- Its sole consumer is `infer-platform.ts`, which uses it to skip a `simctl list` round-trip.\n\nIn other words, it is internal cache state surfaced through the agent-facing session-defaults schema. Agents that read or write `sessionDefaults` see a field they should not be touching, and any code that legitimately wants to set a project's \"platform\" preference (e.g. the setup wizard in #365) gets pulled into caching semantics it does not want.\n\n## Proposed direction\n\nTwo reasonable options:\n\n1. **Move it to a separate internal cache** that is not part of `sessionDefaults` and is not exposed via `session_set_defaults` / `session_show_defaults` / `session_clear_defaults`. `infer-platform.ts` and `simulator-defaults-refresh.ts` become the only readers/writers.\n2. **Drop the cache entirely** and re-derive the simulator platform on demand from `simulatorId` via `simctl list`. Costs one extra lookup per fresh session; removes a whole class of staleness bugs.\n\nOption 1 preserves the perf optimisation; option 2 is simpler. Either is fine — the key constraint is that `simulatorPlatform` should not be in `sessionDefaults`.\n\n## Out of scope\n\n- `sessionDefaults.platform` — that one is a legitimate agent-controllable default for device tools and should stay.\n- The setup-wizard layering issue surfaced in #365 — that PR should stop writing to either field; this issue is the follow-up cleanup.\n\n## Affected files (current state)\n\n- `src/utils/session-defaults-schema.ts` — declares the field\n- `src/utils/simulator-defaults-refresh.ts` — writer\n- `src/utils/infer-platform.ts` — reader\n- `src/mcp/tools/session-management/session_*.ts` — surfaces it to agents\n- `src/utils/renderers/domain-result-text.ts`, `src/types/domain-results.ts` — render/type plumbing","author":{"url":"https://github.com/cameroncooke","@type":"Person","name":"cameroncooke"},"datePublished":"2026-04-26T20:08:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/366/XcodeBuildMCP/issues/366"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:489ef412-3a77-21b4-e3a8-32e6f92e9c62 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C0DC:1D6E0:4B6756:6B69C2:6A4E7054 |
| html-safe-nonce | cd5c708059b7a228b80ae145650641ebabb7700c32072e9a182bf425d0e84887 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMERDOjFENkUwOjRCNjc1Njo2QjY5QzI6NkE0RTcwNTQiLCJ2aXNpdG9yX2lkIjoiMTA4MjE1NzMxMTY4ODg2MzgyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bb6c0d11f6702f5dd4c016de7535a440c9bde0ff8f8d792d90c6f5a4a528bac4 |
| hovercard-subject-tag | issue:4331861529 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/XcodeBuildMCP/366/issue_layout |
| twitter:image | https://opengraph.githubassets.com/be4ec925156b07cdd174b3692b4c4f8dd6652042b367b6d93b9f4bbf888d2682/getsentry/XcodeBuildMCP/issues/366 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/be4ec925156b07cdd174b3692b4c4f8dd6652042b367b6d93b9f4bbf888d2682/getsentry/XcodeBuildMCP/issues/366 |
| og:image:alt | Problem sessionDefaults.simulatorPlatform is declared as a session default (see src/utils/session-defaults-schema.ts:35-38, described as "Cached inferred simulator platform"), but it does not behav... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cameroncooke |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/XcodeBuildMCP git https://github.com/getsentry/XcodeBuildMCP.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 945551361 |
| octolytics-dimension-repository_nwo | getsentry/XcodeBuildMCP |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 945551361 |
| octolytics-dimension-repository_network_root_nwo | getsentry/XcodeBuildMCP |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width