Repository navigation
feat: portable Aiden config under ~/.aiden - #3
Conversation
DataStore now roots in a caller-chosen directory (defaulting to userData) so the portable config file can live under ~/.aiden. Three behaviors follow: - reload() re-reads the file from disk and reports whether contents changed, gated by a content compare rather than mtime/size so two same-size hand-edits cannot be silently dropped. - Writes are atomic: stage a sibling temp, then rename over the target, so a mid-write crash or full disk cannot truncate a hand-maintained file. - An unparseable file is parked beside itself (.invalid-<stamp>) before a write replaces it when preserveCorruptFile is set, so a JSON typo costs the user a restart rather than their config. Resilience tests cover the corrupt-file, atomic-write, and reload paths.
Introduce aiden-config-dir.ts to resolve the portable user config root `~/.aiden` (overridable via $AIDEN_CONFIG_DIR, which must be absolute). Point skills-discovery and schedule-script at this resolver so redirecting the config directory moves global skill and script roots along with it. An explicitly injected home directory still wins, keeping tests hermetic.
Split config storage into a portable half under ~/.aiden/config.json (provider intent, aliases, MCP servers, skills — the user's to hand-edit) and a machine-local half in userData (settings, workspaces, model cache). Secrets stay safeStorage-bound in the local root, so a portable file carried to a second machine lists providers with hasKey: false until keys are re-entered. - config-store.ts is renamed to config-store-core.ts (platform-independent) with a thin config-store.ts shim binding it to the portable stores. - portable-config-core.ts owns the split and the one-time migration; both roots are injected so the migration is exercisable against temp dirs. - portable-config.ts is the Electron runtime binding. - Register the new suites in package.json (test, test:coverage) and add a focused test:portable-config script.
Wire a coalescing watcher that re-reads ~/.aiden/config.json on window focus and powerMonitor resume. The common path (no change) never reaches the renderer: reload() compares contents and only a real change raises app:config-externally-changed, which the renderer turns into invalidated provider, MCP server, and skill query caches. Concurrent triggers coalesce into one re-read. Renderer edits (formatting only in root-view.tsx).
There was a problem hiding this comment.
Reviewed changes — this PR splits Aiden's configuration into a portable ~/.aiden/config.json (provider intent, aliases, MCP servers, skills) and machine-local stores (UI settings, workspaces, model cache), with DataStore hardenings and live reload on window focus/wake.
- Harden
DataStore— caller-chosen root, atomic rename-based writes,reload()with content-comparison gating (not stat),preserveCorruptFileoption to rescue unparseable files as.invalid-<stamp>copies. aidenConfigDir()— resolves~/.aiden(overridable via$AIDEN_CONFIG_DIR), rejects relative overrides.- Portable config split + one-time migration in
portable-config-core.ts— splits provider intent from regenerable cache, archives the pre-splitconfig.json, and seeds the four new files. config-store-core.ts— platform-independent routing layer that callsmigratePiProviderConfigon a correctly-ordered composite draft carrying realmodels/modelMetadata.- Live reload on focus/wake —
portable-config-watch-core.tscoalesces concurrent triggers; only a content change reaches the renderer viaapp:config-externally-changed. skills-discovery.tsandschedule-script.tsnow resolve~/.aidenroots throughaidenConfigDir(), moving skill/script discovery with redirected config directories.root-view.tsxinvalidatesproviders,mcpServers, andskillsquery caches on external changes.- New test suites registered in
package.json(test,test:coverage) plus a focusedtest:portable-configscript:aiden-config-dir,config-store-core,portable-config-core+ roundtrip,portable-config-watch-core, anddata-store.resilience.
✅ No new issues found.
This is a thorough, well-tested change. Migration ordering is correct (the split runs before Pi seeding, and the composite draft carries real models/metadata so isUntouchedPiPreset sees the right data), corrupt-file preservation is gated on preserveCorruptFile and only fires once, concurrent refreshes coalesce, the migration is idempotent across processes, and the crash-interruption recovery paths converge. All external callers of discoverSkills, resolveScheduledScript, and listScheduledScripts remain backward compatible. No concerns.
DeepSeek Pro | 𝕏
…e condition, and text-only reply recognition This commit addresses three findings from code review: 1. [chat-pane #1] Observed phone-started turns are no longer suppressed when the chat's cached messages end in an assistant message from a different run. The suppression now checks if the last cached assistant message matches the observed run's generation ID, allowing new observed turns to display even in existing chats. 2. [observed-local-run #2] Fixed a race condition where an obsolete idle-release grace-period read could close a retained observer. After the async read completes, we now recheck the release authority flag before closing, so a retained observation survives if it was claimed by a newer turn. 3. [observed-local-run #3] Text-only replies without timeline fields are now recognized as the current run's saved reply by matching the doneMessageId from the persisted message. The hasReplyFrom predicate now checks both timeline.generationId (for multi-step replies) and doneMessageId (for text-only replies). All observer lifecycle and chat visibility tests pass, including two new tests covering the release race condition and text-only reply handoff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary
Splits Aiden's persisted configuration into a portable half the user can hand-edit under
~/.aiden/config.jsonand a machine-local half that stays in Electron'suserData, then picks up external edits live without a restart.~/.aiden/config.json(portable): provider intent + aliases, MCP servers, skills — the user's to edit by hand.userData(local): UI settings, workspaces, regenerable model cache.provider-keys.json,pi-provider-credentials.json,mcp-oauth.json) staysafeStorage-bound in the local root, so a portable file carried to a second machine lists providers withhasKey: falseuntil keys are re-entered there. (Intended, not a defect.)Why
~/.aidenwas already being read byskills-discoveryandschedule-script, but the provider/MCP/skill config itself was trapped inuserData— not portable, not editable, and silently overwritten on restart. This makes the portable directory the single source of truth for what a human maintains, and treats machine-local state as machine-local.What changed
DataStorehardening (main/services/data-store.ts)userData), so the portable file can live under~/.aiden.reload()re-reads from disk and reports whether contents changed — gated by a content compare, not mtime/size, so two same-size hand-edits can't be silently dropped..invalid-<stamp>whenpreserveCorruptFileis set — a JSON typo costs a restart, not the config.Config split (new)
aiden-config-dir.ts— resolves~/.aiden(overridable via$AIDEN_CONFIG_DIR, which must be absolute; a relative override is rejected rather than resolved against an unpredictable packaged-app cwd).portable-config-core.ts— the platform-independent split + one-time migration. Both roots are injected so the migration is exercisable against temp dirs.config-store.ts→ renamed toconfig-store-core.ts(platform-independent); a thinconfig-store.tsshim binds it to the portable stores.skills-discovery.ts,schedule-script.tsnow resolve roots viaaidenConfigDir(), so redirecting the config dir moves skill/script discovery along with it. Explicitly injected homes still win → tests stay hermetic.Live reload of external edits
portable-config-watch-core.tscoalesces a "re-read~/.aiden/config.json" trigger fired on window focus and powerMonitor resume. The common path (no change) never reaches the renderer:reload()compares contents and only a real change raisesapp:config-externally-changed, which the renderer turns into invalidatedproviders,mcpServers, andskillsquery caches. Concurrent triggers coalesce into one re-read.Commits
feat(data-store): harden against corrupt files and support reloadfeat(config-dir): resolve Aiden's portable root via aidenConfigDir()feat(config): split persisted config into portable and local halvesfeat(config): re-read portable config on focus and wakeTests
New suites added and registered in
package.json(test,test:coverage), plus a focusedtest:portable-configscript:aiden-config-dir.test.tsconfig-store-core.test.tsportable-config-core.test.ts+portable-config-core.roundtrip.test.tsportable-config-watch-core.test.tsdata-store.resilience.test.ts(corrupt-file, atomic-write, reload)npm testis green.Notes
main(includes the newpullfrog.ymlworkflow).