Skip to content

nextjs-ct agent-update: run claude update for every account every night - #703

Merged
ejc3 merged 2 commits into
mainfrom
nextjs-ct-claude-update
Oct 27, 2026
Merged

ejc3 merged 2 commits into
mainfrom
nextjs-ct-claude-update

Conversation

@ejc3

@ejc3 ejc3 commented Oct 27, 2026

Copy link
Copy Markdown
Owner

The nightly agent-update in each nextjs container never updated Claude Code. It ran the installer only when ~/.local/bin/claude was missing, and left updates to Claude's own background updater. But every pool session runs under claw-master connect, which sets DISABLE_AUTOUPDATER=1 for the Claude it launches, so that updater never ran. On 2026-10-26 the job logged 2.1.294 -> 2.1.294 (and 2.1.295, 2.1.299, 2.1.302) in every container while 2.1.311 was out.

What changes

  • scripts/nextjs-ct/ct/agent-update:

    • Update: for each account with a native copy, it runs claude update as the account, from its home, with stdin closed and DISABLE_AUTOUPDATER removed from the environment. It warns when the update fails.
    • Install: an account without a copy still gets the installer.
    • Version log: versions for the before/after line are read from ~/.local/bin/claude directly.
    • Test overrides: the users file, the home root and the AGENTS.md refresh helper can be overridden (AGENT_UPDATE_USERS, AGENT_UPDATE_HOMES, AGENT_UPDATE_REFRESH). The defaults are unchanged.
  • AgentUpdateTests in scripts/test-nextjs-ct-containers.py run the real script against a fake sudo, claude, curl, systemctl and refresh helper. They cover:

    • an update to the latest version, without the disabled updater leaking in;
    • a failed update being reported;
    • the installer for a missing copy.

    All three fail on the old script.

Running sessions keep their binary. Each session's next start (t-claude, or the idle restarts the job already does) runs the new one.

Testing

  • All 112 offline suites from lambda-tests.yml pass.
  • By hand on 2026-10-27, claude update as each container account took every one to 2.1.311:
    • 2.1.299 → 2.1.311;
    • 2.1.295 → 2.1.311 (twice);
    • 2.1.302 → 2.1.311;
    • one account already current.

Codex: reviewed origin/main..42bed43 (one P2, the test reaching the real refresh helper, fixed in debc615), then 42bed43..debc615 (no findings).

ejc3 added 2 commits October 27, 2026 03:30
…ight

The nightly job only ran the Claude installer when ~/.local/bin/claude was
missing and left updates to Claude's own background updater. Every pool
session runs under `claw-master connect`, which sets DISABLE_AUTOUPDATER=1
for the Claude it launches, so that updater never ran: on 2026-10-26 the job
logged "2.1.294 -> 2.1.294" (and 2.1.295, 2.1.299, 2.1.302) in every
container while 2.1.311 was out.

- agent-update: for an account with a native copy, run
  `claude update` as the account with DISABLE_AUTOUPDATER removed from the
  environment, from its home, stdin closed; warn when it fails. An account
  without one still gets the installer. Versions are read from
  ~/.local/bin/claude directly instead of a login shell's `claude`.
- The users file and the home root are overridable
  (AGENT_UPDATE_USERS, AGENT_UPDATE_HOMES) for the tests.
- AgentUpdateTests in test-nextjs-ct-containers.py run the real script
  against a fake sudo, claude, curl and systemctl: an update to the latest,
  a failed update reported, the installer for a missing copy. All three
  fail on the old script.
…he tests fake it

The tests ran the whole job as the real account, and its call to
/usr/local/bin/kid-agents-refresh by absolute path bypassed the PATH fakes:
on a container, that would rewrite the real account's
~/Documents/Codex/AGENTS.md. agent-update now runs $AGENT_UPDATE_REFRESH
(default unchanged), and the tests give it a fake and check it is called
for the account.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f08547f-5afd-403a-80c6-0368be9a6942
Commits

Reviewing files that changed from the base of the PR and between 126b09c and debc615.

Files selected for processing: 2
  • scripts/nextjs-ct/ct/agent-update
  • scripts/test-nextjs-ct-containers.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ejc3
ejc3 marked this pull request as ready for review October 27, 2026 03:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T04:14:20.977729Z debc615 Manual request
🔒 Security Review ✅ Completed 2026-10-27T04:16:31.844084Z debc615 Manual request
ℹ️ 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.

@ejc3

ejc3 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review
@codex security review
@coderabbitai review
@greptileai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ejc3

ejc3 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: debc6155c4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: debc6155c4

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ejc3

ejc3 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

Reviewed debc6155c4eba598a01eb6faa4feeb09c96bde14 at high for code and security: no P1/P2 findings. The nightly job runs the native updater as the account, clears DISABLE_AUTOUPDATER, and preserves the existing idle-session restart policy. It adds no privileges, login copying, or container restarts during provisioning.

Exact-head Terraform validation and offline CI passed, including 64 container tests and 35 Next.js configuration tests. Codex code and security reviews completed with no findings; all comments and review threads were checked. CodeRabbit was requested but is quota-limited, and Greptile has not responded; neither is counted as a sign-off.

@ejc3
ejc3 merged commit 11a5bcc into main Oct 27, 2026
3 checks passed
@ejc3

ejc3 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

Merged and applied as 11a5bcc. The reviewed full plan changed only the published container updater script (0 add / 1 change / 0 destroy); apply succeeded and the full follow-up plan is empty. setup-sync completed successfully, and all five containers have the exact merged updater checksum. Host boot ID, container leaders, and all baseline Claude PIDs were preserved. No nightly updater was invoked manually. /infra/applied-status is clean for this commit.

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