Skip to content

feat: configurable maintenance daemon — auto-aging + auto-dream via config - #452

Merged
ajianaz merged 1 commit into
developfrom
feat/configurable-daemon
Jun 22, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/configurable-daemon

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Changes

Auto-aging and auto-dream intervals are now configurable via [maintenance] in uteke.toml:

[maintenance]
auto_aging_enabled = true         # default: true
auto_aging_interval_hours = 6     # default: 6, min: 1
auto_dream_enabled = true         # default: true
auto_dream_interval_days = 3      # default: 3, min: 1

Server logs enabled/disabled status at startup. Both can be individually disabled.

300 tests pass. Clippy clean. Fmt clean.

…onfig

Auto-aging and auto-dream are now configurable via [maintenance]
section in uteke.toml:

  [maintenance]
  auto_aging_enabled = true         # default: true
  auto_aging_interval_hours = 6     # default: 6
  auto_dream_enabled = true         # default: true
  auto_dream_interval_days = 3      # default: 3

Both can be disabled individually. Server logs which daemons are
enabled/disabled at startup.

Added MaintenanceConfig to CLI config + MaintenanceFileSection to
server config. 300 tests pass.
.unwrap_or(true);
let aging_hours = config
.maintenance
.as_ref()
Ok(result) => {
if result.deleted > 0 {
info!("Auto-aging: cleaned up {} stale memories", result.deleted);
if aging_enabled {
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

❌ Blocked — critical issues found.

🔴 Error (2)

  • crates/uteke-server/src/main.rs:1637 — Both maintenance threads call std::thread::sleep(interval) at the top of the loop and only check SHUTDOWN after waking. With the new configurable intervals, disabling via SIGINT can now be delayed by up to auto_aging_interval_hours hours or auto_dream_interval_days days before the thread exits. This is a concrete shutdown bug in the new loop structure around std::thread::sleep(interval); if SHUTDOWN.load(...) { break; }.
  • crates/uteke-server/src/main.rs:1632 — The interval is computed as std::time::Duration::from_secs(aging_hours * 60 * 60) and Duration::from_secs(dream_days * 24 * 60 * 60). Because aging_hours and dream_days come from deserialized config as u64, very large values can overflow the multiplication in debug builds (panic) or wrap in release builds, producing an incorrect interval and potentially a very short sleep. There is no upper-bound validation in the new config handling.

Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit c8a6767 into develop Jun 22, 2026
8 of 9 checks passed
@ajianaz
ajianaz deleted the feat/configurable-daemon branch June 22, 2026 13:37
ajianaz added a commit that referenced this pull request Aug 13, 2026
…onfig (#452)

Auto-aging and auto-dream are now configurable via [maintenance]
section in uteke.toml:

  [maintenance]
  auto_aging_enabled = true         # default: true
  auto_aging_interval_hours = 6     # default: 6
  auto_dream_enabled = true         # default: true
  auto_dream_interval_days = 3      # default: 3

Both can be disabled individually. Server logs which daemons are
enabled/disabled at startup.

Added MaintenanceConfig to CLI config + MaintenanceFileSection to
server config. 300 tests pass.
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.

2 participants