Skip to content

fix: rename service unit to clagentic-console.service + add OOM memory limits#191

Merged
akuehner merged 6 commits into
mainfrom
fix/lr-d22a-lr-fb65-service-rename-oom
Jun 6, 2026
Merged

fix: rename service unit to clagentic-console.service + add OOM memory limits#191
akuehner merged 6 commits into
mainfrom
fix/lr-d22a-lr-fb65-service-rename-oom

Conversation

@akuehner
Copy link
Copy Markdown
Member

@akuehner akuehner commented Jun 6, 2026

Summary

  • Adds deploy/clagentic-console.service: version-controlled systemd unit (lr-fb65, lr-d22a)
  • Renames unit from clagentic.service to clagentic-console.service (lr-fb65)
  • Adds OOM memory limits: MemoryHigh=70%, MemoryMax=85%, OOMPolicy=kill (lr-d22a)
  • Expands .crew/amos.yaml scope to cover deploy/**

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

  • lr-d22a: Add MemoryHigh/MemoryMax/OOMPolicy to clagentic.service
  • lr-fb65: Rename clagentic.service to clagentic-console.service

akuehner and others added 6 commits June 6, 2026 09:50
…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>
@akuehner akuehner merged commit 0af1f7a into main Jun 6, 2026
1 check passed
@akuehner akuehner deleted the fix/lr-d22a-lr-fb65-service-rename-oom branch June 6, 2026 14:16
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