Skip to content

Finish init when the memory model cannot be downloaded - #6

Merged
Ukaykhingmarma28 merged 2 commits into
mainfrom
fix/fresh-install-without-model
Nov 22, 2026
Merged

Ukaykhingmarma28 merged 2 commits into
mainfrom
fix/fresh-install-without-model

Conversation

@Ukaykhingmarma28

Copy link
Copy Markdown
Collaborator

Summary

On a fresh install, a failed model download during atlas-cli init aborted setup before any agent was hooked. The model is now optional everywhere: without it, search stays on keywords.

 finishInit (guided)
   pickAgents, pickSync
   "Download the memory search model?"  (Download preselected)
     indexMemory(download)
-      download fails → return error      # init ends here: bound, nothing hooked
+      download fails → index on keywords, say why
+    any other failure → note, spawnIndex
+  "Not now" → spawnIndex                 # keyword index from the start
   installAgents, setBackgroundSync
   "Atlas is ready"

Also in this PR:

  • atlas-cli memory index exits 0 when the download fails, with the index built on keywords and the reason in its message. A cancelled download still stops with an error.
  • The hook's "atlas-cli is not installed" message links to tryatlas/cli#install (was tryatlas/atlas-cli).
  • /dev/null is no longer taken for a terminal, so a command with a progress bar works when stdin and stdout are both /dev/null (cron, CI, a service).

Evidence

Fresh Ubuntu 24.04 container, new user, empty home, --network none; the wizard driven through a pty with Download chosen.

  • Before (v0.6.0):

    ├ Downloading the memory search model (87 MB, shared with the Atlas app)
    ✗ Setting up memory search download the model: Get "https://huggingface.co/sente…
    exit 1 · atlas-cli agents list: claude-code  absent  absent · no .mcp.json
    

    After:

    ├ Downloading the memory search model (87 MB, shared with the Atlas app)
    ├ The model could not be downloaded; indexing on keywords
    ✓ Memory index ready: 0 documents …
    ✓ Atlas is ready in /home/dev/w1
    exit 0 · claude-code  installed  installed · .mcp.json and corpus.sqlite written
    
  • Before (v0.6.0): atlas-cli memory index </dev/null >/dev/null → bubbletea: could not create cancelable reader: add reader to epoll interest list, exit 1.
    After: exit 0.

  • End-to-end checklist in that container (wizard with Download and with Not now, non-interactive init, memory index, the four Claude Code hook events, the memory server's remember, search and briefing): v0.6.0 failed 10 of 19 offline; this branch passes 20 of 20 offline and 7 of 7 with network (model downloaded, search by meaning finds a memory sharing no words with the query).

  • New tests: TestIndexFallsBackToKeywordsWhenTheDownloadFails (download answered with 502 → exit 0, keywords, no model left behind) and TestDevNullIsNotATerminal.

  • gofmt, go vet, go test ./... and go test -race ./... pass (34 packages); the four release targets cross-compile. macOS was compiled, not run.

Merge Danger

Door: two-way

No stored data or schema changes; reverting restores the old behaviour.

Blast Radius: small

  • atlas-cli memory index now exits 0 when the model download fails. A script that used the exit code to detect a missing model must read the message or atlas-cli status instead.
  • Hooks installed before this (Claude Code, Codex) report "outdated" until atlas-cli agents add rewrites them, because the install link is part of the hook command.
  • In the wizard the final "Memory index ready…" line is cut at the terminal width, so the download error itself is not visible there; the step line above it says the download failed.
  • Settings ▸ Download model is unchanged: there a failed download is still an error.

🤖 Generated with Claude Code

Ukaykhingmarma28 and others added 2 commits November 23, 2026 02:36
On a fresh install the guided init offers the memory search model with
Download preselected. When the download failed (offline, a proxy, Hugging
Face out of reach) init returned the error before it hooked any agent or
set background sync: the folder was bound, nothing was captured, and a
second init asked "Bind it again?" with No as the default.

The model is an improvement, not a requirement. indexMemory now keeps
going on keywords when the download fails and says why in its result, so
atlas-cli memory index exits 0 offline with the index built; a cancelled
download still stops. Init treats a failed memory search step as a note
and goes on to the agents and sync. It also starts the background index
when the model is absent (Not now, or a failed download), so the keyword
index of the project's documents exists from the start instead of after
the first session.

The hook's "atlas-cli is not installed" message pointed at
tryatlas/atlas-cli; it now names tryatlas/cli. Hooks installed before
this report "outdated" until atlas-cli agents add rewrites them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Interactive() called any character device a terminal, and /dev/null is
one. With it as both stdin and stdout (cron, CI, a service) a command
with a progress bar started bubbletea and failed: "could not create
cancelable reader: add reader to epoll interest list". atlas-cli memory
index was the visible case.

isTerminal now asks the device (charmbracelet/x/term, already a
dependency), so /dev/null and pipes take the plain path.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Ukaykhingmarma28
Ukaykhingmarma28 merged commit 7fc6eaf into main Nov 22, 2026
5 checks passed
@Ukaykhingmarma28
Ukaykhingmarma28 deleted the fix/fresh-install-without-model branch November 22, 2026 20:41
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