fix(daemon): persist machine identity in machine.json#138
Merged
Conversation
Move machine.{id,name} to its own file ~/.agentage/machine.json so
deleting or regenerating config.json doesn't mint a fresh UUID and
create a ghost machine in the hub dashboard.
Resolution order at loadConfig:
1. machine.json if present (authoritative)
2. legacy machine block from config.json → migrated into machine.json
3. freshly minted UUID + hostname (written to machine.json)
saveConfig now writes machine.json alongside config.json; the machine
block stays mirrored in config.json for back-compat reads.
Repro that motivated this: user deletes config.json to adopt the 0.18
shape, daemon re-registers with a new UUID, the old machine sticks
around in Supabase as a ghost.
Contributor
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Ready to merge! ✨ 🔗 View workflow run |
3 tasks
vreshch
added a commit
that referenced
this pull request
Apr 19, 2026
## Summary Two follow-ups to the config-defaults work (PRs #135, #138): **Agents (scanner):** - `src/discovery/scanner.ts` — added `IGNORE_DIRS` set (`node_modules`, `.git`, `.github`, `.github-private`, `.claude`, `dist`, `build`, `.next`, `coverage`, `.turbo`, `.cache`) and skip them in `getAllFiles`. Pointing a discovery dir at a repo with dependencies no longer picks up ghost agents shipped inside packages or checked into build output. **Projects (discovery):** - `src/projects/projects.ts` — `discoverProjects` now accepts `string | string[]`, walks recursively (depth cap 5), stops descending once it finds a `.git` dir (repo boundary), and skips the same ignore set. Old one-level behavior is gone. - `src/commands/projects.ts` — `agentage projects discover` with no path now reads `getProjectsDirs(loadConfig())` instead of defaulting to cwd. Single-root setups in `projects.default` drive the walk. Unblocks: pointing `projects.default` at `~/projects` finds nested repos like `agentage/cli`, `agentage/web`, `agents` automatically. ## Test plan - [x] `npm run verify` — 512 tests pass (5 new: scanner IGNORE_DIRS, projects recursive walk, projects ignore set, array-of-roots dedupe, repo-boundary stop; 2 existing projects cmd tests updated for new signature). - [ ] Manual: `agentage projects discover` (no args) on the dev machine — confirm it walks `projects.default` and finds repos without cwd-dependent behaviour. - [ ] Manual: `agentage status --set-default /home/vreshch/projects/agents/plugins` then `agentage agents --refresh` — confirm no ghost agents from `node_modules`.
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
Split
machine.{id,name}into its own file~/.agentage/machine.jsonso deleting or regeneratingconfig.jsonno longer mints a fresh UUID and creates a ghost machine in the hub dashboard.Resolution order at
loadConfig:machine.jsonif present — authoritativemachineblock fromconfig.json— migrated intomachine.jsonrandomUUID()+hostname()— written tomachine.jsonsaveConfignow writesmachine.jsonalongsideconfig.json. Themachineblock stays mirrored inconfig.jsonfor back-compat reads (dashboards, logs, anything inspecting the raw file).Repro that motivated this
After merging #135, I told the user to delete
config.jsonto regenerate it in the new 0.18 shape. The daemon re-registered with a new UUID, and the old machine (same hostname, old UUID) stuck around in Supabase as a ghost — two "vreshch-home-pc" entries in the dashboard.Test plan
npm run verify— 507 tests pass (4 new, covering: first run creates machine.json; identity survivesconfig.jsondeletion; legacy migration from oldconfig.jsonblock;machine.jsonauthoritative when both exist;saveConfigwrites both)config.json, runagentage status, confirmmachine.idis unchanged