macOS: open can start a second copy of an app that was just launched
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- cli, mobile-dev
Línea de trabajo
Start by tracing the macOS open command and its helper that selects an NSRunningApplication; the issue does not name their file paths or tests. Reproduce the quick relaunch case, then inspect how the command launches by bundle ID and how the helper chooses a process. Done means an already running app can be targeted without starting a duplicate or confusing two copies with the same bundle ID.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
On macOS, agent-device open <bundleId> --platform macos can start a second copy of an app that is already running, then drive whichever copy NSRunningApplication.runningApplications(withBundleIdentifier:).first returns.
Repro
- Launch an app yourself (e.g. a dev build started by a supervisor process with custom launch arguments).
- Within ~0.5–0.75 s, run
agent-device open <bundleId> --platform macos. psshows two processes for the bundle: the original (with its arguments) and a new one with ppid 1 and no arguments.
Cause: open runs /usr/bin/open [-g] -b <bundleId> without first checking for a running instance. A process that was just spawned isn't listed by LaunchServices yet (lsappinfo lists it ~0.5–0.75 s later), so open -b launches a new copy. If you wait until lsappinfo find bundleid=<id> pid=<pid> returns the process, open attaches and only one copy remains (3/3 runs).
Proposal
- Before calling
open -b, check for a running instance of the bundle (NSRunningApplication orlsappinfo) and attach to it instead of launching. - Offer an explicit target, e.g.
--pid <pid>or an app path, so a caller that launched the app itself can attach to that exact process. - In the macOS helper, resolve the target by pid when one is known, rather than
.first, so two copies with the same bundle id can't be confused.
Context: Stim's stim macos launches dev builds this way; we're adding a LaunchServices wait on our side, but the attach behavior would make open safe for any caller.
- Lenguaje dominante
- TypeScript
- Estrellas
- 5k
- Forks
- 334
- Merge medio
- 12 h 2 min
- PR fusionados (30 d)
- 706
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de callstack/agent-device
-
CLI: an empty numeric flag value is read as 0Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
callstack/agent-device#3792 ·
Los mantenedores suelen responder en 1 día
-
macOS helper audio-probe always reports -90 dBFS: AVAudioPCMBuffer frameLength set after the copyAbiertobug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
callstack/agent-device#3771 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
callstack/agent-device#1869 ·
Los mantenedores suelen responder en 1 día
-
ready-for-agent refactor
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
callstack/agent-device#3794 ·
Los mantenedores suelen responder en 1 día
-
bug in-progress ready-for-agent
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
callstack/agent-device#3787 ·
Los mantenedores suelen responder en 1 día
Todos los issues de callstack/agent-device
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
auth: agent-bearer --manager-call is told to use the MCP instance argument on an ambiguous managerAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
Lyric and ApostrophesAbiertobug module: playback
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chthollyphile/folia-major#739 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agilepathway/label-checker#773 · 2 comentarios ·
Los mantenedores suelen responder en 1 día