Commit dbb2d3b
feat(log-capture): Durable OSLog session tracking and executor settlement fixes (#336)
* fix(snapshot-tests): Align MCP and CLI transcript fixtures
Route shared xcodebuild snapshot scenarios through canonical CLI fixtures and make MCP durable text rendering use the same non-interactive transcript formatter. This removes MCP-specific newline drift and keeps test discovery formatting consistent across success and failure paths.
Also surface selective test targeting in test headers and limit discovery previews to the first six tests so the canonical fixtures stay readable while preserving parity across runtimes.
Co-Authored-By: OpenAI Codex <noreply@openai.com>
* fix(command): Settle executor on exit+streams-drained instead of close alone
The close event can be delayed indefinitely when a detached grandchild
inherits stdout/stderr file descriptors. Replace the single close listener
with a state machine that tracks open streams, observes exit, and settles
when both conditions are met. A 100ms safety timer after exit handles the
case where streams never drain. The close event remains a final authority
that forces immediate settlement.
* fix(test-common): Finalize xcodebuild pipeline on post-startup exceptions
When the executor throws after startBuildPipeline has been called, the
pipeline response was left in a pending state with no output. Hoist the
started variable above the try block so the catch handler can call
finalizeInlineXcodebuild and produce a proper error response with build
log links.
* feat(log-capture): Add durable OSLog session tracking with cross-process registry
Detached simctl log stream helper processes were spawned fire-and-forget
with no tracking, accumulating silently across server restarts. Add a
filesystem-backed registry under ~/Library/Developer/XcodeBuildMCP/state/
that records each helper's PID, owner instance, and expected command
signature. Liveness is verified via ps command matching to handle PID
recycling.
On app launch, existing sessions for the same simulator+bundleId are
cleaned up before spawning a new helper. On app stop, tracked sessions
are terminated alongside the simctl terminate call. On server shutdown,
only sessions owned by the current process are stopped. The lifecycle
snapshot and session status resource expose tracked session counts for
observability.
* fix(simulator): Persist launch-owned OSLog sessions
Track simulator launch OSLog helpers in a durable registry so stop and shutdown can
clean them up across independent CLI and MCP process lifetimes.
Keep lifecycle visibility accurate for parallel runs, prune stale or corrupt
registry entries, and tighten the related command and rendering refactors that
support the new ownership model.
Refs GH-273
Co-Authored-By: OpenAI Codex <noreply@openai.com>
* ref(simulator): Harden OSLog session tracking
Batch registry PID sampling so durable OSLog cleanup does less process churn while keeping stale-entry pruning behavior unchanged.
Make the test-only session reset helper explicit, guard simulator device parsing against malformed simctl payloads, and avoid duplicate local cleanup when both child exit and close fire.
These changes keep the durable registry design the same while tightening a few rough edges called out in follow-up review.
Co-Authored-By: OpenAI Codex <noreply@openai.com>
* fix(renderer,test-execution): Correct next-step runtime syntax and resultBundlePath routing
The CLI text renderer always emitted next-step suggestions in CLI syntax
regardless of the event's runtime field. Now MCP/daemon runtimes get MCP
tool-call syntax while CLI keeps CLI syntax.
The simulator two-phase execution plan passed -resultBundlePath to both
build-for-testing and test-without-building. This flag only belongs on the
test-without-building invocation; passing it to both caused xcodebuild
conflicts. Extract it from extraArgs and route it to the test phase only.
* ref(snapshot-tests): Invoke CLI subprocess uniformly and expand MCP fixture coverage
Replace direct module imports in the snapshot harness with CLI subprocess
invocations so every test exercises the real transport path. The resource
harness now connects via MCP SDK client instead of importing handler
modules directly.
- Remove invokeDirect path and shutdownAllSimulatorsExcept
- Add createTemporarySimulator/deleteSimulator/shutdownSimulator helpers
- Add output-parsers for extracting app paths, PIDs, simulator entries
- Resource harness uses StdioClientTransport + MCP Client
- Add normalizers for MCP process IDs and OSLog session arrays
- Remove CLI session-management fixtures (MCP-only tools)
- Add missing MCP fixtures for device, macos, simulator, swift-package
- Update all suites to use CLI-based harness patterns
---------
Co-authored-by: OpenAI Codex <noreply@openai.com>1 parent 713a2dc commit dbb2d3b
File tree
350 files changed
+8296
-3235
lines changed- docs/dev
- example_projects/iOS_Calculator
- src
- mcp
- resources
- __tests__
- tools/simulator
- __tests__
- rendering
- __tests__
- server
- __tests__
- snapshot-tests
- __fixtures__
- cli
- coverage
- debugging
- device
- macos
- project-discovery
- project-scaffolding
- simulator-management
- simulator
- swift-package
- ui-automation
- utilities
- mcp-integration
- mcp
- coverage
- debugging
- device
- macos
- project-discovery
- project-scaffolding
- resources
- session-management
- simulator-management
- simulator
- swift-package
- ui-automation
- utilities
- simulator-management
- ui-automation
- __tests__
- suites
- utils
- __tests__
- log-capture
- renderers
- __tests__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
350 files changed
+8296
-3235
lines changedLines changed: 170 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
1 | 7 | | |
2 | 8 | | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
6 | 19 | | |
7 | 20 | | |
8 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
9 | 33 | | |
10 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
11 | 39 | | |
12 | 40 | | |
13 | 41 | | |
| 42 | + | |
14 | 43 | | |
15 | 44 | | |
16 | 45 | | |
| |||
19 | 48 | | |
20 | 49 | | |
21 | 50 | | |
| 51 | + | |
22 | 52 | | |
23 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
24 | 58 | | |
25 | 59 | | |
26 | 60 | | |
| |||
31 | 65 | | |
32 | 66 | | |
33 | 67 | | |
| 68 | + | |
34 | 69 | | |
35 | 70 | | |
36 | 71 | | |
| |||
43 | 78 | | |
44 | 79 | | |
45 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
46 | 103 | | |
47 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments