Skip to content

Commit a8eeec0

Browse files
committed
docs: record opencode go official contract retry
1 parent db28385 commit a8eeec0

3 files changed

Lines changed: 181 additions & 78 deletions

File tree

devlog/131_opencode-go-metadata-drift/00_plan.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,26 @@ models. The root cause is that OpenCode Go's `/v1/models` endpoint only exposes
1313
`id/object/created/owned_by`, while the exact `context/output/modalities` values live in
1414
OpenCode's official `/data/...` catalog pages.
1515

16+
## Retry Update: Web SOT Split
17+
18+
The first upstream GJC PR (#914) was closed after review because it treated every tracked
19+
OpenCode Go id as `/v1/chat/completions` and reused generic data-page prices for rows where
20+
the Go product page publishes a different contract. The retry uses a split source of truth:
21+
22+
- `https://opencode.ai/docs/go/#endpoints` is authoritative for the OpenCode Go gateway
23+
endpoint/API SDK path.
24+
- `https://opencode.ai/docs/go/#usage-limits` is authoritative for current Go product
25+
prices when the row appears in that table.
26+
- `https://opencode.ai/data/...` pages remain authoritative for context/output/modalities.
27+
- `https://opencode.ai/zen/go/v1/models` is existence-only for this work because it returns
28+
model ids without context/output/pricing metadata.
29+
30+
This means MiniMax M2.5/M2.7/M3 and Qwen3.6/3.7 Plus/Max must route to
31+
`anthropic-messages` on `https://opencode.ai/zen/go`, while GLM/Kimi/DeepSeek/MiMo rows in
32+
the endpoint table route to `openai-completions` on `https://opencode.ai/zen/go/v1`.
33+
Qwen Plus rows have tiered prices in the Go usage table; generated rows advertise a 1M
34+
context window, so the retry encodes the `> 256K tokens` tier.
35+
1636
## Official Source Values
1737

1838
These are the Phase 131 source-of-truth values verified from official OpenCode data pages on
@@ -45,6 +65,7 @@ These are the Phase 131 source-of-truth values verified from official OpenCode d
4565

4666
Official evidence pages:
4767

68+
- `https://opencode.ai/docs/go/`
4869
- `https://opencode.ai/data/deepseek/deepseek-v4-flash`
4970
- `https://opencode.ai/data/zhipu/glm-5-2`
5071
- `https://opencode.ai/data/moonshot/kimi-k2-7-code`
@@ -111,4 +132,3 @@ Plan:
111132
`max_context_window`, and `auto_compact_token_limit`.
112133
- No token values are printed.
113134
- No unrelated dirty worktree changes are reverted.
114-
Lines changed: 112 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,152 @@
1-
# 131.10 — Verification: OpenCode Go Metadata Drift Closure
1+
# 131.10 — Verification: OpenCode Go Metadata Drift Retry
22

33
## Scope
44

5-
Phase 131 closes the OpenCode Go metadata drift across three repositories:
5+
Phase 131 retry replaces the closed GJC PR #914 assumptions with the current official
6+
OpenCode Go web contract.
67

7-
- GJC upstream clone on `dev`: `/Users/jun/Developer/new/700_projects/jawcode/devlog/_upstream_gjc`
8-
- jawcode on `dev`: `/Users/jun/Developer/new/700_projects/jawcode`
9-
- opencodex on `dev`: `/Users/jun/Developer/new/700_projects/opencodex`
8+
Source-of-truth split:
109

11-
The source-of-truth values are recorded in `00_plan.md`. The generated model contracts still
12-
support only `text` and `image` inputs, so official `video`, `audio`, and `pdf` support remains
13-
recorded as source evidence but is not emitted into generated rows.
10+
- `https://opencode.ai/docs/go/#endpoints`: OpenCode Go endpoint/API SDK routing.
11+
- `https://opencode.ai/docs/go/#usage-limits`: current Go product prices for rows present
12+
in the usage table.
13+
- `https://opencode.ai/data/...`: context window, output limit, and modality facts.
14+
- `https://opencode.ai/zen/go/v1/models`: existence-only; the endpoint does not expose
15+
context/output/pricing metadata.
16+
17+
## Official Routing Contract
18+
19+
Routes encoded in GJC and jawcode:
20+
21+
- `openai-completions` on `https://opencode.ai/zen/go/v1`: `deepseek-v4-flash`,
22+
`deepseek-v4-pro`, `glm-5.1`, `glm-5.2`, `kimi-k2.6`, `kimi-k2.7-code`, `mimo-v2.5`,
23+
`mimo-v2.5-pro`.
24+
- `anthropic-messages` on `https://opencode.ai/zen/go`: `minimax-m2.5`, `minimax-m2.7`,
25+
`minimax-m3`, `qwen3.6-plus`, `qwen3.7-max`, `qwen3.7-plus`.
26+
27+
Rows present in the data catalog but absent from the current Go endpoint table retain data-page
28+
metadata and are not used to infer undocumented endpoint overrides.
1429

1530
## GJC
1631

32+
Repository:
33+
34+
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_upstream_gjc`
35+
36+
Branch:
37+
38+
- `codex/opencode-go-contract`, based on `origin/dev`.
39+
1740
Modified:
1841

1942
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_upstream_gjc/packages/ai/src/provider-models/openai-compat.ts`
2043
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_upstream_gjc/packages/ai/test/issue-887-repro.test.ts`
21-
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_upstream_gjc/packages/ai/src/model-thinking.ts`
2244
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_upstream_gjc/packages/ai/src/models.json`
2345

2446
Verification:
2547

26-
- `bun test packages/ai/test/issue-887-repro.test.ts` passed: 10 tests, 0 failures.
48+
- `bun test packages/ai/test/issue-887-repro.test.ts` passed: 17 tests, 0 failures,
49+
32 assertions.
2750
- `bun --cwd=packages/ai run generate-models` produced `opencode-go: 20 models`.
51+
- Generated contract check passed: `checked=8 bad=0` for routing, base URL, context,
52+
output, and price samples.
2853
- `bun --cwd=packages/ai run check` passed.
29-
- Custom 20-row comparison against generated `opencode-go` rows returned `bad=0`.
30-
- GJC PR #914 (`Yeachan-Heo/gajae-code`, base `dev`) CI passed all checks:
31-
`gh pr checks 914 --repo Yeachan-Heo/gajae-code` returned 12 passing checks.
32-
33-
GJC needed one extra guard in `model-thinking.ts`: the global `minimax-m3` 1M policy now excludes
34-
`provider === "opencode-go"`, because OpenCode Go's official `minimax-m3` context is 512000.
3554

3655
## jawcode
3756

57+
Repository:
58+
59+
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_worktrees/opencode-go-contract`
60+
61+
Branch:
62+
63+
- `codex/opencode-go-contract`, based on `origin/dev` in a separate worktree to preserve
64+
unrelated dirty files in `/Users/jun/Developer/new/700_projects/jawcode`.
65+
3866
Modified:
3967

40-
- `/Users/jun/Developer/new/700_projects/jawcode/packages/ai/src/provider-models/openai-compat.ts`
41-
- `/Users/jun/Developer/new/700_projects/jawcode/packages/ai/test/issue-887-repro.test.ts`
42-
- `/Users/jun/Developer/new/700_projects/jawcode/packages/ai/src/models.json`
68+
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_worktrees/opencode-go-contract/packages/ai/src/provider-models/openai-compat.ts`
69+
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_worktrees/opencode-go-contract/packages/ai/test/issue-887-repro.test.ts`
70+
- `/Users/jun/Developer/new/700_projects/jawcode/devlog/_worktrees/opencode-go-contract/packages/ai/src/models.json`
4371

4472
Verification:
4573

46-
- `bun test packages/ai/test/issue-887-repro.test.ts` passed: 10 tests, 0 failures, 19 assertions.
74+
- `bun test packages/ai/test/issue-887-repro.test.ts` passed: 17 tests, 0 failures,
75+
32 assertions.
4776
- `bun --cwd=packages/ai run generate-models` produced `opencode-go: 20 models`.
48-
- `bun --cwd=packages/ai run check` passed.
49-
- Custom 20-row comparison against generated `opencode-go` rows returned `bad=0`.
50-
51-
Commit:
52-
53-
- `80395c9c fix(ai): sync opencode go model metadata`
77+
- Generated contract check passed: `checked=8 bad=0` for routing, base URL, context,
78+
output, and price samples.
79+
- `bun --cwd=packages/ai run check` passed after temporarily linking the existing parent
80+
repo `node_modules` into the worktree for type resolution; the symlink was removed and not
81+
staged.
5482

55-
Existing jawcode dirty files were preserved and not staged:
83+
Existing dirty files preserved outside the worktree:
5684

5785
- `/Users/jun/Developer/new/700_projects/jawcode/AGENTS.md`
5886
- `/Users/jun/Developer/new/700_projects/jawcode/.agents/`
5987
- `/Users/jun/Developer/new/700_projects/jawcode/.claude/`
6088

6189
## opencodex
6290

63-
Modified:
91+
Repository:
92+
93+
- `/Users/jun/Developer/new/700_projects/opencodex`
94+
95+
Branch:
96+
97+
- `codex/opencode-go-contract`
98+
99+
Implementation result:
64100

65-
- `/Users/jun/Developer/new/700_projects/opencodex/src/generated/jawcode-model-metadata.ts`
66-
- `/Users/jun/Developer/new/700_projects/opencodex/scripts/generate-jawcode-metadata.ts`
67-
- `/Users/jun/Developer/new/700_projects/opencodex/src/codex-catalog.ts`
68-
- `/Users/jun/Developer/new/700_projects/opencodex/tests/codex-catalog.test.ts`
69-
- `/Users/jun/Developer/new/700_projects/opencodex/devlog/131_opencode-go-metadata-drift/10_verification.md`
101+
- `JAWCODE_MODELS_JSON=/Users/jun/Developer/new/700_projects/jawcode/devlog/_worktrees/opencode-go-contract/packages/ai/src/models.json bun run generate:jawcode-metadata`
102+
was executed and verified. It introduced no `opencode-go` metadata delta because opencodex
103+
stores context/output/modalities only; endpoint and price changes live in GJC/jawcode.
104+
- The generated-file diff was intentionally reduced back to zero to avoid unrelated dynamic
105+
`openrouter` metadata churn from the jawcode worktree.
106+
- The no-code-runtime rationale is recorded in `20_opencodex-integration.md`.
70107

71108
Verification:
72109

73-
- `bun run generate:jawcode-metadata` regenerated from
74-
`/Users/jun/Developer/new/700_projects/jawcode/packages/ai/src/models.json`.
75-
- `bun test tests/codex-catalog.test.ts` passed: 12 tests, 0 failures, 90 assertions.
76-
- `bun test tests/provider-registry-parity.test.ts` passed: 8 tests, 0 failures, 23 assertions.
77-
- `bun test tests` passed: 65 tests, 0 failures, 234 assertions.
110+
- `bun test tests/codex-catalog.test.ts` passed: 13 tests, 0 failures, 98 assertions.
111+
- `bun test tests/provider-registry-parity.test.ts` passed: 8 tests, 0 failures,
112+
23 assertions.
113+
- OpenCode Go generated metadata sample check passed: `metadata_checked=5 bad=0`.
114+
- `bun test tests` passed: 88 tests, 0 failures, 287 assertions.
78115
- `bun x tsc --noEmit` passed.
79-
- Generated metadata 20-row comparison for `opencode-go` returned `bad=0`.
80-
81-
Real `ocx` verification found one extra runtime gap after the first commit:
82-
83-
- `ocx` is correctly symlinked to the local repository:
84-
`/Users/jun/.local/bin/ocx` -> `/Users/jun/Developer/new/700_projects/opencodex/dist/bin/ocx`
85-
-> `/Users/jun/Developer/new/700_projects/opencodex/src/cli.ts`.
86-
- `ocx sync` originally still omitted official rows absent from the live provider `/v1/models`
87-
response unless they were manually configured.
88-
- The runtime catalog path now augments configured `opencode-go` with generated jawcode metadata
89-
rows before disabled-model filtering.
90-
- Current user config intentionally disables `opencode-go/qwen3.5-plus` and
91-
`opencode-go/hy3-preview`, so they remain absent from the live catalog by configuration.
92-
93-
Post-patch local `ocx` smoke:
94-
95-
- `ocx stop; ocx start` started the proxy on `http://localhost:10100`.
96-
- `GET /healthz` returned status `ok`.
97-
- `GET /v1/models?client_version=0.141.0` returned HTTP 200.
98-
- `opencode-go/glm-5.2` returned `context_window=1000000`,
99-
`auto_compact_token_limit=900000`, `input_modalities=["text"]`, `supports_websockets=true`.
100-
- `opencode-go/kimi-k2.7-code` returned `context_window=262144`,
101-
`auto_compact_token_limit=235929`, `input_modalities=["text","image"]`, `supports_websockets=true`.
102-
- `opencode-go/minimax-m3` returned `context_window=512000`,
103-
`auto_compact_token_limit=460800`, `input_modalities=["text","image"]`, `supports_websockets=true`.
104-
105-
The catalog regression test now locks high-risk OpenCode Go rows through the full opencodex path:
106-
107-
- `glm-5.2`: `context_window=1000000`, `auto_compact_token_limit=900000`, `input_modalities=["text"]`
108-
- `qwen3.5-plus`: `context_window=1000000`, `auto_compact_token_limit=900000`, `input_modalities=["text","image"]`
109-
- `kimi-k2.7-code`: `context_window=262144`, `auto_compact_token_limit=235929`, `input_modalities=["text","image"]`
110-
- `minimax-m3`: `context_window=512000`, `auto_compact_token_limit=460800`, `input_modalities=["text","image"]`
111-
- `hy3-preview`: `context_window=256000`, `auto_compact_token_limit=230400`, `input_modalities=["text"]`
112-
113-
## Result
114-
115-
The OpenCode Go metadata drift is closed at source generation, jawcode consumption, and opencodex
116-
catalog export. Codex routed catalog entries now receive corrected context limits and compaction
117-
thresholds for the tracked OpenCode Go models.
116+
- local `ocx` catalog smoke passed and the proxy was stopped afterward.
117+
118+
Runtime `ocx` smoke:
119+
120+
- `ocx start` started the proxy on `http://localhost:10100`.
121+
- `GET http://127.0.0.1:10100/healthz` returned `health ok`.
122+
- `GET http://127.0.0.1:10100/v1/models?client_version=0.141.0` returned Codex catalog
123+
rows with corrected OpenCode Go limits:
124+
- `opencode-go/glm-5.2`: `context_window=1000000`,
125+
`max_context_window=1000000`, `auto_compact_token_limit=900000`,
126+
`input_modalities=["text"]`.
127+
- `opencode-go/kimi-k2.7-code`: `context_window=262144`,
128+
`max_context_window=262144`, `auto_compact_token_limit=235929`,
129+
`input_modalities=["text","image"]`.
130+
- `opencode-go/minimax-m3`: `context_window=512000`,
131+
`max_context_window=512000`, `auto_compact_token_limit=460800`,
132+
`input_modalities=["text","image"]`.
133+
- `opencode-go/qwen3.7-plus`: `context_window=1000000`,
134+
`max_context_window=1000000`, `auto_compact_token_limit=900000`,
135+
`input_modalities=["text","image"]`.
136+
- Final state confirmed with `ocx stop`: no running proxy found and opencodex was removed
137+
from Codex config.
138+
139+
## PR / CI
140+
141+
Opened PRs:
142+
143+
- GJC upstream: `https://github.com/Yeachan-Heo/gajae-code/pull/915`
144+
- jawcode: `https://github.com/lidge-jun/jawcode/pull/1`
145+
- opencodex: `https://github.com/lidge-jun/opencodex/pull/1`
146+
147+
Initial CI status after PR creation:
148+
149+
- GJC PR #915: checks pending (`Affected path validation / plan`, `gjc-state-gates / integrity`,
150+
`gjc-state-gates / read`, `gjc-state-gates / runtime`, `gjc-state-gates / static`).
151+
- jawcode PR #1: checks pending (`Affected path validation`, `jwc-state-gates`).
152+
- opencodex PR #1: no checks reported on the branch at creation time.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 131.20 — opencodex Integration Note
2+
3+
## Why There Is No opencodex Runtime Code Patch
4+
5+
Phase 131 retry changes two upstream jawcode/GJC surfaces:
6+
7+
- OpenCode Go endpoint routing: `/v1/chat/completions` versus `/v1/messages`.
8+
- OpenCode Go product pricing from `https://opencode.ai/docs/go/#usage-limits`.
9+
10+
opencodex does not consume either field. Its Codex catalog integration consumes only the
11+
generated jawcode metadata fields represented in
12+
`src/generated/jawcode-model-metadata.ts`:
13+
14+
- `contextWindow`
15+
- `maxTokens`
16+
- `input`
17+
- `reasoning`
18+
- optional `wireModelId`
19+
20+
Those are the fields Codex needs for `context_window`, `max_context_window`,
21+
`auto_compact_token_limit`, and `input_modalities`.
22+
23+
## Existing Guards
24+
25+
The opencodex-side regression surface is already covered by
26+
`tests/codex-catalog.test.ts`:
27+
28+
- `opencode-go high-risk models use official jawcode metadata in the Codex catalog`
29+
locks `glm-5.2`, `qwen3.5-plus`, `kimi-k2.7-code`, `minimax-m3`, and `hy3-preview`.
30+
- `opencode-go catalog sync appends official rows missing from /v1/models` verifies that
31+
generated jawcode rows are appended for configured `opencode-go`, even when the live
32+
provider `/v1/models` endpoint omits them.
33+
34+
The runtime smoke in `10_verification.md` then verifies the same path through real `ocx start`
35+
and `GET /v1/models?client_version=0.141.0`.
36+
37+
## Generated Metadata Result
38+
39+
Regenerating opencodex metadata from the patched jawcode worktree was tested with:
40+
41+
`JAWCODE_MODELS_JSON=/Users/jun/Developer/new/700_projects/jawcode/devlog/_worktrees/opencode-go-contract/packages/ai/src/models.json bun run generate:jawcode-metadata`
42+
43+
The relevant `opencode-go` context/output/modalities rows did not change compared with the
44+
existing committed snapshot. The retry's meaningful payload therefore lives in jawcode/GJC,
45+
while opencodex records the source-of-truth split and verifies the live catalog behavior.
46+
47+
To avoid unrelated dynamic provider churn, no generated metadata diff is committed in
48+
opencodex for this retry.

0 commit comments

Comments
 (0)