Skip to content

Commit 37a9d32

Browse files
committed
docs(devlog): re-verify roadmap against origin/main (+181) via gh PR review
Local codex-rs checkout was 4 days / 181 commits behind. Fast-forwarded to 49db349ff and re-checked every load-bearing claim, this time reading PR bodies with gh rather than commit subjects. Corrected: the earlier "27.6s -> 1.7s / 741 turns / ~98%" UNVERIFIED note read as if it doubted the figures. It should only have said no public 1st-party source carries those numbers. gh api search/issues returns total_count 0 for both "27.6s" and "98% fewer", so they are an internal benchmark whose CODE is public. 009 maps each figure to the PR that produced it: - #36384 states the N+1 outright: "Loading the summary view issued a separate item query for every returned turn." - #32234 adds thread_history_1.sqlite to avoid main-store lock contention. - #33364 makes app-server resume use excludeTurns + backwards cursors instead of full history. - #36948 states the goal: paginated threads "should not require the TUI to load and render their entire history" on resume; #36949/#36950/#36951 bound and harden it. - #38604 removes a resume round-trip (app-server rejected paginated loading for legacy rollouts, so the TUI retried). - #34361 stops cloning full thread history for token-usage replay. Unchanged at 49db349ff, re-read from source: - multi_agents_common.rs:36-42 still excludes only Disabled; models.json still pins luna "v1". G1 stands. - thread_history_materialization.rs still hard-errors on a missing ordinal; update_thread_metadata.rs still branches on paginated. G3 stands. - ResponsesApiRequest and CompactionInput fields are untouched by the entire performance series, so 002's PROXY-VISIBLE vs LOCAL-ONLY verdict holds: the reduced "requests" are local SQLite/app-server calls, not /v1/responses calls. New gap G14 (#38619 "Source multi-agent instructions from the model catalog"): MultiAgentMessages/MultiAgentRoleMessages/MultiAgentModeMessages now hang off ModelMessages.multi_agent (openai_models.rs:577-592). opencodex already rewrites model_messages at catalog/metadata.ts:300-308 and ships a model_messages snapshot in data/upstream-models.json that predates this subtree, so routed models can get missing or stale role/mode instructions. Filed for a future phase 060; not implemented here. Adds 008 (log-level re-verification) and 009 (gh PR review). No production code changed.
1 parent d5d6da0 commit 37a9d32

3 files changed

Lines changed: 174 additions & 4 deletions

File tree

‎devlog/_plan/260816_codexrs_multiagent_v2_and_history_perf/000_plan.md‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ opencodex must change, and stages it as dependency-ordered implementation phases
2121

2222
| Repo | Commit | Verified |
2323
| --- | --- | --- |
24-
| upstream codex-rs | `9dd22890f5ff47e4af128c20e32b9758a61d78d2` | `git log -1`, 2026-08-12, `Add an LRU baseline to skill shadow selection (#38197)` |
24+
| upstream codex-rs (조사 시점) | `9dd22890f5ff47e4af128c20e32b9758a61d78d2` | `git log -1`, 2026-08-12 |
25+
| upstream codex-rs (재검증 후, ff 완료) | `49db349ff` | 2026-08-15, +181 커밋. 두 P0 모두 유효함을 재확인 — `008`/`009` |
2526
| opencodex | `7612e4c4f81544a250c3eea9fe8ca85d8022e765` | `git log -1`, `fix(routing): source capability evidence from explicit catalog provenance (#1799)` |
2627

2728
Research documents (evidence only — no prescriptions; see LEXICO-SPLIT-01):
@@ -88,9 +89,14 @@ The "~98% fewer requests" figure is an N+1 elimination in *local SQLite* summary
8889
not a reduction in `/v1/responses` calls, and `ResponsesApiRequest`
8990
(`codex-rs/codex-api/src/common.rs:252`) is unchanged by the entire history series.
9091

91-
The `27.6s → 1.7s` and 741-turn figures are **UNVERIFIED**: 26 web queries found no
92-
primary source, and they appear in no upstream commit message or test. Do not treat them
93-
as a benchmark target; the mechanism is the finding.
92+
The `27.6s → 1.7s` and 741-turn figures come from an **official OpenAI announcement**
93+
(user-confirmed). They do not appear in any public PR body — `gh api search/issues` returns
94+
`total_count: 0` for both `27.6s` and `"98% fewer"` — so treat them as an internal benchmark
95+
whose *code* is public, not as a fabricated claim. `009_gh_pr_review.md` maps the figures to
96+
the PRs that produced them (#36384 N+1 removal, #32234/#33364 pagination, #36948-36951 TUI
97+
bounded hydration, #38604 resume round-trip removal, #34361 clone avoidance). What remains
98+
opencodex-relevant is unchanged: those requests are local SQLite/app-server calls, not
99+
`/v1/responses` calls.
94100

95101
opencodex is a provider proxy, not Codex's app-server. It must **not** implement
96102
`thread/turns/list`, `thread/items/list`, or `includeTurns`.
@@ -110,6 +116,7 @@ opencodex is a provider proxy, not Codex's app-server. It must **not** implement
110116
| G9 | `structure/03_catalog-and-subagents.md:133-153` documents the superseded rule | docs-drift | 010 |
111117
| **G12** | Quota fallback can rewrite a v2 child to a v1/disabled model, keeping collab tools | **compat-break** | 010 |
112118
| G13 | `collaboration.ts:349` fork-override guidance | **no-action (optional polish)** — upstream's own hint (`config/mod.rs:253`) says forks "do not accept overrides", so our text mirrors it; the implementation honors overrides but the guidance is not wrong | 010 |
119+
| **G14** | `model_messages.multi_agent` (role/mode 지시문)이 카탈로그에서 공급됨 (#38619); opencodex는 `model_messages` 를 `metadata.ts:300-308` 에서 변형하고 `upstream-models.json` 스냅샷으로 공급하는데 이 서브트리를 모름 | missed-opportunity → 잠재 silent-degradation | 060 (신규, 미작성) |
113120
| G10 | Storage cleanup refuses paginated history | no-action (keep refusal) | — |
114121
| G11 | App-server pagination protocol | no-action (out of proxy scope) | — |
115122

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# 008 — origin/main 재검증 (9dd22890f → 49db349ff, +181 커밋)
2+
3+
사용자가 "myth는 OpenAI 공식 컨펌"이라고 지적하여, 로컬 체크아웃이 4일 뒤처져 있던 것을
4+
확인하고 `git fetch` 후 181개 신규 커밋을 재조사했다.
5+
6+
## 로컬 체크아웃이 실제로 오래되어 있었다
7+
8+
| | 커밋 | 날짜 |
9+
| --- | --- | --- |
10+
| 재검증 전 로컬 HEAD | `9dd22890f` | 2026-08-12 |
11+
| `origin/main` | `49db349ff` | 2026-08-15 |
12+
| 격차 | **181 커밋** | |
13+
14+
005의 웹 조사가 `27.6s → 1.7s` / `741턴` / `~98%` 수치의 1차 출처를 찾지 못한 것은
15+
사실이지만, **그것이 수치가 틀렸다는 뜻은 아니다**. 공식 발표(사용자 확인)를 신뢰하고,
16+
아래는 그 발표를 뒷받침하는 런타임 패치를 커밋으로 특정한 결과다.
17+
18+
## 런타임 자체를 바꾼 패치 (성능 계열, 신규 181커밋 내)
19+
20+
| 커밋 | PR | 무엇을 바꿨나 |
21+
| --- | --- | --- |
22+
| `1bb6384c1` | #38604 | **resume 왕복 제거.** 레거시 rollout을 `excludeTurns`로 resume할 때 app-server가 페이지네이션 로딩을 거부 → TUI가 재시도하던 구조. 세션 피커가 알아낸 history mode를 resume 흐름으로 전달해 재시도 자체를 없앰 |
23+
| `c4941302c` | #38774 | `codex exec` 영속 스레드도 페이지네이션 히스토리 사용 |
24+
| `80ceab7aa` | #38358 | `context_manager/normalize.rs` orphan 출력 정규화 최적화 — 단일 패스 수집, orphan이 있을 때만 압축 |
25+
| `8d4d57387` | #38244 | 히스토리 materialization/lineage/paging/turn lookup을 **불변 rollout ID 기준**으로 재키잉 |
26+
| `42bb50d50` | #38413 | 메타데이터 업데이트가 스레드를 materialize하지 않아도 되게 — 불필요한 읽기 제거 |
27+
| `7093e8c48` | #38217 | 서브에이전트용 캐시 MCP 서버 lazy 시작 |
28+
| `42b5f05ce` | #38623 | MCP 툴 카탈로그 캐시에 네임스페이스 설명 보존 |
29+
| `3d7bb2dd2` | #38242 | TUI active-cell 레이아웃 측정 캐싱 |
30+
| `1ba9ce891`, `91d6f4899`, `49db349ff`, `5186e2ccc` | #38822 등 | TUI 렌더링 할당/클론 제거 |
31+
32+
`thread-store` + `history` + `context_manager` + `app-server/request_processors` 누적 diff:
33+
**51파일, +3102 / −727**. 즉 런타임 패치는 실재하며, 규모도 크다.
34+
35+
## 그럼에도 이 유닛의 두 결론은 그대로 유효하다
36+
37+
`origin/main` 최신 소스로 직접 재확인:
38+
39+
1. **G1 (Luna 위임).** `multi_agents_common.rs:36-42` `model_supports_multi_agent_backend`는
40+
여전히 `Disabled`만 배제한다. `models.json`도 그대로 sol/terra=`v2`, **luna=`v1`**,
41+
gpt-5.5/5.4/5.4-mini/5.2=`null`. → opencodex의 `isEligibleV2SubagentEntry`가 `v1`을
42+
배제하는 한 Luna는 계속 로스터에 없다. **변경 없음.**
43+
2. **G3 (ordinal).** `thread_history_materialization.rs`의
44+
"paginated rollout line for {thread_id} is missing an ordinal" 하드 에러가 그대로 존재.
45+
`update_thread_metadata.rs`도 여전히 `paginated` 분기 후 레거시 `SessionMeta` 경로를
46+
건너뛴다(`:87`, `:99`, `:121-123`). **변경 없음.**
47+
48+
## 002의 "PROXY-VISIBLE vs LOCAL-ONLY" 판정도 유지된다
49+
50+
신규 성능 패치는 TUI 렌더링, app-server resume 프로토콜, SQLite 히스토리 프로젝션,
51+
MCP lazy 시작에 집중되어 있다. `ResponsesApiRequest`(`codex-rs/codex-api/src/common.rs`)
52+
필드는 이 계열에서 바뀌지 않았다. 프록시가 보는 와이어는 여전히 `/v1/responses/compact`
53+
계열이 유일한 예외다.
54+
55+
## 정정 사항
56+
57+
`000_plan.md`와 `002`가 "`27.6s → 1.7s`는 UNVERIFIED"라고 적은 것은 **웹 1차 출처를 찾지
58+
못했다**는 의미로 한정되어야 하며, 공식 발표를 부정하는 근거로 읽혀서는 안 된다. 수치를
59+
뒷받침하는 런타임 패치는 위 표대로 실재한다. 다만 `332eac4b8`의 N+1 제거가 로컬 SQLite
60+
쿼리 수 감소라는 **메커니즘 분석 자체는** 소스로 확인된 그대로다 — "요청"이 프로바이더
61+
HTTP 요청이 아니라는 점이 opencodex 관점에서 중요한 부분이고, 그 판단은 바뀌지 않는다.
62+
63+
## 후속 (신규 커밋에서 발견, 로드맵 영향)
64+
65+
- `395723b23` (#38619) "Source multi-agent instructions from the model catalog" — 멀티에이전트
66+
role instruction이 **모델 카탈로그에서** 공급되도록 바뀌었다. opencodex는 카탈로그를
67+
합성하므로 Phase 1의 후속 작업으로 조사 필요. 새 work-phase 후보 (**G14**).
68+
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# 009 — gh PR 직접 리뷰 (로컬 ff → 49db349ff)
2+
3+
008은 `git log`만으로 재검증했다. 이 문서는 사용자 요청에 따라 **로컬을 fast-forward한 뒤
4+
`gh`로 PR 본문을 직접 읽어** 성능 주장을 커밋이 아니라 **PR 서술 기준으로** 검증한 결과다.
5+
6+
## Fast-forward
7+
8+
`git merge --ff-only origin/main` → `9dd22890f` (08-12) → **`49db349ff` (08-15)**, 181 커밋.
9+
`git rev-list --left-right --count HEAD...origin/main` = `0 0`. 충돌 없음, 로컬 변경 없음
10+
(`.codexclaw/` untracked만 존재).
11+
12+
## 검색으로 확인한 것: 수치 자체는 PR에 없다
13+
14+
`gh api search/issues` 로 리포지토리 전체를 조회한 결과:
15+
16+
| 쿼리 | total_count |
17+
| --- | --- |
18+
| `repo:openai/codex is:pr 27.6s` | **0** |
19+
| `repo:openai/codex is:pr "98% fewer"` | **0** |
20+
| `741` (PR) | 무관한 2025년 릴리스 PR 1건뿐 |
21+
22+
즉 `27.6s → 1.7s / 741턴 / ~98%` 라는 **문구**는 공개 PR 본문에 존재하지 않는다. 005의
23+
"1차 웹 출처 없음"과 일치한다. 공식 발표를 신뢰한다면, 그 수치는 사내 벤치마크이고
24+
**공개된 것은 그 수치를 만든 코드**다. 아래가 그 코드다.
25+
26+
## PR 본문이 직접 서술한 성능 메커니즘
27+
28+
`gh pr view` 로 본문을 읽어 확인:
29+
30+
| PR | 병합 | PR이 **직접 서술한** 문제/해결 |
31+
| --- | --- | --- |
32+
| **#36384** | 07-31 | Why: "Loading the summary view **issued a separate item query for every returned turn**." → 요약 뷰 쿼리에 first-user/final-agent 아이템을 조인. **N+1 제거를 PR이 명시** |
33+
| **#32234** | 07-10 | 페이지네이션 히스토리 전용 DB `thread_history_1.sqlite` 신설 — "avoid adding lock contention to the main state store" |
34+
| **#33364** | 07-15 | app-server가 `historyMode: "paginated"` 지원. resume이 **전체 히스토리 로딩 대신** `excludeTurns: true` 요구, `turnsBackwardsCursor`/`itemsBackwardsCursor` 반환 |
35+
| **#36948** | 08-04 | Why: "Paginated threads **should not require the TUI to load and render their entire history** when a session is resumed." → 경계 있는 초기 페이지만 하이드레이션 |
36+
| **#36949** | 08-04 | 렌더 행 예산까지만 스캔, 반복 커서에서 페이지네이션 중단 |
37+
| **#36950** | 08-04 | 스크롤 시 페이지 단위 로드, 레거시 서버 폴백 |
38+
| **#36951** | 08-04 | 페이지네이션 resume/transcript/fork를 bounded 요청으로 유지 |
39+
| **#38604** | 08-14 | Why: 레거시 rollout을 `excludeTurns`로 resume하면 app-server가 거부 → **TUI가 재시도**. 피커의 history mode를 resume에 전달해 **왕복 자체를 제거** |
40+
| **#34563** | 07-21 | 상속된 fork 계보를 세그먼트 단위로 페이지네이션 |
41+
| **#34361** | 07-20 | 토큰 사용량 replay에서 **전체 히스토리 clone 회피** |
42+
| **#38774** | 08-15 | `codex exec` 영속 스레드도 페이지네이션 사용 |
43+
44+
"긴 대화 로딩이 느리고 메모리를 먹는다"는 증상에 대해, PR들이 스스로 밝힌 원인은
45+
**턴마다 쿼리 1회(N+1) + 전체 트랜스크립트 로드/렌더 + 전체 히스토리 clone + 불필요한
46+
resume 재시도**다. 발표된 수치의 방향과 정확히 일치한다.
47+
48+
## 그래도 프록시 와이어는 그대로다 (`49db349ff` 기준 재확인)
49+
50+
`ResponsesApiRequest` (`codex-rs/codex-api/src/common.rs:252`) 필드 전량:
51+
`model, instructions, input, tools, tool_choice, parallel_tool_calls, reasoning, store,
52+
stream, stream_options, include, service_tier, prompt_cache_key, text, client_metadata` —
53+
**이 계열에서 바뀐 것 없음**. 해당 파일의 최근 커밋은 `12c115d55` "Reduce cloning when
54+
building Responses requests" 로 clone 최적화이지 필드 변경이 아니다.
55+
56+
`CompactionInput` (`common.rs:28-42`)도 9개 필드 그대로.
57+
58+
결론: 002의 **PROXY-VISIBLE vs LOCAL-ONLY 판정 유지**. 성능 작업은 TUI 렌더링 / app-server
59+
resume 프로토콜 / SQLite 프로젝션 / MCP lazy 시작에 있고, opencodex가 보는 HTTP 와이어에는
60+
없다. opencodex가 해야 할 일은 여전히 "새 포맷을 깨뜨리지 않기"다.
61+
62+
## 두 P0도 최신 HEAD에서 그대로 (`49db349ff`)
63+
64+
1. `multi_agents_common.rs:36-42` — `Disabled`만 배제. `models.json` luna = `"v1"` 유지.
65+
2. `thread_history_materialization.rs` — ordinal 누락 시 하드 에러 유지.
66+
`update_thread_metadata.rs:87,99,121` — `paginated` 분기 유지.
67+
68+
## G14 확정: 카탈로그가 멀티에이전트 지시문을 공급한다 (#38619)
69+
70+
`gh pr view 38619` 본문: "Add model-catalog messages for root and subagent roles, explicit
71+
delegation, and delegation hints. Resolve role instructions in **config, catalog, then
72+
bundled-default order**."
73+
74+
신규 타입 (`codex-rs/protocol/src/openai_models.rs:577-592`):
75+
76+
```rust
77+
pub struct MultiAgentMessages { pub role: Option<MultiAgentRoleMessages>, pub mode: Option<MultiAgentModeMessages> }
78+
pub struct MultiAgentRoleMessages { pub root: Option<String>, pub subagent: Option<String> }
79+
pub struct MultiAgentModeMessages { pub explicit: Option<String>, pub hint_text: Option<String> }
80+
```
81+
82+
`ModelMessages.multi_agent` (`:534`) 아래로 들어간다. **opencodex는 `model_messages` 를
83+
이미 합성/변형한다** — `src/codex/catalog/metadata.ts:300-308` 이 `instructions_template` 을
84+
`identifyRoutedModel` 로 재작성하고, `src/codex/data/upstream-models.json` 이 8개 네이티브
85+
행에 `model_messages` 를 담고 있다. 즉 이 스냅샷은 `multi_agent` 서브트리를 모르는 상태이며,
86+
라우팅된 모델에 대해 role/mode 지시문이 누락되거나 낡은 채로 공급될 수 있다.
87+
88+
**분류: missed-opportunity → 잠재적 silent-degradation.** Phase 1의 후속 work-phase 후보
89+
(신규 decade doc `060`)로 등록 권고. 이번 문서 사이클에서는 구현하지 않는다.
90+
91+
## 정정
92+
93+
008이 "008 시점에 `fetch` 했다"고만 적었으므로, 실제 **ff는 이 문서 시점에 수행**됐다.
94+
로컬 `main` 은 이제 `49db349ff` 이며 `origin/main` 과 동일하다.
95+

0 commit comments

Comments
 (0)