feat(codex-bridge): split into a splitter and a separate bridge process

bridge.py is now a small splitter with no features: a request for one of
Codex's own models goes to chatgpt.com byte for byte, a request for an added
model goes to kopru.py, which runs as its own process. Codex's own models no
longer pass through the feature code at all, and restarting or losing the
bridge process does not touch them.

Measured with real Codex on spare ports: own model answers; forced compaction
on the own model completes (twice) while the bridge process is restarted;
added model answers; no own-model request reaches the bridge process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
yilsemandClaude Opus 5.5 committed 2026-10-11 06:13:29 +03:00
1 parent c0eee2cc2a
commit 23e8aa8191
11 files changed
+2093 -1493

No files matched your search

@@ -3,7 +3,7 @@ import ast
import unittest
from pathlib import Path
tree = ast.parse(Path(__file__).with_name("bridge.py").read_text(encoding="utf-8"))
tree = ast.parse(Path(__file__).with_name("kopru.py").read_text(encoding="utf-8"))
wanted = {"_zstd_decompress", "_zstd_ready", "decompress"}
env = {}
exec(compile(ast.Module(body=[n for n in tree.body if isinstance(n, ast.FunctionDef) and n.name in wanted],