Skip to content

Startup UX: lifecycle flag + warming-aware skill/doctor#25

Merged
nickroci merged 3 commits into
mainfrom
fix/startup-ux
Jun 10, 2026
Merged

Startup UX: lifecycle flag + warming-aware skill/doctor#25
nickroci merged 3 commits into
mainfrom
fix/startup-ux

Conversation

@nickroci

Copy link
Copy Markdown
Owner

First start (cold install + model load) read as "broken" — the search skill hard-failed on the missing socket with stale from-source advice. This adds a daemon lifecycle flag (~/.agent-mem/daemon.state: warming → ready, pid-guarded cleanup), warming/installing-aware triage in the ultan-search skill pointing at ultan doctor, and a phase line in doctor itself.

🤖 Generated with Claude Code

nickroci and others added 3 commits June 10, 2026 16:55
…ng, not broken

First start can spend minutes installing + loading models; anything touching
the missing socket claimed the system was broken with stale from-source
advice. Now:

- The daemon publishes ~/.agent-mem/daemon.state ({phase, pid, since}):
  "warming" right after PID acquisition, "ready" once the priming socket is
  serving, removed on shutdown (pid-guarded so a rejected duplicate can't
  erase the live daemon's flag).
- The ultan-search skill triages a missing/unanswering socket instead of
  failing hard: state flag w/ live pid or fresh spawn stamp → "starting up,
  retry shortly, run `ultan doctor`"; install lock/pid in the plugin data
  dir → "still installing"; otherwise an honest "down — lazy-starts on the
  next prompt" (from-source advice demoted to a footnote).
- `ultan doctor` prints the phase line (e.g. "daemon phase: warming
  (since …)") when the flag is present and matches the live pid.

Tests: daemon state lifecycle (3), skill triage incl. dead-pid flag (5).
Root 23 / daemon 657 green, thin-CI-env simulation green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The fallback already worked during warmup — silently. Now every consumer
phrases it honestly via the new _daemon.status() ('ready'/'warming'/'down',
one socket probe + the lifecycle flag + spawn-stamp breadcrumbs):

- Hook priming appends "*daemon still warming — lexical-fallback results;
  ranked recall returns within a minute or two*" to the bullets.
- MCP ultan_recall prefixes the same note (a warming "no match" may just
  mean the ranked index isn't serving yet).
- A stale state flag with a dead pid never claims warming.

Tests: 5 status-classification cases (incl. a real AF_UNIX listener for
'ready') + note-present/note-absent on the hook path. 30 root tests green
in both the full dev venv and the simulated thin CI env.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Relocate the Quick start block to sit right after "Why this exists" so
readers hit install steps before the design/architecture detail. Pure
move, no content changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nickroci nickroci merged commit c6a0bae into main Jun 10, 2026
6 checks passed
@nickroci nickroci deleted the fix/startup-ux branch June 10, 2026 16:38
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