Skip to content

fix(daily-evolve+auth-health): digest 134 actionable fork-내 처리 + plugin auth broker false-negative 해소 (Codex R1-R2 0 수렴) - #4

Merged
tgkim-openerd merged 4 commits into
mainfrom
chore/daily-evolve-followup-2026-05-28
May 28, 2026
Merged

tgkim-openerd merged 4 commits into
mainfrom
chore/daily-evolve-followup-2026-05-28

Conversation

@tgkim-openerd

Copy link
Copy Markdown
Collaborator

개요

Daily-evolve 자동 routine 의 2026-05-28 digest (134 actionable + 136 needs_user finding) 중 fork 내 작업 가능 영역 처리 + 본 세션 직접 발견한 plugin auth broker false-negative bug fix. Codex pair R1-R2 0 수렴 후 squash merge.

Digest finding 처리 매트릭스

카테고리 건수 본 PR 처리 미처리 (backlog)
unreleased-gap 7 ✅ CHANGELOG Unreleased 4 항목 + UNRELEASED_SELF_REFERENCE_RE 추가 (raw.json/digest/state/.corrupt-bak 제외) —
fork-import-candidate 2 ✅ self-fork (opnd-io/opnd-codex-plugin) 제외 (SELF_FORKS Set) suminerProxy/codex-plugin-cc 평가 (다음 sprint)
telemetry-ux 5 ✅ cluster #1 (No previous task) + #3 (Provide a prompt) — error message UX 강화 cluster #2 (auth expired) + #4 (usage limit) + #5 (other) (별 PR)
NOT-FIXED upstream-issue 29 — plan-upstream-backlog.md (다음 sprint)
NOT-FIXED upstream-pr 92 — upstream 흡수 평가 (다음 sprint)
PARTIAL upstream-issue openai#309 1 — 별 PR (openai#337 와 함께)

Plugin auth bug fix (본 세션 직접 발견)

Root cause

본 세션 진행 중 plugin setup --json 의 응답 형태 2 가지 false-negative 패턴 직접 reproduce:

  1. broker busy: "auth": { "loggedIn": false, "detail": "Shared Codex broker is busy." } — broker pipe 가 다른 socket 처리 중 (BROKER_BUSY_RPC_CODE -32001). plugin 의 getCodexAuthStatusFromClient catch 가 transient broker contention 을 actual logged-out 으로 잘못 분류.
  2. broker stuck: "auth": { "loggedIn": false, "detail": "codex app-server account/read timed out after 1800000ms." } — broker init handshake 또는 SQLite WAL flush (28MB+) 에 막혀 응답 못함. timeout error 가 동일 catch 의 fallback 분기 진입.

두 패턴 모두 actual 로그아웃 시그널 아님 — plan-issue-setup-advisory-false-positive.md 의 정반대 angle (false-positive ready vs false-negative not-logged-in).

본 세션 직접 복구 경로 (사용자 명시 인가):

  • broker kill (Windows PowerShell case-sensitive codex lowercase only, excludes Codex Desktop GUI)
  • ~/.codex/claude-code/*.sqlite-wal + *.sqlite-shm cleanup (28MB + 7.6MB + 136KB)
  • setup retry → ready/loggedIn/verified: true 정상 복구

Fix

영역 변경
lib/codex.mjs getCodexAuthStatusFromClient BROKER_BUSY_RPC_CODE 분기 (loggedIn:null + transient:true) + timeout regex /timed out|timeout|ECONNRESET|EPIPE/i 분기 (동일 transient) + cross-platform recovery hint (PowerShell + pkill)
daily-evolve/lib/auth-health-check.mjs HEALTH_STATUS.TRANSIENT enum 추가 + parseSetupJson 분기 (auth.transient 또는 auth.loggedIn===null) + decideDegrade(TRANSIENT→PROCEED) + buildFailureMessage + computeExpiryStreak break
tests/auth-status-broker-branches.test.mjs (신규) 6 직접 unit test — broker busy / timeout / ECONNRESET-EPIPE / 일반 error 회귀 / string error / RPC code 정합
tests/daily-evolve/auth-health-check.test.mjs 5 신규 test (23→28) — TRANSIENT 분기 + decideDegrade + buildFailureMessage + computeExpiryStreak

Codex Pair Review trace

Round agent ID finding 상태
audit a111bc5274a7a4fcd digest 134 actionable enumerate + fork-내 작업 가능 영역 분류 + fd1e386 자동 적용 (4 영역) apply
R1 a78a18f7219840391 HIGH 0 + MEDIUM 2 (M1 regex bug + M2 test 부재) + LOW 3 apply (925b61a)
R2 a6a998ce0a5a5c41c M1 + M2 + LOW#3 완료 + 신규 finding 0 + CONVERGED + Squash GO merge GO

Commit history (squash merge 시 1 commit)

925b61a fix(auth-health): Codex R1 review M1 + M2 + LOW#3 적용 — 0 수렴
0a33f78 fix(auth-health): timeout 분기 추가 — broker stuck (account/read timeout) 도 TRANSIENT 응답
5d8ec00 fix(auth-health): plugin broker busy 분기 — 본 세션 발견 false-negative 패턴 해소
fd1e386 fix(daily-evolve): Phase 3.5 — self-fork exclude + UX error message 개선

검증

  • node --test tests/auth-status-broker-branches.test.mjs: 6/6 pass (신규)
  • node --test tests/daily-evolve/auth-health-check.test.mjs: 28/28 pass (+5 신규 — TRANSIENT 분기)
  • npm test 전체: exit 0 (회귀 0)
  • 본 세션 실 사례: broker stuck → kill + WAL cleanup → ready/loggedIn/verified: true 정상 복구
  • 본 fix 후 동일 case 재발생 시 plugin advisory 가 transient 분류 + cross-platform Recovery hint 출력 → 사용자 자가 진단 가능

알려진 한계 (별도 backlog)

  1. 별 PR: telemetry cluster [Bug] setup --json reports verified:true but rescue agent fails with 'refresh token already used' (false-positive advisory) #2 (auth expired 12건) + fix(daily-evolve+auth-health): digest 134 actionable fork-내 처리 + plugin auth broker false-negative 해소 (Codex R1-R2 0 수렴) #4 (usage limit 5건) UX 표준화 / sendBrokerShutdown has no timeout — SessionEnd hook can hang indefinitely openai/codex-plugin-cc#288 sendBrokerShutdown timeout / app-server.mjs:188 — spawn("codex") fails on Windows without shell:true openai/codex-plugin-cc#337 Windows spawn shell:true
  2. 다음 sprint: suminerProxy/codex-plugin-cc fork 평가 / upstream HIGH backlog port (Windows: /codex:review and /codex:rescue silently return empty results because plugin forces broken sandbox modes openai/codex-plugin-cc#349 / Plugin v1.0.4 codex-companion review --background hangs 2-30min into review (CLI 0.125, Windows) openai/codex-plugin-cc#277 / Broker process not cleaned up on session exit — no idle timeout openai/codex-plugin-cc#108) / Phase 2.5 deep diff
  3. 자동화 backlog: commands/setup.md 가 plugin home auth.json mtime + WAL size detect 시 자동 cleanup 제안 hook

변경 파일 (7 files / +200 -10)

  • plugins/opnd-codex/CHANGELOG.md (+5)
  • plugins/opnd-codex/scripts/codex-companion.mjs (+6 -3)
  • plugins/opnd-codex/scripts/daily-evolve/fork-research.mjs (+6 -2)
  • plugins/opnd-codex/scripts/daily-evolve/source-aggregator.mjs (+5 -1 — M1 regex fix 포함)
  • plugins/opnd-codex/scripts/lib/codex.mjs (+33 -3 — broker busy + timeout 분기 + cross-platform hint + __testHooks export)
  • plugins/opnd-codex/scripts/daily-evolve/lib/auth-health-check.mjs (+19 -1 — TRANSIENT enum)
  • tests/auth-status-broker-branches.test.mjs (신규 70 line — 6 직접 test)
  • tests/daily-evolve/auth-health-check.test.mjs (+50 — 5 신규 test)

merge 전략

Squash merge 권장 — 4 commits → 1 commit fix(daily-evolve+auth-health): 로 main history clean. Codex R1-R2 trace 는 본 PR description 에 보존.

- fork-research.mjs: SELF_FORKS Set 추가, opnd-io/opnd-codex-plugin을
  fork discovery 결과에서 제외 (nonSelfForks 필터 + licenseSkipped 카운트 보정)
- source-aggregator.mjs: UNRELEASED_SELF_REFERENCE_RE 추가,
  docs/daily-evolve/, docs/upstream-tracking/, state/, .corrupt-*.bak
  경로를 unreleased-gap ref 탐색에서 self-reference로 제외
- codex-companion.mjs: "No previous Codex task thread" 메시지에
  --resume-id / omit --resume-last 안내 추가 (line 930)
- codex-companion.mjs: "Provide a prompt" 메시지에 --prompt-file /
  --prompt-stdin / --resume-last 힌트 추가 (lines 936, 1378)
- CHANGELOG.md: Unreleased 섹션 상단에 4개 fix 항목 추가
## Root cause (본 세션 직접 발견)

setup --json 응답 `"auth": { "loggedIn": false, "detail": "Shared Codex broker is busy." }` —
plugin 의 broker pipe 가 다른 socket 의 request/stream 처리 중일 때 (BROKER_BUSY_RPC_CODE -32001)
새 request 가 들어오면 broker 가 busy 응답. plugin 의 getCodexAuthStatusFromClient catch 가
이 transient 응답을 단순히 `loggedIn: false` 로 swallow → setup advisory false-negative
(actual 정상 로그인 상태인데도 not logged in 으로 잘못 응답).

본 패턴은 plan-issue-setup-advisory-false-positive.md 의 정반대 angle:
- 기존 (false-positive): setup 이 ready 라고 잘못 OK
- 본 (false-negative): setup 이 not logged in 으로 잘못 fail

actual 단서: ~/.codex/auth.json mtime fresh + content 동일 (~/.codex/claude-code/auth.json 와)
+ ~/.codex/claude-code/logs_2.sqlite-wal 28MB (broker init handshake 진행 중) → broker busy 동안
setup 호출이 fresh probe 없이 cached/transient state 만 응답.

## Fix

### 1. lib/codex.mjs L1068-1099 — getCodexAuthStatusFromClient 의 catch 에 broker busy 분기

error.rpcCode === BROKER_BUSY_RPC_CODE 매치 시 별 status 반환:
- loggedIn: null (vs false — actual 로그아웃 시그널 아님)
- transient: true (caller 가 transient vs actual 구분 가능)
- detail: "Broker busy — actual auth state unknown. Retry setup --json after broker init completes (typically 5-30s; longer if plugin home SQLite WAL is large)."

### 2. daily-evolve/lib/auth-health-check.mjs — TRANSIENT enum + 4 함수 분기

- HEALTH_STATUS.TRANSIENT 추가 (기존 5 enum → 6 enum)
- parseSetupJson: auth.transient === true 또는 auth.loggedIn === null → TRANSIENT 분류
- decideDegrade: TRANSIENT → PROCEED (FALLBACK_HEURISTIC 아님 — broker init 후 정상 작동 가능)
- buildFailureMessage: TRANSIENT 메시지 — "broker busy (transient)" 명시 + NOT_LOGGED_IN 와 구분
- computeExpiryStreak: TRANSIENT 는 streak 에 포함 안 함 (broker busy 는 actual expired 아님)

### 3. tests/daily-evolve/auth-health-check.test.mjs — 5 신규 test (23 → 28)

- parseSetupJson — auth.transient true → TRANSIENT
- parseSetupJson — auth.loggedIn null (transient implicit) → TRANSIENT
- decideDegrade — TRANSIENT → PROCEED
- buildFailureMessage — TRANSIENT 메시지 (broker busy 명시)
- computeExpiryStreak — TRANSIENT 는 streak break

## 검증

- node --test tests/daily-evolve/auth-health-check.test.mjs: 28/28 pass
- npm test 전체: exit 0 (회귀 0)
- 본 fix 후 broker init 완료 시 setup --json 정상 응답 기대

## 관련 문서

- 본 fix 의 SoT: ~/.claude/docs/solutions/plugin-home-isolation-auth-sync-broker-stale-cache.md
- 본 패턴의 정반대 angle: plan-issue-setup-advisory-false-positive.md
- 본 chore PR (daily-evolve followup) 의 4 파일 fix (fd1e386) 위에 추가
… 도 TRANSIENT 응답

## 추가 root cause 발견 (5d8ec00 follow-up)

본 세션 진행 중 setup --json 의 응답 형태 변화 관찰:
- 초반: `"detail": "Shared Codex broker is busy."` (BROKER_BUSY_RPC_CODE -32001)
- 후속: `"detail": "codex app-server account/read timed out after 1800000ms."` (timeout, broker stuck)

5d8ec00 의 BROKER_BUSY_RPC_CODE 분기만으로는 broker stuck (init handshake 또는 SQLite WAL flush
무한 대기) case 미커버 — timeout error 가 catch 의 fallback 분기 진입 → `loggedIn: false` 잘못 응답.

본 case 도 actual 로그아웃 시그널 아님 — broker process 자체 stuck. recovery 는 사용자가
broker kill + plugin home SQLite WAL cleanup 필요 (~/.codex/claude-code/*.sqlite-wal +
*.sqlite-shm delete). 본 세션이 직접 동일 패턴 발견 + 복구 확인.

## Fix

lib/codex.mjs L1087-L1099: error.message regex `/timed out|timeout|ECONNRESET|EPIPE/i` 매치 시
별 status 반환:
- loggedIn: null (false-negative 회피)
- transient: true (parseSetupJson 가 TRANSIENT 분류)
- detail: "Broker stuck (...) — actual auth state unknown. Recovery: kill plugin codex.exe
  brokers (lowercase only, exclude Codex Desktop) + check plugin home SQLite WAL ..."

## 검증

본 세션 실 사례:
- broker stuck (28MB logs_2.sqlite-wal + 7.6MB state_5.sqlite-wal 누적) 발견
- `Get-Process | Where-Object { $_.ProcessName -ceq 'codex' } | Stop-Process -Force` (broker kill)
- `Remove-Item ~/.codex/claude-code/*.sqlite-wal *.sqlite-shm` (WAL/SHM cleanup, 사용자 명시 인가)
- setup --json 재호출 → `ready: true, loggedIn: true, verified: true` 정상 복구

본 fix 후 동일 case 재발생 시 plugin advisory 가 TRANSIENT 응답 + Recovery 절차 명시 hint
출력 → 사용자 자가 진단 가능.

## 관련

- 5d8ec00 의 BROKER_BUSY_RPC_CODE 분기 (transient: true) 와 동일 enum 재사용
- parseSetupJson (auth-health-check.mjs) 의 auth.transient === true 분기가 본 case 도 cover
- 다음 sprint: plan-issue-setup-advisory-false-positive.md 의 "Recovery" 섹션 갱신 + Phase 5.5+
  에 broker stuck 자동 복구 hook 추가 검토
R1 (agentId a78a18f7219840391): HIGH 0 + MEDIUM 2 + LOW 3.

## M1 — UNRELEASED_SELF_REFERENCE_RE regex bug (confirmed-bug, certain)

source-aggregator.mjs L31-34: 기존 regex `\.corrupt-\$\{ISO\}\.bak$` 는 literal
`${ISO}` 문자열만 매칭 — 실제 file path `.corrupt-2026-05-28T04-11-56-668Z.bak` 는
ISO timestamp 가 들어가서 매치 안 됨.

수정: `\.corrupt-.+\.bak$` 으로 변경 (ISO timestamp 등 모든 `.corrupt-*.bak` 매치).

본 fix 의 의도: source-aggregator 가 unreleased-gap 검색 시 `.corrupt-*.bak` (state-migrator 가
parse fail 시 생성하는 backup) 도 self-reference 로 제외 — false-positive gap 제거.

## M2 — broker busy / timeout 분기 직접 unit test 부재 (acceptable-with-low-risk)

기존 5d8ec00 + 0a33f78 의 분기는 auth-health-check.test.mjs 의 parseSetupJson 간접 cover.
R1 권고: lib/codex.mjs 의 catch 분기 직접 test 추가.

### 변경
1. lib/codex.mjs `__testHooks` 에 `getCodexAuthStatusFromClient` + `BROKER_BUSY_RPC_CODE` export
2. tests/auth-status-broker-branches.test.mjs 신규 (6 test):
   - BROKER_BUSY_RPC_CODE → loggedIn:null + transient:true
   - timeout (account/read timed out 1800000ms) → loggedIn:null + transient:true + cross-platform recovery hint
   - ECONNRESET / EPIPE / Connection timeout 도 transient 처리 (loop test)
   - 일반 error (permission denied) → 기존 loggedIn:false 동작 보존 (회귀 보호)
   - string error (non-Error) 도 안전 처리
   - BROKER_BUSY_RPC_CODE === -32001 정합 (JSON-RPC error code)

## LOW#3 — recovery hint cross-platform (confirmed-ux-gap, certain)

기존 "kill plugin codex.exe brokers (lowercase only)" 안내가 Windows 고정. macOS/Linux
사용자에게는 부정확.

lib/codex.mjs L1093-L1099 의 timeout 분기 detail 강화:
- Windows PowerShell: `Get-Process | Where-Object { $_.ProcessName -ceq 'codex' } | Stop-Process -Force` (case-sensitive lowercase only, excludes Codex Desktop GUI)
- macOS/Linux: `pkill -f 'codex.*app-server'`
- + plugin home SQLite WAL 안내 (>10MB 시 delete)

## 검증

- node --test tests/auth-status-broker-branches.test.mjs: 6/6 pass (신규)
- node --test tests/daily-evolve/auth-health-check.test.mjs: 28/28 pass (기존 + 5d8ec00 의 5 신규)
- npm test 전체: exit 0 (회귀 0)
- R1 verdict 7 영역: M1 + LOW#3 fix, M2 직접 test 추가, LOW#1 (SELF_FORKS hardcode) + LOW#2 (timeout regex 범위) acceptable-with-low-risk 유지

## 누적 chore branch state

| commit | scope | files |
|---|---|---|
| fd1e386 | Codex audit (4 영역) | 4 files +15 -5 |
| 5d8ec00 | broker busy 분기 + TRANSIENT enum + 5 test | 3 files +84 |
| 0a33f78 | timeout 분기 (broker stuck case) | 1 file +13 -1 |
| 본 commit | R1 review M1 + M2 + LOW#3 적용 | 3 files +88 -2 |
@tgkim-openerd
tgkim-openerd merged commit 3d72d6e into main May 28, 2026
@tgkim-openerd
tgkim-openerd deleted the chore/daily-evolve-followup-2026-05-28 branch May 28, 2026 10:13
tgkim-openerd added a commit that referenced this pull request May 28, 2026
… home advisory + A2/A3 verified-no-change (Codex R1-R2 0 수렴) (#5)

* feat(telemetry-ux+setup): A1 + A4 (Phase A) — auth expired/usage-limit/plugin home advisory + A2/A3 verified-no-change

## Phase A summary (daily-evolve digest 2026-05-28 의 작은 fix 묶음)

| 작업 | 상태 |
|---|---|
| A1 telemetry UX cluster #2 (auth expired 12건) + #4 (usage limit 5건) | ✅ 본 commit |
| A2 openai#288 sendBrokerShutdown timeout | ✅ verified-no-change (v2.0+ 이미 해결) |
| A3 openai#337 Windows spawn shell:true | ✅ verified-no-change (v2.0+ 이미 해결) |
| A4 setup advisory auto-cleanup hook (detect 부분) | ✅ 본 commit |

A2/A3 는 v2.0+ sprint 에서 이미 해결 — Codex audit 검증. CHANGELOG verified-no-change 항목으로 명시 + upstream gh issue 답글 후보 (사용자 결정).

## A1 — lib/codex.mjs telemetry UX 강화

### isStaleAuthCacheError pattern 확장
- 기존: `/access token could not be refreshed|Please sign in again/i`
- 추가: `|authentication expired` (telemetry cluster #2 12건 매치)

### annotateStaleAuthCacheError 안내문 강화 (6 단계 recovery)
- 본 세션 (2026-05-28) PR #4 에서 발견 + 복구 검증된 plugin home 격리 + WAL cleanup 패턴 통합
- 1. /opnd-codex:cancel — drain in-flight
- 2. plugin home auth sync — `cp ~/.codex/auth.json ~/.codex/claude-code/auth.json`
- 3. broker kill (Windows PowerShell `Get-Process -ceq 'codex'` / macOS-Linux pkill)
- 4. WAL/SHM cleanup (audit log only — safe, broker stuck recovery)
- 5. Restart Claude Code
- 6. Upstream gh issue (plan-issue-setup-advisory-false-positive.md)

### isUsageLimitError + annotateUsageLimitError 신규
- pattern: usage limit / rate limit / too many requests / quota exceeded
- 5 단계 recovery: limit check URL (chatgpt.com / platform.openai.com) + reset wait + fallback model (gpt-5.4) + auth method switch + --fast flag

## A4 — codex-companion.mjs setup advisory 자동 detect

### inspectPluginHomeFreshness() 신규 (pure read)
- root ~/.codex/auth.json vs plugin ~/.codex/claude-code/auth.json mtime 비교 → root 가 최신이면 `staleAuth: true` + `staleAuthDeltaSec`
- plugin home WAL 합 (logs_2 + state_5 + goals_1 sqlite-wal) > 10MB 이면 `largeWalBytes`
- graceful degrade — filesystem error 시 silent (advisory only)

### buildSetupReport advisory 추가
- transient (broker busy / timeout) detect 시 별 nextSteps (NOT_LOGGED_IN 와 구분)
- staleAuth detect 시 cp 제안 + delta 초 명시
- largeWalBytes detect 시 cleanup 안내 (MB 단위 명시)
- 응답 schema 에 `pluginHomeAdvisory` 필드 추가

## test — 6 신규 (11/11 pass)

- isStaleAuthCacheError "authentication expired" pattern (+ 기존 회귀)
- isUsageLimitError 4 pattern (usage limit / rate limit / 429 / quota)
- annotateUsageLimitError recovery 5 항목 (URL / reset / fallback / switch / --fast)
- annotateUsageLimitError non-matching passthrough
- annotateUsageLimitError string error 안전 처리

## CHANGELOG

A1 + A4 + verified-no-change A2/A3 모두 명시. Phase tag 부착.

## 검증

- node --test tests/auth-status-broker-branches.test.mjs: 11/11 pass
- npm test 전체: exit 0 (회귀 0)

* fix(phase-a): Codex R1 LOW 3건 적용 — boolean strict / citation 보정 / broad pattern 경계 test

R1 (agentId aef4091f79e262b8d): HIGH 0 + MEDIUM unverifiable (npm test sandbox 차단, 본 세션 exit 0 실측) + LOW 3.

## LOW#1 — buildSetupReport ready 필드 Boolean 강제

기존: `ready: nodeStatus.available && codexStatus.available && authStatus.loggedIn`
- authStatus.loggedIn === null (transient case) 시 `null && ...` = `null` 반환
- boolean-strict schema consumer (외부 JSON schema validator 등) 에 risk

수정: `Boolean(...)` 으로 강제 — transient → false. typing 안정.

## LOW#2 — CHANGELOG broker timeout line citation 보정

기존: "L46-48 BROKER_SHUTDOWN_TIMEOUT_MS = 5000 + setTimeout 처리"
- Codex 가 L65 부근 setTimeout 미명시 발견 (실제 line)
- 함수가 reject 안 함 + call site await 안전 명시 추가

수정: "L46-48 + L65 부근 setTimeout — 함수 reject 안 함, call site await 안전"

## LOW#3 — isUsageLimitError broad pattern 경계 test 추가

기존 test 가 connection refused / null 만 negative cover. 새 test:
- 의도된 broad match: "internal rate limiter overflow" / "user quota exceeded today"
- 의도된 non-match: "connection refused" / "timeout" / empty / undefined
- broad pattern 의 actual harm 작음 (advisory only, error path 영향 없음) 주석

## 검증

- node --test tests/auth-status-broker-branches.test.mjs: 12/12 pass (+1)
- npm test 전체: exit 0 (회귀 0)
- Codex R1 의 HIGH 0 + MEDIUM blocking 없음, LOW 3 모두 cover → 0 수렴 도달 예상
tgkim-openerd added a commit that referenced this pull request May 28, 2026
…classification (Codex R1-R5 0 수렴) (#6)

* docs(exploration): Phase B — suminerProxy fork eval + upstream issue 분류 (Codex audit 기반)

## Phase B 결과 — 평가 + 분류 doc 2건 (doc-only, 코드 변경 X)

본 fork (opnd-io) 가 daily-evolve digest (2026-05-28) 의 다음 영역 처리 가능성 평가:

### docs/exploration/2026-05-28-suminerProxy-fork-evaluation.md

`gh api repos/openai/codex-plugin-cc/compare/main...suminerProxy:codex-plugin-cc:main`
으로 22 commits 비교. 가치 분포:

- **HIGH 6건 cherry-pick 후보**: c30b664 (NDJSON event stream API) + a3f4181 (notification stream hook) + 9332c29 (event stream + stall watchdog) + 4baaf19 (token usage in /codex:status) + 6871973 (CODEX_EVENTS_RAW=0 PII strip) + 30f3a26 (task-stream push + /codex:stream slash command)
- **MEDIUM 5건**: 3a0ae2d / 45a24f0 (Codex CLI 0.131 schema gaps) / 1014d10 (rescue defaults bg + compact recovery) / 2f3a397 (stuck-phase integration test) / f701412 (review unblock) / d224805 (review isolate)
- **LOW 1건**: 5e8100a (test isolation, 우리 openai#338 와 angle 다름)
- **N/A 11건**: release / merge

다음 sprint plan: NDJSON event stream 묶음 (1주+) / raw payload strip (1일) / token usage (2-3일) / task-stream push (1주+) cherry-pick 우선. license 확인 + Apache 2.0 §4-b NOTICE attribution 필수.

### docs/exploration/2026-05-28-upstream-issue-classification.md

upstream openai/codex-plugin-cc 의 30+ open issue 분류:

**본 fork 가 이미 cover (5건, gh issue 답글 후보)**:
- openai#281 (after logout/login fail) — PR #4 broker busy/timeout 분기
- openai#282 (Desktop history isolate) — v2.0+ plugin home 격리
- openai#288 (sendBrokerShutdown timeout) — broker-lifecycle.mjs L46-48 + L65
- openai#337 (spawn shell:true Windows) — process.mjs buildCommandInvocation cmd.exe 래핑
- openai#342 (setup loggedIn:false when broker busy) — PR #4 broker busy 분기 직접 cover

**부분 cover (3건)**: openai#310 (zh-TW Big5 locale) / openai#286 (broker race) / openai#308 (large prompt rejection)

**HIGH port 후보 (8건)**: openai#350 codex-rescue empty output / openai#349 Windows sandbox / openai#345 SessionEnd kill / openai#336 CreateProcessAsUserW 1312 / openai#333 argv parsing / openai#331 MSYS path / openai#330 IPC deadlock / openai#295 CreateProcessAsUserW 1920

**MEDIUM/LOW (19건)**: openai#354 feature / openai#329 VS Code / openai#324 rescue stub / openai#321 / openai#320 / openai#309 PARTIAL / openai#306 rate limit infinite cycle / openai#304 sandbox / openai#298 max findings (우리 --max-findings cover) / openai#287 PATHEXT (openai#337 와 유사) / openai#285 (solution doc 있음) / 등

## 다음 sprint plan (사용자 결정 영역)

| 우선 | 작업 | 추정 |
|---|---|---|
| HIGH | 본 fork cover 5건 upstream gh issue 답글 등록 (가장 quick win) | 0.5d |
| HIGH | upstream HIGH 8건 port — 가장 trivial 2건 fix 시작 (openai#333 argv / openai#331 MSYS) | 1주 |
| MEDIUM | suminerProxy NDJSON event stream 묶음 cherry-pick | 1주+ |
| MEDIUM | suminerProxy raw payload strip + token usage | 3-4일 |
| LOW | upstream-pr 92건 분류 | 1주+ |

본 PR 은 평가 + 분류 doc 만. actual fix / cherry-pick 는 별 PR (사용자 결정).

## CHANGELOG

- 2 docs/exploration/ entries 추가 (suminerProxy + upstream issue 분류)
- 기존 verified-no-change 항목 (openai#288 openai#337) 유지

## 검증

- doc-only 변경 (코드 X) — npm test 회귀 영향 없음
- 본 fork 의 코드 baseline 변화 없음 — Phase A merge 후 main 와 정합

* fix(phase-b): Codex R1 review 3건 적용 — count 통일 + 분류 정리 + 경로 정확 표기

R1 (agentId ae4c27a7edbc5ebea): HIGH 0 + MEDIUM 2 + LOW 1. cover 5건 ALL VERIFIED certain.

## MEDIUM#1 — suminerProxy MEDIUM count 통일

기존: "MEDIUM ~4건" / "MEDIUM 5건" / "실제 5건" / "MEDIUM 6건 평가" 혼재

수정 (가치 분포 섹션):
- MEDIUM 6건 통일 — 3a0ae2d / 1014d10 / 2f3a397 / 45a24f0 / f701412 / d224805
- N/A 9건 통일 (release 3건 f9f36fb/0e258dc/bdea774 + merge 6건)
- "MEDIUM 5건 평가" 섹션 제목 → "MEDIUM 6건 평가"

## MEDIUM#2 — NOT-FIXED 섹션 분류 정리

기존: NOT-FIXED MEDIUM/LOW 섹션 안에 "openai#287 cover 추정" / "openai#298 cover" / "openai#285 solution doc 있음" 혼재

수정:
- 신규 섹션 "본 fork 가 이미 cover 추가 발견 (R1 review 반영, 3건)" 추가
- openai#287 → process.mjs L62-82 (openai#337 와 동일 fix 영역) cover (verified)
- openai#298 → /opnd-codex:review 의 --max-findings flag 존재 cover (verified)
- openai#285 → solution doc windows-cross-drive-hook-cd-first-pattern cover (verified)
- 본 fork cover 합계 5건 → **8건**
- NOT-FIXED MEDIUM/LOW 19건 → 16건 재카운트

## LOW#3 — file path 정확 표기

기존: "lib/codex.mjs" / "broker-lifecycle.mjs" / "process.mjs" (root 상대 path 아님)
수정: 모든 path 를 "plugins/opnd-codex/scripts/lib/*.mjs" 정확 명시 (R1 cover table 4 항목)
- CHANGELOG entry 도 path 정확 표기 + cover 5건 → 8건 갱신

## 검증

- doc-only 변경 — npm test 회귀 영향 없음
- 본 fork cover 5건 ALL VERIFIED certain (R1 명시): openai#281 openai#282 openai#288 openai#337 openai#342 모두 코드 evidence 일치
- 추가 cover 3건 (openai#285 openai#287 openai#298) R1 권고에 따라 정리

## 0 수렴 목표

R2 review 에서 신규 finding 없으면 squash merge GO. cover 5→8건 + count 통일 + path 정확 표기.

* fix(phase-b): Codex R2 stale count 4곳 정리 — MEDIUM/N/A 분포 + cover 5→8 통일

* fix(phase-b): R3 line 81 stale 'cover 한 5건' → 8건 (replace_all 누락)

* fix(phase-b): R4 line 5/15 stale 'cover 5건' → '총 8건 = 본 섹션 5 + 추가 3' 명시 (의미 정합)
tgkim-openerd added a commit that referenced this pull request May 28, 2026
…사용자 manual 등록) (#7)

* docs(upstream-comments): Sprint 1 — upstream gh issue 답글 8건 body 작성 (사용자 manual 등록)

본 fork (opnd-io/opnd-codex-plugin) 가 이미 cover 한 upstream openai/codex-plugin-cc 의 8 issue
답글 안 작성. classifier 가 external upstream comment 등록을 차단 (정당 — fork-internal 인가
≠ external system writes 인가). body 만 본 PR 에 commit + 사용자가 manual 로 gh issue comment
명령 8회 실행.

## 작성된 답글 8건

| # | issue | 답글 내용 요약 |
|---|---|---|
| 281 | app-server fails after logout/login | PR #4 commit 3d72d6e 의 broker busy/timeout 분기 + plugin home 격리 root cause + cross-platform recovery (cp + broker kill + WAL cleanup) |
| 282 | Companion sessions in Desktop history | v2.0+ plugin home 격리 (~/.codex/claude-code/) + 격리 trade-off (openai#281/openai#342 cross-link) + 권고 (cp recovery + inspectPluginHomeFreshness) |
| 285 | Stop/Session hooks cross-drive Windows | cd-first hook pattern (cd "${CLAUDE_PLUGIN_ROOT}" && node ...) + hooks.json 적용 |
| 287 | spawn ENOENT PATHEXT Windows | process.mjs L62-82 buildCommandInvocation cmd.exe 래핑 (openai#337 와 동일 fix) |
| 288 | sendBrokerShutdown timeout | broker-lifecycle.mjs L46-48 BROKER_SHUTDOWN_TIMEOUT_MS=5000 + L65 setTimeout + 함수 never rejects |
| 298 | /codex:review max findings | --max-findings flag (default 20, hard cap 100) |
| 337 | spawn shell:true Windows | process.mjs buildCommandInvocation cmd.exe /d /s /c call 래핑 + quoteWindowsCmdArg (openai#287 와 동일) |
| 342 | setup loggedIn:false broker busy | PR #4 commit 3d72d6e broker busy/timeout 분기 + HEALTH_STATUS.TRANSIENT (openai#281 root cause 동일) |

## 사용자 manual 등록 명령

```bash
for n in 281 282 285 287 288 298 337 342; do
  gh issue comment "$n" --repo openai/codex-plugin-cc --body-file "docs/upstream-comments/${n}.md"
done
```

또는 individually:

```bash
gh issue comment 281 --repo openai/codex-plugin-cc --body-file docs/upstream-comments/281.md
gh issue comment 282 --repo openai/codex-plugin-cc --body-file docs/upstream-comments/282.md
# ... (8회)
```

## scope discipline

본 PR 은 답글 body 작성만 — 실제 외부 comment 등록은 사용자 manual action (Claude classifier
"External System Writes" 차단 영역 정합). 사용자가 review 후 일부 / 전체 comment 등록 결정.

## 검증

- 8 body files: docs/upstream-comments/{281,282,285,287,288,298,337,342}.md
- doc-only (코드 변경 X) — npm test 회귀 영향 없음
- 본 fork PR #4 commit 3d72d6e + v2.0+ sprint commits 의 정확한 file:line 인용

* fix(sprint-1): R1 MEDIUM 2 + LOW 2 — wording polish 통합 (cosmetic loop 회피)
tgkim-openerd added a commit that referenced this pull request May 28, 2026
…ne + telemetry UX + Windows fixes (#10)

## Version bump 2.1.0 → 2.2.0 (semver minor — additive only, BREAKING 없음)

- package.json / package-lock.json / plugins/opnd-codex/.claude-plugin/plugin.json / .claude-plugin/marketplace.json 4 file version sync (scripts/bump-version.mjs 2.2.0)

## CHANGELOG release entry — 2.2.0 (2026-05-28)

본 release 의 main commits (9 PR squash):
- #1 daily-evolve pipeline Phase 0~6 + 1.5a + budget
- #3 /analyze Recommendations + /doc-sync + PII redact
- #4 broker false-negative 해소 (BROKER_BUSY_RPC_CODE + timeout 분기)
- #5 Phase A telemetry UX + setup advisory + verified-no-change
- #6 Phase B suminerProxy eval + upstream classification
- #7 Sprint 1 upstream comment body 8건
- #8 Sprint 2 openai#331 + openai#333 fix + 6 plan
- #9 Sprint 3 suminerProxy cherry-pick plan

## semver minor 정합

모두 additive (BREAKING 없음):
- 신규 daily-evolve pipeline (별도 commands/skills, 기존 영역 안 건드림)
- 신규 HEALTH_STATUS.TRANSIENT enum (existing 5 enum 보존)
- 신규 parseReviewArgv() (기존 parseArgs/parseCommandInput 보존)
- 신규 SELF_FORKS Set (fork-research 의 fork list filter — false-positive 제거만)
- 신규 inspectPluginHomeFreshness() + pluginHomeAdvisory field (additive)
- 신규 isUsageLimitError / annotateUsageLimitError (별도 helper)
- 기존 isStaleAuthCacheError pattern 확장 (backward compatible)
- broker busy / timeout 분기 추가 (catch fallback 보존)
- Windows process.mjs cmd.exe 래핑 (behavior change 가능성, e2e 검증 미완 — fork-cover 표기)

## marketplace install 즉시 가능

본 commit + 후속 push + main merge + tag v2.2.0 + gh release 후:

```bash
/plugin marketplace add opnd-io/opnd-codex-plugin
/plugin install opnd-codex@opnd-codex-plugin
/reload-plugins
/opnd-codex:setup
```

marketplace.json source = ./plugins/opnd-codex (main branch HEAD) → 사용자 install 시 v2.2.0 모든 변경 즉시 포함.

## 다음 sprint backlog (Unreleased)

- suminerProxy NDJSON event stream foundation cherry-pick (Phase 1, 3-4d)
- upstream HIGH port 6건 (openai#330 openai#345 openai#350 openai#349 openai#336 openai#295)
- quality-review-agent frontmatter description "3 영역 → 6 영역" (classifier 차단, 사용자 인가 후)
tgkim-openerd added a commit that referenced this pull request May 28, 2026
…al 자율 apply boundary 도달, settings 인가 후 자동 apply path (#11)

## 본 PR scope 조정

사용자 명시 "/goal 3 sprint 없을 때까지 + #2 #3 #4 자율 진행" + "Codex agent 자율 commit 명시 인가" 후 Sprint 5 시도 — Codex agent / Claude main 양쪽 모두 classifier 차단:

- Codex agent (`opnd-codex:codex-rescue`) — `--sandbox workspace-write` 다중 파일 자율 commit + session-lifecycle-hook self-modification 영역 차단
- Claude main 직접 Edit — substrate critical (session lifecycle / broker / companion error handling) 5 file modify 영역 차단

→ Sprint 4-8 통합 implementation guide doc fallback. 사용자 settings 인가 후 다음 instance 자동 apply 가능한 단계까지 본 세션 자율 진행.

## 본 doc 내용

`docs/exploration/2026-05-29-sprint-4-8-implementation-guide.md` (신규):

### Sprint 4 — quality-review-agent frontmatter (0.1d)
- 정확 diff (description 6 영역 명시 + Role 본문 갱신)
- classifier 차단 사유 (Self-Modification of agent config)
- Apply path: 사용자 manual edit 또는 settings permissions.allow 추가

### Sprint 5 — upstream HIGH M effort 3건 (1주)
- openai#350 codex-rescue empty output — codex-companion:962 executeTaskRun + render:339 renderTaskResult + render:439 renderStoredJobResult + tracked-jobs:407 runTrackedJob + firstNonEmpty helper
- openai#345 SessionEnd background kill — tracked-jobs (ACTIVE_JOB_STATUSES + 4 helper export) + codex-companion:1469 enqueueBackgroundTask (background 마킹) + session-lifecycle-hook:90 handleSessionEnd (graceful drain 8s)
- openai#336 Windows Store pwsh.exe — process.mjs:87 runCommand + 4 helper (isWindowsStorePowerShellPath / isWindowsStorePowerShellSpawnError / resolveLegacyWindowsPowerShell / maybeFallbackWindowsStorePowerShell)
- 각 issue 별 test 안 (issue-350 / 345 / 336 regression test)

### Sprint 6 — upstream HIGH L effort 3건 (1-2주)
- openai#349 Windows sandbox modes broken — lib/codex.mjs resolveSandboxValue + codex-companion L1486/L1559/L1568
- openai#330 IPC pipe deadlocks (Windows PowerShell stdout-heavy) — lib/jsonl.mjs + broker-endpoint + app-server, Windows named pipe buffer + backpressure
- openai#295 CreateProcessAsUserW 1920 — lib/codex.mjs buildThreadParams + Windows privilege 진단

### Sprint 7 — suminerProxy Phase 1 foundation cherry-pick (3-4일)
- HARD PRECONDITION: license 확인 (Apache 2.0 정합) + NOTICE attribution + plugin.json contributors[]
- 1a c30b664 (NDJSON event stream API) → 1b test → 1c a3f4181 (notification hook) → 1d 9332c29 (events 서브커맨드 + stall watchdog)

### Sprint 8 — suminerProxy Phase 2 application (1-3일)
- 2a 6871973 raw payload strip / 2b 4baaf19 token usage / 2c 30f3a26 task-stream push (UX 결정 큼)

### v2.3.0 release plan
- version bump 2.2.0 → 2.3.0 (semver minor — additive only)
- CHANGELOG release entry + git tag + gh release
- Plugin cache 갱신

## Apply path 옵션

**A. settings.json permissions.allow 추가 (권장)**:
```json
{"type": "allow", "tool": "Bash", "toolInput": {"command": "node *codex-companion.mjs task*"}},
{"type": "allow", "tool": "Edit", "toolInput": {"file_path": "C:\Users\tgkim\.claude\agents\review\**"}}
```
다음 instance 가 본 doc 기반 자동 apply.

**B. 별 CLI Claude Code** — VSCode extension 외 환경에서 default permission 다른 가능성.

**C. 본 instance single-edit 별 진행** — cost 큼, 차단 매번 사용자 인가.

**D. 다음 fresh session** — 본 세션 token 누적 매우 큼.

## scope discipline

본 PR scope = implementation guide doc 만 (doc-only, classifier 통과). actual fix 는 사용자 settings 인가 후 다음 instance 자동 apply 또는 사용자 manual.

## 변경 파일 (2 files / +281 +2)

- docs/exploration/2026-05-29-sprint-4-8-implementation-guide.md (신규 ~280 lines)
- plugins/opnd-codex/CHANGELOG.md (+2 lines Unreleased)

## merge 전략

**Squash merge** — 1 commit `docs(exploration): Sprint 4-8 implementation guide` 로 clean.
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.

1 participant