Skip to content

Commit 9077f7c

Browse files
junjun
authored andcommitted
Merge branch 'dev' into preview: GPT-Live voice relay fixes (protocol headers + sideband API host)
2 parents 4f8a872 + 3b766d9 commit 9077f7c

134 files changed

Lines changed: 9119 additions & 598 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -317,38 +317,64 @@ jobs:
317317
fi
318318
npm_metadata="Published to npm as \`@bitkyc08/opencodex@${RELEASE_VERSION}\` with dist-tag \`${NPM_DIST_TAG}\`."
319319
320-
if [ -z "$existing_tag_sha" ]; then
321-
git tag "$release_tag" "$GITHUB_SHA"
322-
git push origin "refs/tags/${release_tag}"
323-
fi
324-
325320
# Preview builds must be marked prerelease so GitHub "latest" keeps pointing at the
326321
# stable channel (matching npm dist-tags); see issue #64.
327322
prerelease_flag=""
328323
if [[ "$RELEASE_VERSION" == *-preview.* ]]; then
329324
prerelease_flag="--prerelease"
330325
fi
331326
332-
if gh release view "$release_tag" >/dev/null 2>&1; then
333-
notes_file="$(mktemp)"
327+
# Build notes before tagging: if generate-notes fails after a tag push, preflight
328+
# blocks retries because the tag already exists. API uses target_commitish, so the
329+
# tag need not exist yet. Preflight already rejects an existing GitHub Release for
330+
# non-dry runs, so this step only creates.
331+
notes_file="$(mktemp)"
332+
pr_notes=""
333+
if [ -n "$previous_tag" ]; then
334334
generate_notes_api=(
335335
"repos/${GITHUB_REPOSITORY}/releases/generate-notes"
336336
-f "tag_name=${release_tag}"
337337
-f "target_commitish=${GITHUB_SHA}"
338+
-f "previous_tag_name=${previous_tag}"
338339
)
339-
if [ -n "$previous_tag" ]; then
340-
generate_notes_api+=(-f "previous_tag_name=${previous_tag}")
341-
fi
342-
{
343-
printf '%s\n\n' "$npm_metadata"
344-
gh api "${generate_notes_api[@]}" --jq '.body'
345-
} > "$notes_file"
346-
gh release edit "$release_tag" --title "$release_tag" --notes-file "$notes_file" ${prerelease_flag:+$prerelease_flag}
340+
# Fail closed: missing PR categories is a broken release note, not a soft skip.
341+
pr_notes="$(gh api "${generate_notes_api[@]}" --jq '.body')"
342+
# Drop generate-notes' trailing compare link; we re-append it after the commit list.
343+
pr_notes="$(printf '%s\n' "$pr_notes" | sed '/^\*\*Full Changelog\*\*:/d')"
344+
else
345+
# First release on this channel: never call generate-notes without previous_tag_name.
346+
# GitHub would baseline the newest repo tag, which may belong to the other channel.
347+
echo "::notice::No previous channel tag; skipping generate-notes (commits-only notes)"
348+
fi
349+
350+
if [ -n "$previous_tag" ]; then
351+
commit_range="${previous_tag}..${GITHUB_SHA}"
352+
commits="$(git log --pretty=format:'- %s (%h)' "$commit_range")"
347353
else
348-
generate_notes_args=(--generate-notes)
354+
# First release on a channel has no previous tag; cap history so the notes
355+
# body stays within GitHub release size limits.
356+
commits="$(git log --pretty=format:'- %s (%h)' --max-count=100 "$GITHUB_SHA")"
357+
fi
358+
359+
{
360+
printf '%s\n\n' "$npm_metadata"
361+
if [ -n "$(printf '%s' "$pr_notes" | tr -d '[:space:]')" ]; then
362+
printf '%s\n\n' "$pr_notes"
363+
fi
364+
if [ -n "$commits" ]; then
365+
printf '## Commits\n\n'
366+
printf '%s\n\n' "$commits"
367+
fi
349368
if [ -n "$previous_tag" ]; then
350-
generate_notes_args+=(--notes-start-tag "$previous_tag")
369+
printf '**Full Changelog**: https://github.com/%s/compare/%s...%s\n' \
370+
"$GITHUB_REPOSITORY" "$previous_tag" "$release_tag"
351371
fi
352-
gh release create "$release_tag" --target "$GITHUB_SHA" --title "$release_tag" \
353-
--notes "$npm_metadata" "${generate_notes_args[@]}" ${prerelease_flag:+$prerelease_flag}
372+
} > "$notes_file"
373+
374+
if [ -z "$existing_tag_sha" ]; then
375+
git tag "$release_tag" "$GITHUB_SHA"
376+
git push origin "refs/tags/${release_tag}"
354377
fi
378+
379+
gh release create "$release_tag" --target "$GITHUB_SHA" --title "$release_tag" \
380+
--notes-file "$notes_file" ${prerelease_flag:+$prerelease_flag}

README.ja.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,17 @@ opencodex にはプロキシを自動起動する方法が 2 つあります:
273273
| **方式** | OS サービスマネージャー(launchd / systemd / schtasks) | `codex` スクリプトランチャーをラップし実際の `codex.exe` は触らない |
274274
| **タイミング** | ログイン後に常時実行 | オンデマンド — `codex` 起動時に `ocx ensure` を実行 |
275275
| **再起動** | クラッシュ時に自動再起動 | `codex` 呼び出しごとに 1 回起動 |
276-
| **Codex 更新** | 影響なし | `ocx codex-shim install` または `ocx update` 時に修復 |
276+
| **Codex 更新** | 影響なし | 安定して置換されたランチャーは次の通常の `ocx` コマンドで修復 |
277277
| **削除** | `ocx service uninstall` | `ocx codex-shim uninstall` |
278278

279279
常にプロキシを起動しておくには **service**(開発マシン推奨)、軽くオンデマンドで使うには **shim** を使ってください。
280+
281+
外部の Codex 更新でインストール済み shim が上書きされた場合、次の通常の `ocx` コマンドが
282+
安定した新しいランチャーをバックアップして shim を復元します。まだ変更中のランチャーには触れず、
283+
後続のコマンドで再試行します。修復失敗は要求されたコマンドを失敗させず警告だけを表示し、手動の
284+
代替手段は `ocx codex-shim install` です。自動修復を無効にするには
285+
`codexShimAutoRestore``false` にするか、プロセスで
286+
`OPENCODEX_CODEX_SHIM_AUTO_RESTORE=0` を設定します。
280287
shim 自動起動はデフォルトでオンで、GUI ダッシュボードからオフにできます。設定されたプロキシポートが既に使用
281288
中の場合、`ocx start` が自動的に別の空きローカルポートを選び、Codex の設定もそのポートに更新します。
282289

README.ko.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,16 @@ opencodex에는 프록시를 자동 시작하는 두 가지 방법이 있습니
264264
| **방식** | OS 서비스 관리자 (launchd / systemd / schtasks) | `codex` 스크립트 런처를 래핑하며 실제 `codex.exe`는 건드리지 않음 |
265265
| **시점** | 로그인 후 항상 실행 | 온디맨드 — `codex` 실행 시 `ocx ensure` 실행 |
266266
| **재시작** | 크래시 시 자동 재시작 | `codex` 호출마다 한 번 시작 |
267-
| **Codex 업데이트** | 영향 없음 | `ocx codex-shim install` 또는 `ocx update` 복구 |
267+
| **Codex 업데이트** | 영향 없음 | 안정적으로 교체가 끝난 런처는 다음 일반 `ocx` 명령에서 복구 |
268268
| **제거** | `ocx service uninstall` | `ocx codex-shim uninstall` |
269269

270270
항상 프록시를 켜두려면 **service** (개발 머신 권장), 가볍게 온디맨드로 쓰려면 **shim**을 사용하세요.
271+
272+
외부 Codex 업데이트가 설치된 shim을 덮어쓰면 다음 일반 `ocx` 명령이 안정화된 새 런처를 백업하고
273+
shim을 복구합니다. 아직 변경 중인 런처는 건드리지 않고 이후 명령에서 다시 시도합니다. 복구 실패는
274+
요청한 명령을 실패시키지 않고 경고만 출력하며, 수동 대체 명령은 `ocx codex-shim install`입니다.
275+
자동 복구를 끄려면 `codexShimAutoRestore``false`로 설정하거나 프로세스에
276+
`OPENCODEX_CODEX_SHIM_AUTO_RESTORE=0`을 설정하세요.
271277
shim 자동 시작은 기본으로 켜져 있으며 GUI 대시보드에서 끌 수 있습니다. 설정된 프록시 포트가 이미 사용
272278
중이면 `ocx start`가 자동으로 다른 빈 로컬 포트를 고르고 Codex 설정도 그 포트로 갱신합니다.
273279

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,20 @@ opencodex has two ways to auto-start the proxy:
305305
| **How** | OS service manager (launchd / systemd / schtasks) | Wraps script launchers for `codex`; real `codex.exe` is left untouched |
306306
| **When** | Always running after login | On-demand — runs `ocx ensure` when `codex` is launched |
307307
| **Restart** | Auto-restarts on crash | Starts once per `codex` invocation |
308-
| **Codex updates** | Unaffected | Repairs on next `ocx codex-shim install` or `ocx update` |
308+
| **Codex updates** | Unaffected | A completed stable launcher replacement is repaired by the next ordinary `ocx` command |
309309
| **Remove** | `ocx service uninstall` | `ocx codex-shim uninstall` |
310310

311311
Use the **service** for always-on proxy (recommended for development machines). Use the **shim** for
312312
lightweight, on-demand proxy startup without a background daemon. Shim autostart is enabled by default
313313
and can be disabled from the GUI dashboard. If the configured proxy port is already busy, `ocx start`
314314
automatically picks another free local port and updates Codex to use it.
315315

316+
If an external Codex update overwrites an installed shim, the next ordinary `ocx` command backs up
317+
the stable new launcher and restores the shim. A launcher that is still changing is left untouched
318+
and retried later. Repair failures warn without failing the requested command; use
319+
`ocx codex-shim install` as the manual fallback. Set `codexShimAutoRestore` to `false`, or set
320+
`OPENCODEX_CODEX_SHIM_AUTO_RESTORE=0` for a process-level opt-out.
321+
316322
### Uninstall
317323

318324
Before removing the npm package, clean up local state:

README.ru.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,16 @@ ocx update [--tag preview] # обновить opencodex; preview-устан
305305
| **Как** | Менеджер служб ОС (launchd / systemd / schtasks) | Оборачивает скриптовые лончеры `codex`; настоящий `codex.exe` не затрагивается |
306306
| **Когда** | Всегда работает после входа в систему | По требованию — выполняет `ocx ensure` при запуске `codex` |
307307
| **Перезапуск** | Автоматический перезапуск при сбое | Запускается один раз на каждый вызов `codex` |
308-
| **Обновления Codex** | Не влияют | Восстанавливается при следующем `ocx codex-shim install` или `ocx update` |
308+
| **Обновления Codex** | Не влияют | Стабильно заменённый лончер восстанавливается следующей обычной командой `ocx` |
309309
| **Удаление** | `ocx service uninstall` | `ocx codex-shim uninstall` |
310310

311311
Используйте **службу**, если прокси должен работать постоянно (рекомендуется для машин разработчиков).
312+
Если внешнее обновление Codex перезапишет установленный shim, следующая обычная команда `ocx`
313+
сохранит стабильный новый лончер в резервную копию и восстановит shim. Лончер, который ещё меняется,
314+
остаётся нетронутым до следующей команды. Ошибка восстановления выдаёт предупреждение, но не приводит
315+
к сбою запрошенной команды; ручной вариант — `ocx codex-shim install`. Для отключения установите
316+
`codexShimAutoRestore` в `false` или задайте процессу
317+
`OPENCODEX_CODEX_SHIM_AUTO_RESTORE=0`.
312318
Используйте **shim** для лёгкого запуска прокси по требованию без фонового демона. Автозапуск через
313319
shim включён по умолчанию и отключается в GUI-панели управления. Если настроенный порт прокси уже
314320
занят, `ocx start` автоматически выберет другой свободный локальный порт и обновит настройки Codex.

README.zh-CN.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,16 @@ opencodex 提供两种自动启动代理的方式:
257257
| **方式** | OS 服务管理器(launchd / systemd / schtasks) | 包装 `codex` 脚本启动器;不会改动真实 `codex.exe` |
258258
| **时机** | 登录后始终运行 | 按需 — 仅在运行 `codex` 时启动 |
259259
| **重启** | 崩溃后自动重启 | 每次调用 `codex` 时启动一次 |
260-
| **Codex 更新** | 不受影响 | 下次运行 `ocx codex-shim install``ocx update` 时修复 |
260+
| **Codex 更新** | 不受影响 | 稳定完成的启动器替换会在下一条普通 `ocx` 命令中修复 |
261261
| **移除** | `ocx service uninstall` | `ocx codex-shim uninstall` |
262262

263263
如需常驻代理,使用 **service**(推荐开发环境)。轻量按需启动使用 **shim**
264+
265+
如果外部 Codex 更新覆盖了已安装的 shim,下一条普通 `ocx` 命令会备份已稳定的新启动器并恢复
266+
shim。仍在变化的启动器不会被改动,而会在后续命令中重试。修复失败只会警告,不会让请求的命令
267+
失败;手动备用命令为 `ocx codex-shim install`。若要关闭自动恢复,请将
268+
`codexShimAutoRestore` 设为 `false`,或为进程设置
269+
`OPENCODEX_CODEX_SHIM_AUTO_RESTORE=0`
264270
如果配置的代理端口已被占用,`ocx start` 会自动选择另一个空闲本地端口并更新 Codex 使用它。
265271

266272
### 卸载

0 commit comments

Comments
 (0)