feat(import): warn when importing agent history while logged out - #1774
Conversation
Importing (via `entire import` or the `entire enable` offer) writes read-only checkpoints to the local entire/checkpoints/v1 store and never syncs on its own — sync happens later via the git pre-push hook, only once logged in. So an import run while logged out succeeds locally but silently never reaches the dashboard, and re-importing after login is a no-op (idempotent on local existence). Surface this: after a logged-out import that wrote local history, print a notice that it's local-only and to log in before importing so it syncs. No-op when logged in or when nothing was imported. Login detection is local-only (ENTIRE_TOKEN or a current stored context) — no network on the import path. The existing "Imported N turn(s)" line is unchanged. This is fix #1 (the UX guard) for #1773; the sync-trigger for already-imported, commit-less checkpoints is tracked separately there. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a UX guard to the import flow so users who import agent history while logged out are explicitly told that the history was imported locally only and will not sync to the Entire dashboard until they log in (addressing the “empty dashboard after import” confusion described in #1773).
Changes:
- Introduces a small “logged-in” detection seam and a post-import sync notice helper.
- Emits the notice after
entire import(non-dry-run) and after theentire enableimport offer flow, but only when something was actually imported/skipped locally and the user is not logged in. - Adds unit test coverage for the notice behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/entire/cli/setup_import.go | Tracks whether any local history was imported/skipped during enable-time imports and emits the “not synced” notice once after the batch. |
| cmd/entire/cli/import_sync_notice.go | New helper to detect local login state and print a sync notice when importing while logged out. |
| cmd/entire/cli/import_sync_notice_test.go | Unit tests for notice emission logic (logged out + imported warns; logged in / nothing imported does not). |
| cmd/entire/cli/import_cmd.go | Emits the “not synced” notice after a real (non-dry-run) import when local history was imported/skipped and user is not logged in. |
…n check Addresses Copilot's review on #1774: a contexts.json entry can exist without a usable credential (partially-removed context, missing keychain token), which made importLoggedIn suppress the sync notice even though the import can't sync. Now the current context must also yield a stored token (local read via auth.LoginTokenForContext — no network). This stays a presence check, not a liveness check: LoginTokenForContext returns a present-but-expired token without error, and verifying usability needs a network refresh we deliberately avoid on the import path. That narrow residual false-negative (expired token) is accepted to keep the check local and prompt-free; the common broken case is now handled. Adds a test for the context-present-but-token-missing case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
72ce3f9 to
d76186d
Compare
|
@gtrrz-victor I reset this branch back to The three "Potential fix for pull request finding" commits from the Copilot review were going in circles, so I dropped them (after going on a journey of discovery with them) . The import files (import_cmd.go, import_sync_notice.go, setup_import.go) are now byte-identical to what you already reviewed; the only new content is the main merge to keep the branch current. Mind re-approving when you get a chance? (Force-push likely dismissed the prior approval, but the content is unchanged from your review. |
https://entire.io/gh/entireio/cli/trails/873
Summary
Part of #1773 — this is fix 1 (the UX guard). The sync-trigger for already-imported, commit-less checkpoints is the larger design item and stays tracked on that issue, so this PR does not close it.
Importing agent history (via
entire importor theentire enableoffer) writes read-only checkpoints to the localentire/checkpoints/v1store and never syncs on its own — sync happens later via the git pre-push hook, only once logged in. So an import run while logged out succeeds locally but silently never reaches the dashboard, and re-importing after login is a no-op (idempotent on local existence). Users hit an empty dashboard with no explanation.Change
After a logged-out import that wrote local history, print a notice that it's local-only and to log in before importing so it syncs:
ENTIRE_TOKENor a current stored context viaauth.Contexts(); no network call on the import path.Imported N turn(s)line is unchanged (so integration tests and Vogon prompt parsing are unaffected).Files
cmd/entire/cli/import_sync_notice.go— new:importLoggedInseam +warnIfImportNotSynced.cmd/entire/cli/import_cmd.go,cmd/entire/cli/setup_import.go— call the notice after import.cmd/entire/cli/import_sync_notice_test.go— unit test (logged-out+imported warns; logged-in / nothing-imported don't).Verification
mise run fmtclean,mise run lint→ 0 issuesgo test ./cmd/entire/cli/(unit) ✓go test -tags integration ./cmd/entire/cli/integration_test/ -run 'Import|Enable'✓🤖 Generated with Claude Code