라이브 프로세스 감지를 claude 전용에서 에이전트별로 확장 - #3
Conversation
- 문제 재현: 이 대화 자체의 실시간 Claude Code 세션은 정확히 ACTIVE/HIGH로 잡히는 것을 실제로 확인함 — 그런데 activity.server.ts의 라이브 프로세스 스캔이 "claude" 바이너리만 찾도록 하드코딩되어 있어서, Codex/Gemini CLI/OpenCode/Aider 세션은 실제로 실행 중이어도 타임스탬프 휴리스틱 (RECENT/IDLE/STALE)으로만 판정되고 ACTIVE+HIGH에는 절대 도달하지 못함 - 이 머신에 실제 설치된 바이너리로 codex/gemini/opencode 프로세스명을 확인함 (aider는 설치되어 있지 않아 실제 검증은 못 했고, pip 패키지의 잘 알려진 콘솔 스크립트 이름을 그대로 사용) - detectActivity에 agentId를 추가해 세션 자신의 에이전트에 해당하는 프로세스만 매칭하도록 함 — 같은 워크스페이스에 다른 에이전트의 살아있는 프로세스가 있어도 엉뚱하게 ACTIVE로 잘못 표시되지 않도록 실제 테스트로 검증(같은 워크스페이스, codex 프로세스 실행 중 → codex 세션은 ACTIVE, gemini-cli 세션은 여전히 RECENT) - macOS 경로는 매칭된 에이전트별로 별도 lsof 호출을 하도록 해서, 기존에 검증된 단일 에이전트 파싱 로직을 그대로 재사용(여러 pid를 한 lsof 호출로 묶어 p<pid> 라인으로 구분하는 새로운 파싱 로직을 추가하지 않음) - 실제 /proc 스캔을 쓰는 진짜 프로세스 스폰 테스트 3개 추가(claude-code, codex, custom 폴백), macOS 목 테스트 2개 추가 — 전체 100개 테스트 통과 - 이 세션 자체의 실시간 워크스페이스로 다시 확인: 변경 후에도 여전히 ACTIVE/HIGH로 정확히 잡힘 (회귀 없음)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aeaa41bea7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| function matchAgent(cmdline: string): AgentId | null { | ||
| for (const [agent, pattern] of Object.entries(AGENT_PROCESS_PATTERNS) as [AgentId, RegExp][]) { | ||
| if (pattern.test(cmdline)) return agent; |
There was a problem hiding this comment.
Match the executable instead of arbitrary command arguments
When a Codex session is started as codex exec "compare Claude...", codex exec --help describes [PROMPT] as the initial instructions, so that text is part of the command line. This loop sees the claude pattern first and buckets the running Codex process as claude-code; likewise, any non-agent process with one of these words in an argument is treated as that agent. Discovery can therefore mark an unrelated stale session ACTIVE/HIGH (and keep it ongoing) while failing to mark the actual Codex session active. Restrict matching to the executable or CLI entrypoint rather than the entire argument string.
Useful? React with 👍 / 👎.
문제
activity.server.ts의 라이브 프로세스 스캔이claude바이너리만 찾도록 하드코딩되어 있어서,Codex/Gemini CLI/OpenCode/Aider 세션은 실제로 실행 중이어도 ACTIVE+HIGH 신뢰도에 도달하지 못하고
타임스탬프 휴리스틱으로만 판정됨.
변경
detectActivity에agentId를 추가해 세션 자신의 에이전트에 해당하는 프로세스만 매칭검증