Skip to content

2.24.1: six ciris-agent upgrade fixes - #1389

Merged
emooreatx merged 3 commits into
mainfrom
release/2.24.1
Nov 30, 2026
Merged

emooreatx merged 3 commits into
mainfrom
release/2.24.1

Conversation

@emooreatx

Copy link
Copy Markdown
Contributor

Summary

This fixes six bugs in ciris-agent upgrade. An independent read-only review of 2.24.0's upgrade path (NEONCRU, run with Eric's OK) found them, and I checked each one against the code. Every fix has a regression test, and all 15 new or changed test cases fail on the 2.24.0 code (checked by running the suite against origin/main's two modules).

Bug Scenario on 2.24.0 Fix
Reused pid run/ciris-agent.json outlives a crash, and only pid_exists is checked. Once Windows reuses the pid, upgrade stops that program, waits 20 s, then kills its tree. The record carries started (create_time) and is checked to within 1 s. atexit removes our own record. A bool, 0 or negative pid is ignored. A 2.24.0 record with no started is still trusted.
Self-kill The Upgrade button's ciris-agent upgrade is a descendant of CIRIS, so _end_process_tree terminated it. It skips os.getpid(), catches psutil.Error, and waits after kill().
Lost restart The helper is the transient unit's MainPID. It Popen'd systemctl --user start and exited, and the unit's teardown kills the start. --relaunch-sync runs the start to the end, logs its exit and returns it.
systemd-run race systemd-run was Popen'd, then the unit it may be inside was stopped. A failure was ignored and the command returned 0. systemd-run is waited for (timeout 30 s). A non-zero exit raises, and nothing is stopped. A failed stop gives exit 1. ciris@x gets the transient name ciris-x-upgrade-N. --setenv=PATH lets uv be found.
Short wait The helper waits 30 s, but systemd's TimeoutStopSec is 90 s, so the service could be left stopped. --wait-timeout 120 under systemd.
Silent relaunch failure, --to 2.²4.0 A relaunch that fails to start went unlogged, and --to 2.²4.0 raised ValueError with exit 1. The failure is logged with a non-zero exit. Release parts must match [0-9]{1,9} in both modules.

Not changed:

  • A possible Windows race in which Scripts\ciris-agent.exe outlives python.exe by milliseconds. pip reaches the scripts seconds later.
  • The review's unit-detection redesign, which is more than these bugs need.

Version 2.24.1-stable. iOS Resources.zip was rebuilt from source, and the upgrade modules and constants inside it match the tree byte for byte.

Test plan

  • tests/ciris_engine/test_upgrade.py + test_desktop_payload_jre.py: 80 passed, 1 skipped
  • The same suite against 2.24.0's upgrade.py and _upgrade_helper.py: 15 failed (the new cases), 60 passed
  • mypy clean on both modules
  • CI, including python-install-matrix's upgrade step
  • After the tag, the server's windows-upgrade leg FROM=2.24.0 TO=2.24.1

🤖 Generated with Claude Code

https://claude.ai/code/session_01RmimP6te8rzywPKKLNFk17

From an independent review of 2.24.0's upgrade path, each checked
against the code and each with a regression test that fails on 2.24.0:

- the running record is checked against the process start time, and
  removed at a clean exit, so a reused pid is never stopped or ended;
- _end_process_tree skips this process (the Upgrade button's upgrade
  is a descendant of the CIRIS it closes) and waits after kill;
- under systemd the helper runs `systemctl --user start` to the end
  (it is the transient unit's main process), and waits 120 s, past
  systemd's 90 s stop timeout;
- systemd-run is waited for before the unit is stopped; a failing
  systemd-run or stop is exit 1 and stops nothing; template units get
  a valid transient name; PATH is passed so uv is found;
- a relaunch that cannot start is logged and gives a non-zero exit;
- release parts are ASCII digits, at most 9 each ("²".isdigit()).

Version 2.24.1-stable; iOS Resources.zip rebuilt from source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RmimP6te8rzywPKKLNFk17
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-29T18:37:00.848013Z
We couldn’t complete this review. Comment @codex review to try again.
36b8b08 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

emooreatx and others added 2 commits November 29, 2026 19:28
The agent sometimes sent its previous answer again. _get_channel_history
reversed every adapter's result ("the bus returns newest-first"), but
the API adapter returns oldest first. So API history reached the model
newest first while numbered MESSAGE_1..N as if chronological, and every
marker carried the read time. The model saw "user asks the current
question; CIRIS answers it" from the previous turn's reply and sent it
again: 43 recycled answers in the safety batteries since 2026-09-24
(ja 11-29 run 46234462958: the q02 ASPDMA prompt's history is
[q02, answer to q01, q01]).

- _chronological(): sort by each message's own time; fall back to the
  newest-first convention only when an adapter gives no time.
- Each history marker carries the time the message was sent.
- Tests for oldest-first, newest-first and shuffled adapter output, the
  exact bug shape, marker times and timestamp parsing; 5 fail on the
  2.24.0 observer.

iOS Resources.zip rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RmimP6te8rzywPKKLNFk17
… E1/E2); one 2.24.1 changelog section

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RmimP6te8rzywPKKLNFk17
@sonarqubecloud

Copy link
Copy Markdown

@emooreatx
emooreatx merged commit baeca7a into main Nov 30, 2026
53 checks passed
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.

1 participant