Skip to content

Fix Codex agent job subagent detection in Insight#829

Open
HagegeR wants to merge 8 commits into
mksglu:nextfrom
HagegeR:fix-codex-agent-job-subagent-insight
Open

Fix Codex agent job subagent detection in Insight#829
HagegeR wants to merge 8 commits into
mksglu:nextfrom
HagegeR:fix-codex-agent-job-subagent-insight

Conversation

@HagegeR

@HagegeR HagegeR commented Jun 14, 2026

Copy link
Copy Markdown

Summary

  • Detect Codex generic agent-job worker prompts as subagent_launched events.
  • Detect report_agent_job_result tool calls as subagent_completed events.
  • Teach Insight analytics to count both native subagent rows and legacy Codex worker-prompt rows, so historical Codex sessions are visible without DB backfills.

Why

Codex fan-out jobs can run workers as separate sessions whose first prompt starts with You are processing one item for a generic agent job.. Those sessions were captured as ordinary user_prompt rows, so Insight delegation metrics showed no subagents even though workers had run.

Validation

  • pnpm exec vitest run tests/session/session-extract.test.ts passed in an installed package checkout.
  • pnpm exec tsc --noEmit passed in an installed package checkout.
  • node --check insight/server.mjs passed in this branch.
  • Hook smoke checks verified UserPromptSubmit records subagent_launched and PostToolUse records subagent_completed for Codex agent jobs.

mksglu and others added 7 commits June 12, 2026 16:42
Two regressions snuck back in when the /context-saving rename agent
copied from the next branch (which never had the hero pattern fix).
Re-applying on main:

- .cm-master + .cm-wordmark: inline-flex → flex (so the hero-tag
  pill never shares a baseline-aligned row with the wordmark)
- .hero-tag: margin-bottom → margin-top + align-self:flex-start
  (sits below the wordmark on its own line)
- Insight wordmark italic: 1.18em → 1em, margin-left .12em → .14em
- HTML order: <h1> wordmark first, <p class="hero-tag"> after
  (matches master/insight/context-saving)

Plus making the Insight landing's "287,000+ developers" references
dynamic (.js-user-count + the GitHub stats.json fetch shim), so the
number matches the OSS plugin's source-of-truth count instead of
drifting like the screenshots showed (290k+ on /, 287k+ here).
OG PNGs are static, so the 287,000+ number drifted away from the
landing page (which already reads stats.json live). Solution:

- Mark every user-count occurrence in master-og.html and
  context-saving-og.html with class js-user-count
- render-og.mjs now fetches the same stats.json before opening the
  browser, then runs a one-shot DOM swap on every .js-user-count
  element before the screenshot

Result: each render bakes the freshest count in, no manual update
needed. Today's render shows 290,000+ across all three banners.
The hero green cursor was driving compositor work harder than it
needed to: steps(2) + a 24px box-shadow meant the GPU repainted
the full glow on every tick, which user reported as a low-FPS feel.

- animation timing: 1.06s steps(2) → 1.4s ease-in-out (smooth pulse
  between opacity 1 and 0.28, terminal-feeling without hard flicker)
- box-shadow blur: 24px → 18px and alpha .45 → .40 (lighter recompose)
- add will-change:opacity + translateZ(0) so the cursor lives on its
  own composited layer (no repaint of surrounding text)
- topnav cursor: same easing pass, renamed keyframe to nav-blink so
  the hero and nav don't share a single declaration name
- prefers-reduced-motion now resolves to a static 0.85 opacity cursor
  instead of a stuck-on solid block
@HagegeR HagegeR force-pushed the fix-codex-agent-job-subagent-insight branch from 778dc26 to f1e5d5d Compare June 14, 2026 10:06
@ken-jo

ken-jo commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Hi @HagegeR, review/triage를 돕고 있는 contributor입니다.

컨플릭 해결 이후 기준으로 다시 확인했습니다. 메인테이너 검증 요구사항에 맞춰 PR 설명, git history, merge 가능 여부, 타깃 테스트, 실제 extraction 동작을 함께 확인했습니다.

확인한 내용

이 PR의 핵심 주장은 Codex generic agent-job worker session이 일반 user_prompt row로 저장되어서, Insight delegation metric에서 실제 Codex subagent-style 작업이 누락될 수 있다는 것입니다.

관련 경로에 대해 git archaeology를 진행했습니다.

  • git log --follow --all -- src/session/extract.ts
  • git log --follow --all -- insight/server.mjs
  • git log -S 'subagent_launched' -- src/session/extract.ts insight/server.mjs tests/session/session-extract.test.ts
  • git log -S 'generic agent job' -- src/session/extract.ts insight/server.mjs tests/session/session-extract.test.ts
  • git log -S 'report_agent_job_result' -- src/session/extract.ts insight/server.mjs tests/session/session-extract.test.ts

기존 subagent_launched / subagent_completed event model은 이 PR 이전부터 존재했고, 이 패치는 Codex agent-job session을 별도 metric path로 만들지 않고 기존 subagent model에 매핑하는 형태입니다.

검증한 내용

현재 base 기준 local merge probe는 clean입니다.

  • git merge-tree --write-tree upstream/main HEAD 통과

추가로 아래 검증을 진행했습니다.

  • npm run build 통과
  • npx vitest run tests/session/session-extract.test.ts --reporter=dot 통과: 166 tests
  • node --check insight/server.mjs 통과

직접 extraction smoke check도 진행했습니다.

  • Codex generic agent-job prompt가 subagent_launched를 emit하는 것 확인
  • report_agent_job_result tool event가 subagent_completed를 emit하는 것 확인

빌드 후 worktree도 clean 상태였고, generated artifact drift는 확인되지 않았습니다.

결론

이 PR은 Insight analytics 관점에서 의미 있는 수정으로 보입니다. 이전에 확인했던 local merge conflict 우려도 현재는 해소된 상태입니다.

현재 남은 gate는 GitHub checks가 아직 보고되지 않는다는 점입니다. CI/checks가 실행되고 green이면 merge 가능하다고 판단합니다.

@mksglu mksglu changed the base branch from main to next June 14, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants