Commit 8473096
authored
Add app-server transport layer with websocket support (openai#10693)
- Adds --listen <URL> to codex app-server with two listen modes:
- stdio:// (default, existing behavior)
- ws://IP:PORT (new websocket transport)
- Refactors message routing to be connection-aware:
- Tracks per-connection session state (initialize/experimental
capability)
- Routes responses/errors to the originating connection
- Broadcasts server notifications/requests to initialized connections
- Updates initialization semantics to be per connection (not
process-global), and updates app-server docs accordingly.
- Adds websocket accept/read/write handling (JSON-RPC per text frame,
ping/pong handling, connection lifecycle events).
Testing
- Unit tests for transport URL parsing and targeted response/error
routing.
- New websocket integration test validating:
- per-connection initialization requirements
- no cross-connection response leakage
- same request IDs on different connections route independently.1 parent 428a9f6 commit 8473096
File tree
13 files changed
+1404
-309
lines changed- codex-rs
- app-server
- src
- tests/suite/v2
- cli/src
13 files changed
+1404
-309
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
45 | | - | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
53 | | - | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1093 | 1093 | | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | | - | |
| 1096 | + | |
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| |||
1107 | 1107 | | |
1108 | 1108 | | |
1109 | 1109 | | |
1110 | | - | |
| 1110 | + | |
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
| |||
1831 | 1831 | | |
1832 | 1832 | | |
1833 | 1833 | | |
| 1834 | + | |
1834 | 1835 | | |
1835 | 1836 | | |
1836 | 1837 | | |
| |||
1858 | 1859 | | |
1859 | 1860 | | |
1860 | 1861 | | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
1861 | 1877 | | |
1862 | 1878 | | |
1863 | 1879 | | |
| |||
1910 | 1926 | | |
1911 | 1927 | | |
1912 | 1928 | | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
| 1929 | + | |
1917 | 1930 | | |
1918 | 1931 | | |
1919 | 1932 | | |
| |||
1952 | 1965 | | |
1953 | 1966 | | |
1954 | 1967 | | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | | - | |
| 1968 | + | |
1959 | 1969 | | |
1960 | 1970 | | |
1961 | 1971 | | |
| |||
1994 | 2004 | | |
1995 | 2005 | | |
1996 | 2006 | | |
1997 | | - | |
1998 | | - | |
1999 | | - | |
2000 | | - | |
| 2007 | + | |
2001 | 2008 | | |
2002 | 2009 | | |
2003 | 2010 | | |
| |||
2046 | 2053 | | |
2047 | 2054 | | |
2048 | 2055 | | |
2049 | | - | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
| 2056 | + | |
2053 | 2057 | | |
2054 | 2058 | | |
2055 | 2059 | | |
| |||
2117 | 2121 | | |
2118 | 2122 | | |
2119 | 2123 | | |
2120 | | - | |
2121 | | - | |
2122 | | - | |
2123 | | - | |
| 2124 | + | |
2124 | 2125 | | |
2125 | 2126 | | |
2126 | 2127 | | |
| |||
2136 | 2137 | | |
2137 | 2138 | | |
2138 | 2139 | | |
2139 | | - | |
2140 | | - | |
2141 | | - | |
2142 | | - | |
| 2140 | + | |
2143 | 2141 | | |
2144 | 2142 | | |
2145 | 2143 | | |
| |||
2276 | 2274 | | |
2277 | 2275 | | |
2278 | 2276 | | |
2279 | | - | |
2280 | | - | |
2281 | | - | |
2282 | | - | |
| 2277 | + | |
2283 | 2278 | | |
2284 | 2279 | | |
2285 | 2280 | | |
| |||
2297 | 2292 | | |
2298 | 2293 | | |
2299 | 2294 | | |
2300 | | - | |
2301 | | - | |
2302 | | - | |
2303 | | - | |
| 2295 | + | |
2304 | 2296 | | |
2305 | 2297 | | |
2306 | 2298 | | |
| |||
2318 | 2310 | | |
2319 | 2311 | | |
2320 | 2312 | | |
2321 | | - | |
2322 | | - | |
2323 | | - | |
2324 | | - | |
| 2313 | + | |
2325 | 2314 | | |
2326 | 2315 | | |
2327 | 2316 | | |
| |||
2487 | 2476 | | |
2488 | 2477 | | |
2489 | 2478 | | |
2490 | | - | |
2491 | | - | |
2492 | | - | |
2493 | | - | |
| 2479 | + | |
2494 | 2480 | | |
2495 | 2481 | | |
2496 | 2482 | | |
| |||
0 commit comments