Repository navigation
Finish init when the memory model cannot be downloaded - #6
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a fresh install, a failed model download during
atlas-cli initaborted 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 indexexits 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.tryatlas/cli#install(wastryatlas/atlas-cli)./dev/nullis 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):
After:
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) andTestDevNullIsNotATerminal.gofmt,
go vet,go test ./...andgo 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 indexnow exits 0 when the model download fails. A script that used the exit code to detect a missing model must read the message oratlas-cli statusinstead.atlas-cli agents addrewrites them, because the install link is part of the hook command.🤖 Generated with Claude Code