On Windows six Aside tests failed: a directory's mode is ignored there,
so chmod 0500 on the record's folder refused nothing; os.Stat reports the
0600 record as 0666; and os.Symlink needs a right a test isn't given.
RaykieLee's 448967806 made the file itself read-only instead, on every
OS. That passes on Windows but turns four of the tests red on macOS and
Linux: edit.WriteAtomic renames a temporary file over the record, and a
rename over a 0400 file in a writable folder succeeds there, so nothing
is refused (TestAsidePostReadFailuresNeverOfferOffline/save_record,
TestAsideOfflineWriteFailureRollsBack,
TestAsideDisconnectUnavailableOnlyAtInitialRead/record,
TestAsideOfflineProviderWriteFailureRollsBackAllFiles; red at the
branch's own tip too). This keeps its Windows half and the folder elsewhere:
refuseWrites makes the folder unwritable on macOS and Linux, and the file
read-only on Windows, where neither a write nor a rename replaces it.
recordPerm wants 0666 on Windows. The provider-file test links its target
with a symlink, or a hard link on Windows, and refuses the target the same
way.
Run: go test ./internal/agent on macOS green; with refuseWrites a no-op
all four go red.
Windows box (Windows 11 x64, amd64 test binary of the whole package,
sandbox HOME/USERPROFILE/APPDATA/LOCALAPPDATA/TEMP): main plus the
series' base fails 21 tests; with the whole series only
TestInstallWithoutNodeParses (bash there is WSL's, whose default distro
has no /bin/bash) and the two TestReasonixCLI* (no Go on the box) fail,
both environmental and listed as untested by RaykieLee too. The six Aside tests are
among the 21 and pass.
Co-authored-by: RaykieLee <42793273+RaykieLee@users.noreply.github.com>
Aside keeps one folder per account (~/.aside/u/<id>, each with its own
settings.json, models.json, credentials.json and state.db), and which one is
in use is currentAccountId in ~/.aside/accounts.json, which the app and
`aside account use <id>` both set. magpie only ever wrote u/0 and asked the
runtime about --account u0, so with u1 active Connect changed an account
the reporter wasn't using.
- magpie now follows currentAccountId. An accounts.json that is missing,
doesn't parse, names no active account, or names one with no folder is
"unknown" and keeps u0, as before; it is never written.
- The Aside row gets an account field (under Details, shown only with more
than one account) listing each account with its e-mail or "Local
Account" and which one is active in Aside; `magpie aside account u1` does
the same from the CLI. The pick is kept in magpie's own
aside-account.json; Default removes it and follows Aside again. A pick
whose folder is gone is passed over.
- What magpie remembers to put back on Disconnect is per account
(aside-state.json for u0, as before, aside-state-uN.json for others), so
switching accounts never restores one account's model into another. The
legacy stash still migrates into u0's only.
- All runtime reads and writes go to `aside repl --account uN` for the
account in use.
- GUI strings in en, zh, zh-TW, ja, de.
Run: go test -tags nogui ./... in a sandbox HOME; new
aside_account_test.go uses the reporter's accounts.json bytes
(TestAsideFollowsTheActiveAccount, TestAsideUnreadableAccountsKeepU0,
TestAsidePickedAccountOverridesActive, TestAsideRestorePointsArePerAccount,
TestAsideKeepsModelsPermissions); with asideChoice forced to 0 the follow,
pick and restore tests fail, and with one shared record the restore test
fails. GUI: aside-account.test.cjs (chromium and webkit, 980 and 360px,
en/zh/zh-TW/ja/de) plus aside-native, i18n-keys, agent-field-names,
agent-layout and agent-models-picker, 45 passing. gofmt -l; GOOS=linux and
GOOS=windows go vet -tags nogui ./internal/agent ./internal/gui.
* refactor(agent): connect Aside as a native provider with verified settings
* fix(agent): offer explicit offline Aside model and disconnect actions
Offer Save for next start after an initial runtime read failure, using a
structured API error instead of saved runtime state. Keep refusals and
failed readbacks on the live error path.
Add a separate offline disconnect confirmation that restores the checked
file plan, clears restore records and removes the provider last. Bind the
confirmation to its preview revision and roll back ordinary write failures.
Cover offline API and browser flows, cancellation, stale plans, missing
CLI, restore metadata and native provider spelling. Keep state file-only.