fix: improve lore import UX — stdout logging, prompt ordering, only-ask-once#278
Merged
Conversation
…sk-once - Switch informational messages from console.error to console.log in import.ts and import-auto.ts so they don't appear red in terminals. Keep progress indicators on stderr (standard practice). - Move maybeAutoImport() before resolveLaunchTarget() in run.ts so the import prompt appears before the agent selection picker. - Replace isFreshProject()/wasDeclined()/recordDeclined() sentinel row hack with a last_import_at timestamp on the projects table (V22 migration). Set unconditionally after the prompt fires, regardless of the user's answer, preventing re-prompting on subsequent runs even if the background import hasn't finished yet. - Remove dead code: recordDeclined, wasDeclined, DECLINED_SOURCE_ID, isFreshProject. listImports() still filters legacy __declined__ rows for backwards compat.
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
lore importusedconsole.error()for all messages, making everything appear red. Switched informational messages toconsole.log(stdout). Progress indicators stay on stderr (standard practice for\r-based updates).lore runnow offers to import existing conversations before asking which agent to launch (movedmaybeAutoImport()beforeresolveLaunchTarget()inrun.ts).wasDeclined()/recordDeclined()sentinel row hack with alast_import_attimestamp on theprojectstable (V22 migration). Set unconditionally after the prompt fires regardless of the user's answer, so re-runninglorenever re-prompts — even if the background import hasn't finished or failed silently.Changes
packages/core/src/db.tsALTER TABLE projects ADD COLUMN last_import_at INTEGER. New helpers:getLastImportAt(),setLastImportAt().packages/core/src/import/history.tsrecordDeclined(),wasDeclined(),DECLINED_SOURCE_ID.listImports()still filters legacy__declined__rows for backwards compat.packages/core/src/import/index.tsrecordDeclined/wasDeclined, addedlistImports).packages/core/src/index.tsgetLastImportAt/setLastImportAtto barrel exports.packages/gateway/src/cli/import.tsconsole.error→console.logfor informational messages. Removed unusedrecordDeclinedimport.packages/gateway/src/cli/import-auto.tsconsole.error→console.log. ReplacedisFreshProject()+wasDeclined()guards withgetLastImportAt() !== null. CallssetLastImportAt()unconditionally after prompt. RemovedisFreshProject().packages/gateway/src/cli/run.tsmaybeAutoImport(config)beforeresolveLaunchTarget(). Renumbered step comments.packages/core/test/db.test.tslast_import_atcolumn,getLastImportAt/setLastImportAtround-trip.packages/core/test/import/history.test.tsdeclinedtest block. UpdatedlistImportstest.