Hey, ran into this while profiling a React Native app on the iOS simulator and wanted to flag it.
native-profiler-start works fine (xctrace spawns, starts recording, returns a pid and a trace path). But native-profiler-stop always fails with No active native profiling session found. Call native-profiler-start first., so I can never export a trace through the tool.
Dug into it a bit:
- After calling start, the xctrace process stays alive. I watched it from a plain shell (no argent tool calls in between) for 6+ seconds and it kept running and recording.
- Calling stop after that still says "no active session", and the xctrace process gets killed right around then.
- So start and stop don't seem to share the same session state. stop looks like it resolves a fresh/empty session (profilingActive is false) instead of the one start created, and the real session gets disposed (dispose() SIGKILLs the live xctrace).
Only one tool-server.cjs and one argent mcp process running, so it's not a duplicate-instance thing. Happens whether or not there are other tool calls (gesture-tap, screenshot) in between.
Repro:
- Boot an iOS simulator with an app running.
native-profiler-start (succeeds, recording).
- interact or just wait a few seconds.
native-profiler-stop -> "No active native profiling session found".
Expected: stop finds the active session and exports the trace.
Actual: stop never finds it, and the recording gets killed.
Environment:
- argent 0.8.0 (also reproduced on 0.7.1)
- macOS, Xcode 26.4, xctrace 16.0
- iOS 26.4 simulator, React Native app (bridgeless, Hermes)
One side note in case it is related: running xctrace directly with the bundled Argent.tracetemplate records ok but won't finalize/package the trace on stop (it hangs, and the bundle is incomplete so export fails with "Document Missing Template Error"). Not sure if that is the same underlying issue or a separate xctrace/simulator thing on this machine, but the start/stop session mismatch above reproduces on its own.
The react profiler tools work great by the way, this is just the native side.
Hey, ran into this while profiling a React Native app on the iOS simulator and wanted to flag it.
native-profiler-startworks fine (xctrace spawns, starts recording, returns a pid and a trace path). Butnative-profiler-stopalways fails withNo active native profiling session found. Call native-profiler-start first., so I can never export a trace through the tool.Dug into it a bit:
Only one
tool-server.cjsand oneargent mcpprocess running, so it's not a duplicate-instance thing. Happens whether or not there are other tool calls (gesture-tap, screenshot) in between.Repro:
native-profiler-start(succeeds, recording).native-profiler-stop-> "No active native profiling session found".Expected: stop finds the active session and exports the trace.
Actual: stop never finds it, and the recording gets killed.
Environment:
One side note in case it is related: running xctrace directly with the bundled Argent.tracetemplate records ok but won't finalize/package the trace on stop (it hangs, and the bundle is incomplete so export fails with "Document Missing Template Error"). Not sure if that is the same underlying issue or a separate xctrace/simulator thing on this machine, but the start/stop session mismatch above reproduces on its own.
The react profiler tools work great by the way, this is just the native side.