Skip to content

bug: contradictory server detection log + misleading stats DB size + aging defaults to no auto-cleanup #403

Closed

Description

@ajianaz

Description

Found several issues during validation of uteke v0.2.0 integration with Hermes Agent v0.16.0 on macOS. These are separate from the previously reported issues (#384, #385, #395, #402).


Bug 1: Contradictory log output in aging command

When running uteke aging status --verbose --namespace hermes, the log output contains contradictory statements — it detects the server, then immediately claims no server was detected:

INFO  uteke: Server detected at http://127.0.0.1:8767, routing via HTTP
DEBUG uteke: No server detected, using local store

The server is clearly running (curl http://127.0.0.1:8767/stats responds), but the aging subcommand falls back to local store despite detecting the server. This suggests a race condition or logic bug in the server detection → routing flow.

Steps to Reproduce

  1. Start uteke-serve on port 8767
  2. Run uteke aging status --namespace hermes --verbose
  3. Observe contradictory log lines

Environment

  • uteke: 0.2.0
  • uteke-serve: running on port 8767
  • Platform: macOS 26.5 (Apple Silicon)

Bug 2: stats reports global DB size but namespace-scoped memory count

uteke stats --json --namespace hermes reports:

{"total_memories": 10, "db_size_bytes": 1789952, ...}

The total_memories is namespace-scoped (only 10 for hermes), but db_size_bytes (1.7 MB) is the global database size across ALL namespaces (80 memories, 14 namespaces).

This is misleading — it makes a 10-memory namespace appear to use 1.7 MB (178 KB per memory), when the actual per-namespace footprint is much smaller.

Steps to Reproduce

  1. Have memories in multiple namespaces
  2. Run uteke stats --namespace hermes --json
  3. Compare total_memories with db_size_bytes — ratio is implausible

Expected Behavior

Either:

  • Report namespace-specific DB size (ideal)
  • Clearly label db_size_bytes as global/shared

Enhancement 1: aging.enabled defaults to false with no auto-cleanup mechanism

In ~/.uteke/uteke.toml, the aging section is commented out:

[aging]
# enabled = false
# max_age_days = 180
# max_cold_count = 10000

Even when enabled, cleanup is manual only (uteke aging cleanup). There is no:

  • Cron-like auto-cleanup daemon
  • Session-based cleanup trigger
  • LaunchAgent / systemd timer integration

Current State

With 14 namespaces and 80 memories accumulated from development/testing, old test namespaces (pi-agent, uteke-dev, ai-automation, retest-srv, cora-cli, audit) have 29 memories that are 20+ days old and no longer relevant — but they persist indefinitely.

Suggested Improvements

  1. Default aging.enabled = true — or at least prompt the user during uteke init
  2. Per-namespace aging config — e.g., pi-agent namespace could have shorter TTL than hermes
  3. uteke init or uteke doctor suggests cleanup when stale namespaces detected
  4. Document the aging lifecycle — users need to know memories don't auto-clean

Database Snapshot

Namespace       | Count | Oldest             | Newest             | Status
----------------|-------|--------------------|--------------------|--------
default         |     3 | 2026-05-29         | 2026-06-13         | ⚠️ 38 days old
pi-agent        |     7 | 2026-05-29         | 2026-05-30         | ❌ 21 days, dev/test
uteke-dev       |     6 | 2026-05-30         | 2026-05-30         | ❌ 21 days, dev/test
ai-automation   |     2 | 2026-05-30         | 2026-05-30         | ❌ 21 days, dev/test
retest-srv      |     1 | 2026-05-31         | 2026-05-31         | ❌ 20 days, dev/test
cora-cli        |     8 | 2026-06-07         | 2026-06-07         | ⚠️ 13 days, dev/test
uteke           |     3 | 2026-06-07         | 2026-06-07         | ⚠️ 13 days, dev/test
usago           |     6 | 2026-06-07         | 2026-06-07         | ⚠️ 13 days, dev/test
audit           |     2 | 2026-06-07         | 2026-06-07         | ⚠️ 13 days, dev/test
trapfall        |     4 | 2026-06-07         | 2026-06-07         | ⚠️ 13 days, dev/test
usago-mobile    |     9 | 2026-06-07         | 2026-06-13         | ⚠️ 7-13 days
cora            |     5 | 2026-06-09         | 2026-06-14         | ✅ 6-11 days
dev-process     |    14 | 2026-06-13         | 2026-06-14         | ✅ 6 days
hermes          |    10 | 2026-06-18         | 2026-06-20         | ✅ 0-2 days (active)

29 memories across 6 namespaces are 13+ days old and appear to be development/testing artifacts.


Environment

  • uteke: 0.2.0 (Rust binary, M1 arm64)
  • uteke-serve: running on port 8767 (LaunchAgent)
  • Hermes Agent: v0.16.0 (2026.6.5)
  • Platform: macOS 26.5 (Apple Silicon)
  • Python: 3.11.15
  • MCP SDK: 1.26.0
  • DB: SQLite at ~/.uteke/uteke.db, 80 memories, 14 namespaces, 1.7 MB
  • Embedding model: embeddinggemma-q4

Related Issues

Activity

  1. added
    bug
    enhancement
    scope:cli
    on Jun 20, 2026
  2. ajianaz commented on Jun 21, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in #414. Server detection log no longer contradicts itself, and db_size_bytes is now labeled '(global, shared)' in stats output.

    Aging defaults enhancement deferred to #404 (configurable limits) in v0.3.0 scope.

  3. added 4 commits that reference this issue on Jun 21, 2026
  4. added 2 commits that reference this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenhancementpriority:mediumscope:cli

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions