fix: rename service unit to clagentic-console.service + add OOM memory limits#191
Merged
Merged
Conversation
…ce + add OOM memory limits - Adds deploy/clagentic-console.service (versioned copy of the systemd unit) - Renames from clagentic.service to clagentic-console.service (lr-fb65) - Adds MemoryHigh=70%, MemoryMax=85%, OOMPolicy=kill (lr-d22a) - Expands .crew/amos.yaml scope to cover deploy/** Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Required by clagentic-brand CLI Naming Standard (CLI-NAMING-STANDARD.md). Without it, journal filtering by identifier is broken after the rename. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e.service Covers fresh install, rename cutover sequence (with explicit stop-old-before- start-new ordering to prevent update-path break), memory limit verification, and unit file update procedure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- clagentic-console.service: mark CLAGENTIC_MAX_CONCURRENT_SESSIONS with TODO(lr-9452) — bare name matches what sdk-bridge.js reads; renaming here without the code change would silently drop the session cap - deploy/README.md: fix cutover sequence prose to make stop-old-before-start-new obligation explicit (enable/disable don't close the Restart=always window); fix unit-update section to document per-directive restart requirements (MemoryHigh/Max/OOMPolicy/Environment all need a service restart, not just daemon-reload) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds scripts/postinstall.js — runs automatically on `npm install -g`. On Linux root installs: copies deploy/clagentic-console.service to /etc/systemd/system/, enables it, handles rename cutover from the old clagentic.service unit (disable, stop, remove, reload), then starts or restarts clagentic-console.service as appropriate. Non-Linux and non-root installs skip silently. All systemctl calls use execFileSync with an args array (no shell strings) and catch errors per-step so npm install never exits non-zero on systemd failures. Also: add scripts/ and deploy/ to package.json files[], add postinstall script entry, widen .crew/amos.yaml scope to include scripts/** and package.json, remove deploy/README.md (content moved into postinstall script logic and comments). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nal fresh-start - daemon.js: pass CLAGENTIC_SELF_UPDATE=1 env to npm install -g so postinstall knows not to restart the service (gracefulShutdown handles it) - postinstall.js: skip all start/restart when CLAGENTIC_SELF_UPDATE=1 - postinstall.js: drop unconditional fresh-install auto-start — daemon needs config before it can run; starting without it loops under Restart=always - postinstall.js: surface err.stderr in warnings (execFileSync puts detail there) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Percentage syntax requires systemd 240+; host runs systemd 255 (Ubuntu 24.04).
Operator actions required on next maintenance window
After merging, run on the host:
cp /workspace/clagentic-console/deploy/clagentic-console.service /etc/systemd/system/clagentic-console.service
systemctl daemon-reload
systemctl enable clagentic-console.service
systemctl disable clagentic.service
rm /etc/systemd/system/clagentic.service
systemctl daemon-reload
systemctl restart clagentic-console.service
The running daemon continues under clagentic.service until the restart. No downtime during the enable/disable step.
Tasks