macOS: open can start a second copy of an app that was just launched
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- cli, mobile-dev
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 5k
- 派生
- 334
- 平均合并
- 12 小时 2 分钟
- 30 天内合并 PR
- 706
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/agent-device 的其他 Issue
-
CLI: an empty numeric flag value is read as 0可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
callstack/agent-device#3792 ·
维护者通常 1 天内回复
-
macOS helper audio-probe always reports -90 dBFS: AVAudioPCMBuffer frameLength set after the copy未关闭bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 88/100
callstack/agent-device#3771 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
callstack/agent-device#1869 ·
维护者通常 1 天内回复
-
ready-for-agent refactor
难度 5/5 一周以上 新手友好度 25/100
callstack/agent-device#3794 ·
维护者通常 1 天内回复
-
bug in-progress ready-for-agent
难度 3/5 1-2 天 新手友好度 72/100
callstack/agent-device#3787 ·
维护者通常 1 天内回复
查看 callstack/agent-device 的全部 Issue
相似的 Issue
-
area:plugins enhancement platform:vscode
难度 2/5 1-3 小时 新手友好度 88/100
anthropics/claude-code#103166 ·
维护者通常 1 天内回复
-
check:failed streams:add
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
jitsi/jitsi-meet#18021 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
spec: discovery input example can contain multiple aliases for one parameter, with no canonical one未关闭
难度 1/5 1 小时以内 新手友好度 95/100
x402-foundation/x402#3841 ·
维护者通常 1 天内回复