Title: Remove dead `liveProgressEnabled` and `streamingFragmentsEnabled` from ToolHandlerContext · Issue #360 · getsentry/XcodeBuildMCP · GitHub
Open Graph Title: Remove dead `liveProgressEnabled` and `streamingFragmentsEnabled` from ToolHandlerContext · Issue #360 · getsentry/XcodeBuildMCP
X Title: Remove dead `liveProgressEnabled` and `streamingFragmentsEnabled` from ToolHandlerContext · Issue #360 · getsentry/XcodeBuildMCP
Description: Problem ToolHandlerContext exposes two booleans that aren't actually used by tools and leak a wire-layer concern into the public tool contract: // src/rendering/types.ts interface ToolHandlerContext { emit: (fragment: AnyFragment) => voi...
Open Graph Description: Problem ToolHandlerContext exposes two booleans that aren't actually used by tools and leak a wire-layer concern into the public tool contract: // src/rendering/types.ts interface ToolHandlerContex...
X Description: Problem ToolHandlerContext exposes two booleans that aren't actually used by tools and leak a wire-layer concern into the public tool contract: // src/rendering/types.ts interface ToolHandlerCo...
Opengraph URL: https://github.com/getsentry/XcodeBuildMCP/issues/360
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remove dead `liveProgressEnabled` and `streamingFragmentsEnabled` from ToolHandlerContext","articleBody":"## Problem\n\n`ToolHandlerContext` exposes two booleans that aren't actually used by tools and leak a wire-layer concern into the public tool contract:\n\n```typescript\n// src/rendering/types.ts\ninterface ToolHandlerContext {\n emit: (fragment: AnyFragment) =\u003e void\n attach: (image: ImageAttachment) =\u003e void\n liveProgressEnabled: boolean // ← effectively unread\n streamingFragmentsEnabled: boolean // ← wire-layer leak\n nextStepParams?: NextStepParamsMap\n nextSteps?: NextStep[]\n structuredOutput?: StructuredToolOutput\n}\n```\n\n## Evidence\n\n**No tool branches on either flag.** Searched all of `src/mcp/` for reads of these fields:\n\n- `src/mcp/tools/xcode-ide/shared.ts:19` — declares `readonly liveProgressEnabled = false` as a class member, never reads it.\n- `src/mcp/resources/devices.ts:25-26`, `src/mcp/resources/simulators.ts:25-26` — pass-through wiring that sets both to `false`, never reads them.\n- Zero other tool-side reads.\n\n**`liveProgressEnabled` is dead in `DefaultStreamingExecutionContext` too:**\n\n```typescript\n// src/utils/execution/tool-execution-context.ts\nconstructor(options) {\n this.liveProgressEnabled = options.liveProgressEnabled ?? true; // stored\n this.fragmentCallback = options.onFragment;\n}\n\nemitFragment(fragment) {\n this.fragmentCallback?.(fragment); // does NOT branch on liveProgressEnabled\n}\n```\n\nThe class stores `liveProgressEnabled` and exposes it publicly but never reads its own copy.\n\n**`streamingFragmentsEnabled` does one thing, in one place:**\n\n```typescript\n// src/utils/tool-execution-compat.ts\nonFragment: ctx.streamingFragmentsEnabled ? (fragment) =\u003e ctx.emit(fragment) : undefined\n```\n\nA single wire-layer decision: subscribe to fragments, or don't. The tool never needs to know.\n\n## Why this matters\n\nThe boundary already has all the information it needs to decide what to do with fragments:\n\n- Runtime kind (`cli` / `mcp` / `daemon`) is set at session creation in `src/runtime/types.ts:19`.\n- Output format (`text` / `json` / `jsonl` / `raw`) is known at the CLI command boundary in `src/cli/register-tool-commands.ts`.\n- Render strategy (`text` / `cli-text` / `raw`) is selected per session in `src/rendering/render.ts`.\n\nTools should always emit fragments. Whether those fragments are forwarded, recorded, or dropped is a render-session/wire-boundary concern, not a tool-contract concern.\n\n## Proposed change\n\nRemove both fields from `ToolHandlerContext`. Push the wire decision down into the layers that already know:\n\n1. **`src/rendering/types.ts`** — drop `liveProgressEnabled` and `streamingFragmentsEnabled` from `ToolHandlerContext`.\n2. **`src/utils/tool-execution-compat.ts`** — collapse `createStreamingExecutionContext` so `onFragment` is always wired; let the render session decide what to do with fragments based on its strategy.\n3. **`src/utils/execution/tool-execution-context.ts`** — drop `liveProgressEnabled` from `DefaultStreamingExecutionContext` and `StreamingExecutionContextOptions`. (`StreamingExecutionContext` in `src/types/tool-execution.ts:14` would lose it too.)\n4. **`src/cli/register-tool-commands.ts`** — replace the per-call `liveProgressEnabled`/`streamingFragmentsEnabled` wiring (around lines 76-80, 362) with a single render-session strategy selection.\n5. **`src/utils/tool-registry.ts`** — drop the `liveProgressEnabled: false` / `streamingFragmentsEnabled: false` initialization (around lines 309-310). MCP-side handlers will just have their fragments captured by the render session as today.\n6. **`src/runtime/tool-invoker.ts`** — drop the duplicated wiring at lines 465-466, 511-512, 537-538.\n7. **`src/daemon/daemon-server.ts`** — the divergent `liveProgressEnabled: false` / `streamingFragmentsEnabled: true` case (lines 181-182) becomes a daemon-side render strategy choice rather than a tool-context flag.\n8. **`src/mcp/resources/devices.ts`, `simulators.ts`** and **`src/mcp/tools/xcode-ide/shared.ts`** — remove the now-dead initializations.\n9. **Test fixtures** in `src/test-utils/test-helpers.ts` and any `__tests__/*.ts` that set these fields manually — drop the field passes.\n\nAfter this, the resulting `ToolHandlerContext` is:\n\n```typescript\ninterface ToolHandlerContext {\n emit: (fragment: AnyFragment) =\u003e void\n attach: (image: ImageAttachment) =\u003e void\n nextStepParams?: NextStepParamsMap\n nextSteps?: NextStep[]\n structuredOutput?: StructuredToolOutput\n}\n```\n\n## Migration impact\n\nExternal impact is minimal. These fields aren't part of any public type-author API; they're internal to the runtime layer. Tool authors don't read them (verified above). Test fixtures will need a small mechanical update.\n\nThe daemon's \"forward fragments to client without rendering them locally\" behavior is preserved by selecting a daemon-appropriate render strategy instead of toggling two booleans on the tool context.\n\n## Background\n\nSurfaced during a docs accuracy audit of `xcodebuildmcp.com/app/docs/_content/architecture.mdx`. Full investigation report at `/Volumes/Developer/xcodebuildmcp.com/docs/investigations/architecture-doc-accuracy-audit-2026-04-25.md` (Finding 6). The architecture doc has been pre-emptively updated to omit these two fields from the documented `ToolHandlerContext` shape, on the assumption that this issue lands.\n\n## Acceptance criteria\n\n- [ ] Both fields removed from `ToolHandlerContext` and `StreamingExecutionContext`.\n- [ ] All tool, resource, and test-fixture sites updated.\n- [ ] Daemon \"forward without rendering\" case preserved via render-strategy selection.\n- [ ] No regressions in snapshot tests or smoke tests.\n- [ ] Architecture doc stays accurate (no re-introduction of these fields).","author":{"url":"https://github.com/cameroncooke","@type":"Person","name":"cameroncooke"},"datePublished":"2026-04-25T08:57:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/360/XcodeBuildMCP/issues/360"}
| 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:2ca00f8c-ac32-c825-c419-c6d4b4cba564 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E85C:1F2B7F:2ABBE7:38663F:6A4D433C |
| html-safe-nonce | 5a7ad12ccd364fa33b51cb4a0a6186ef3c16d1757ea5a62572b55079b989b638 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODVDOjFGMkI3RjoyQUJCRTc6Mzg2NjNGOjZBNEQ0MzNDIiwidmlzaXRvcl9pZCI6Ijg2MzI5MTMxODQ3NTgyNTIzNDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f965b4e42f2a242a3a1780e54315df9532ffc66f6ac5b3dc68b67a48bca320bd |
| hovercard-subject-tag | issue:4327639357 |
| 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/360/issue_layout |
| twitter:image | https://opengraph.githubassets.com/870a503bdd87e56966d41b8d89649a51d5b0dbe76b4625fa3f3a9a3521ec89ec/getsentry/XcodeBuildMCP/issues/360 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/870a503bdd87e56966d41b8d89649a51d5b0dbe76b4625fa3f3a9a3521ec89ec/getsentry/XcodeBuildMCP/issues/360 |
| og:image:alt | Problem ToolHandlerContext exposes two booleans that aren't actually used by tools and leak a wire-layer concern into the public tool contract: // src/rendering/types.ts interface ToolHandlerContex... |
| 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 | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| 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 | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width