Skip to content

fix: update Codex and Code Mode host together - #459

Open
marksverdhai wants to merge 3 commits into
mainfrom
fix/codex-helper-update
Open

fix: update Codex and Code Mode host together#459
marksverdhai wants to merge 3 commits into
mainfrom
fix/codex-helper-update

Conversation

@marksverdhai

@marksverdhai marksverdhai commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Codex updates and version switches previously replaced only the CLI, leaving an older Code Mode host behind. With Codex 0.153.4 this caused missing field code_mode_host_duration_ns errors even though commands executed.

Use one release installer for automatic updates and both version-switch paths. It stages the CLI and matching helper from the same release, verifies published SHA256 digests, serializes installation, and restores the previous helper if installing the CLI fails. Older releases without any helper remove the stale helper. Source builds include the helper package when present; download/integrity/install failures no longer silently fall back to building a different version.

The executable replacements are individually atomic. Already-running Codex processes still need restarting after switching versions; this is documented.

Validation:

  • 12 installer regression tests pass under Cargo, covering matching executables, fresh installs, legacy releases, missing assets, failed downloads/checksums/extraction, rollback, symlinks, and source-package detection.
  • A real v0.153.4 install into a temporary directory passes: published archive checksums verified, CLI and host start successfully, and the host contains the previously missing protocol field.
  • CI: 797 library tests pass (4 ignored), Clippy, formatting, and headless compilation pass.
  • Local: cargo test passes (830 tests, 4 ignored); final cargo test --lib agents::codex passes (12 tests); cargo clippy --all-targets -- -D warnings, cargo fmt --all -- --check, and cargo build --release pass.
  • All Linux CI jobs pass, including integration, auth, memory profiling, and Docker builds/publishing. The two macOS CI jobs remain queued.

CI uses a newer Clippy than this machine and flagged an existing chunks_exact(4) loop in the vector decoder. A separate two-line commit uses as_chunks::<4>() with equivalent behavior to keep CI passing.

Closes #458.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Metric Coverage
Lines 58.77%
Functions 64.57%
Regions 59.28%
Per-file breakdown
Filename                           Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
agents/codex.rs                        415               139    66.51%          24                 7    70.83%         266                95    64.29%           0                 0         -
agents/custom_cli.rs                   221                37    83.26%          16                 4    75.00%         159                19    88.05%           0                 0         -
agents/definition.rs                   255                 6    97.65%          11                 1    90.91%         286                 5    98.25%           0                 0         -
agents/install.rs                      179                49    72.63%          12                 3    75.00%         121                36    70.25%           0                 0         -
agents/manager.rs                     1260              1021    18.97%          87                68    21.84%         792               637    19.57%           0                 0         -
agents/types.rs                        157                16    89.81%          16                 1    93.75%         104                15    85.58%           0                 0         -
ansi.rs                                374                62    83.42%          21                 0   100.00%         215                42    80.47%           0                 0         -
auth.rs                                291               129    55.67%          24                 4    83.33%         202               110    45.54%           0                 0         -
clanker.rs                             573               272    52.53%          37                18    51.35%         398               218    45.23%           0                 0         -
cli.rs                                1090               205    81.19%          56                15    73.21%         629               143    77.27%           0                 0         -
config.rs                             1315               112    91.48%          72                 9    87.50%         796                51    93.59%           0                 0         -
gateway/api.rs                        1508               149    90.12%          75                12    84.00%        1136               126    88.91%           0                 0         -
gateway/history.rs                    1092               366    66.48%          71                30    57.75%         804               243    69.78%           0                 0         -
gateway/mod.rs                         849               356    58.07%          45                21    53.33%         585               221    62.22%           0                 0         -
gateway/pty.rs                         219                82    62.56%          13                 4    69.23%         152                52    65.79%           0                 0         -
hooks.rs                              1713               162    90.54%         114                18    84.21%         891               104    88.33%           0                 0         -
hyprland.rs                            292               198    32.19%          36                28    22.22%         213               156    26.76%           0                 0         -
identity.rs                            116                18    84.48%           8                 2    75.00%         102                27    73.53%           0                 0         -
input.rs                               209                44    78.95%          18                 2    88.89%         153                31    79.74%           0                 0         -
interchange/claude.rs                 1630                68    95.83%          97                 5    94.85%         969                37    96.18%           0                 0         -
interchange/codex.rs                  1752               266    84.82%         112                20    82.14%        1095               183    83.29%           0                 0         -
interchange/crossload_index.rs         738                80    89.16%          36                 8    77.78%         414                46    88.89%           0                 0         -
interchange/gemini.rs                 1963               277    85.89%         105                10    90.48%        1212               175    85.56%           0                 0         -
interchange/helpers.rs                  20                 0   100.00%           4                 0   100.00%          11                 0   100.00%           0                 0         -
interchange/hermes.rs                 1425                67    95.30%          61                 8    86.89%         928                37    96.01%           0                 0         -
interchange/hub.rs                     143                 3    97.90%           4                 0   100.00%         126                 3    97.62%           0                 0         -
interchange/inject.rs                 3856              1448    62.45%         289                91    68.51%        2338               851    63.60%           0                 0         -
interchange/mod.rs                     457               438     4.16%          11                 9    18.18%         239               229     4.18%           0                 0         -
interchange/opencode.rs               2605               298    88.56%         221                29    86.88%        1775               190    89.30%           0                 0         -
interchange/passthrough.rs             333                25    92.49%          15                 2    86.67%         240                15    93.75%           0                 0         -
interchange/pi.rs                     2037               179    91.21%         122                 5    95.90%        1153                96    91.67%           0                 0         -
interchange/semantic_eq.rs             240                20    91.67%          14                 1    92.86%         106                20    81.13%           0                 0         -
interchange/sessions.rs               1377               727    47.20%          80                45    43.75%         837               441    47.31%           0                 0         -
json_output.rs                          15                15     0.00%           3                 3     0.00%          17                17     0.00%           0                 0         -
launcher.rs                            939               720    23.32%          55                33    40.00%         606               496    18.15%           0                 0         -
lib.rs                                2052              1737    15.35%          94                72    23.40%        1371              1162    15.24%           0                 0         -
pixel_art.rs                          1515               829    45.28%         122                65    46.72%         958               556    41.96%           0                 0         -
polyfill.rs                           1407                20    98.58%          76                 2    97.37%         821                 5    99.39%           0                 0         -
progress.rs                            376               216    42.55%          19                 6    68.42%         232               141    39.22%           0                 0         -
sandbox.rs                            1416               973    31.29%         103                70    32.04%         994               734    26.16%           0                 0         -
search.rs                             2701              2216    17.96%         129                94    27.13%        1668              1415    15.17%           0                 0         -
skillsync/agy.rs                        44                12    72.73%           6                 2    66.67%          29                 8    72.41%           0                 0         -
skillsync/claude.rs                     32                12    62.50%           7                 3    57.14%          24                 9    62.50%           0                 0         -
skillsync/codex.rs                     110                24    78.18%          10                 3    70.00%          71                13    81.69%           0                 0         -
skillsync/gemini.rs                    134                25    81.34%          14                 3    78.57%          90                12    86.67%           0                 0         -
skillsync/hermes.rs                     23                 6    73.91%           6                 2    66.67%          18                 6    66.67%           0                 0         -
skillsync/mod.rs                      1057               379    64.14%          78                26    66.67%         612               197    67.81%           0                 0         -
skillsync/opencode.rs                   23                 6    73.91%           6                 2    66.67%          18                 6    66.67%           0                 0         -
skillsync/pi.rs                         23                 6    73.91%           6                 2    66.67%          18                 6    66.67%           0                 0         -
stream/claude.rs                       555                32    94.23%          47                 4    91.49%         390                28    92.82%           0                 0         -
stream/codex.rs                        819                65    92.06%          73                 7    90.41%         533                37    93.06%           0                 0         -
stream/mod.rs                          375                16    95.73%          25                 4    84.00%         238                 9    96.22%           0                 0         -
stream/runtime.rs                      296               113    61.82%          19                 7    63.16%         192                58    69.79%           0                 0         -
text_input.rs                          690                59    91.45%          56                 6    89.29%         410                33    91.95%           0                 0         -
theme.rs                               675               169    74.96%          41                10    75.61%         390                91    76.67%           0                 0         -
token_count.rs                          98                98     0.00%           7                 7     0.00%          55                55     0.00%           0                 0         -
tui/app.rs                            9926              6073    38.82%         357               157    56.02%        5948              3550    40.32%           0                 0         -
tui/mod.rs                             443               443     0.00%          21                21     0.00%         316               316     0.00%           0                 0         -
tui/session_picker.rs                  440               282    35.91%          20                 9    55.00%         270               154    42.96%           0                 0         -
updater.rs                            1928              1465    24.01%         124                87    29.84%        1303               995    23.64%           0                 0         -
version/antigravity.rs                  74                44    40.54%           6                 2    66.67%          58                39    32.76%           0                 0         -
version/cache.rs                       142                46    67.61%          13                 2    84.62%          93                30    67.74%           0                 0         -
version/claude.rs                      771               587    23.87%          37                25    32.43%         568               456    19.72%           0                 0         -
version/cli.rs                         277               277     0.00%          21                21     0.00%         193               193     0.00%           0                 0         -
version/codex.rs                       115                71    38.26%          15                12    20.00%          93                61    34.41%           0                 0         -
version/compare.rs                     150                 4    97.33%          10                 0   100.00%          70                 4    94.29%           0                 0         -
version/gemini.rs                      106                73    31.13%           6                 2    66.67%          91                73    19.78%           0                 0         -
version/hermes.rs                      121                60    50.41%          10                 6    40.00%         119                61    48.74%           0                 0         -
version/manager.rs                     309               222    28.16%          30                17    43.33%         200               132    34.00%           0                 0         -
version/opencode.rs                    155               115    25.81%           8                 2    75.00%         124               100    19.35%           0                 0         -
version/pi.rs                           76                43    43.42%           5                 1    80.00%          59                41    30.51%           0                 0         -
version/unleash_self.rs                 50                31    38.00%           6                 5    16.67%          40                21    47.50%           0                 0         -
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                61162             24903    59.28%        3618              1282    64.57%       38747             15974    58.77%           0                 0         -

Raw lcov.info is attached as a workflow artifact.
Generated by cargo llvm-cov --lib.

@marksverdhai
marksverdhai marked this pull request as ready for review September 5, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex updater leaves code-mode host stale, breaking tool result decoding

1 participant