Skip to content

external sessions: an imported task does not record where it came from #3081

Description

@Astro-Han

Importing an external conversation is a one-shot conversion (packages/storage/src/external-sessions.ts). createImportedSession takes a CreateSessionInput plus messages; nothing on the resulting Session records the adapterId + sourceSessionId it came from. (session.ts's sourceSessionId is revision lineage, a different thing.)

So the import page cannot know what it has already done. That single gap shows up as four separate-looking problems:

Shape of a fix

Persist the external origin on the imported session, and let the Host answer "what is the import state of this external session" (never imported / imported N times, with ids / import in flight). Then:

  • each row has a real three-state, and the duplicate consequence becomes a per-row fact
  • an unconfirmed import stays locked across remounts, and the banner can offer the task instead of asking the user to search
  • the in-flight label survives remount, and survives a second window or the CLI, which page-level state never could
  • a count alongside the cursor makes "还剩 12 个" possible

Scope

Touches storage schema, the external-session protocol, HostExternalSessionCoordinator and the Desktop page. Per AGENTS.md this is a public contract change: it needs independent human review and cannot take the self-merge fast path. Worth deciding whether the import page justifies it before anyone starts.

Refs #2984, #3033, #3075

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions