Skip to content

feat(sessions): import Qoder IDE session history#397

Merged
sudomaggie merged 1 commit into
developfrom
feat/qoder-history-import
Jul 16, 2026
Merged

feat(sessions): import Qoder IDE session history#397
sudomaggie merged 1 commit into
developfrom
feat/qoder-history-import

Conversation

@Harry19081

Copy link
Copy Markdown
Member

Summary

Adds Qoder (Alibaba's agentic IDE) as an external-history source, reusing the existing imported-history pipeline end to end (discovery cache, sidebar/kanban aggregation, replay, recent paths, data-sources panel).

Store format (discovered empirically)

  • Transcript: ~/.qoder/cache/projects/<proj>/conversation-history/<task>/<task>.jsonl — one {role, message:{content:[…]}} line per message with Anthropic-style blocks, text-only (no timestamps, no tool calls). Task dir names are truncated task-id prefixes unique only per project, so the source session id is the composite <projectDir>/<taskDir> (prefix qoderapp-).
  • Metadata: aicoding.questTaskListSnapshot key in Qoder's global state.vscdb (title, timestamps, workspace path), matched by id-prefix + workspace basename; enrichment only — discovery works from the JSONL alone and degrades gracefully when the running app holds the db.

Trajectory recovery (best-effort)

Tool calls stream over ACP and are not persisted to the transcript, so the reader correlates three surviving stores at load time:

  • questWindow/agent.log + exthost logs: subagent registrations (type + prompt), locally-dispatched tool invocations with args (read_file, terminal commands with cwd), and FileChangeTracking edit events (which carry the session id directly)
  • attribution is content-first (args paths inside the session's workspace or project cache dir), falling back to the activity window only when unambiguous; payload-less events are never emitted
  • agent-tools/ spill files (oversized tool outputs) attach as read_file outputs
  • chatEditingSessions/<session>/ snapshot store provides real before/after file bodies → edit_file_by_replace cards with actual diffs, and per-session impact stats (files changed, +/- via line diff, touched files) at sync time; the store mtime is folded into the discovery fingerprint so post-sync edits re-parse (parser v2)
  • canonical mappings: run_in_terminalrun_command_line, get_problemsquery_lsp, edit ops → edit_file_by_replace

Logs rotate per app launch, so older sessions fall back to the text-only transcript automatically.

Also included

  • Turn-collapse duration label shows <1min instead of a broken-looking 0s for imported transcripts that carry no timestamps.

Testing

  • 20 new unit tests in orgtrack_core (transcript parsing, snapshot matching, composite-id discovery, log parsing/attribution with overlapping session windows, spill/output attachment, edit-store resolution, diff-based impact); full crate suite passes (264)
  • Verified live against 4 real Qoder sessions on disk: titles/timestamps/workspaces from the vscdb snapshot, full trajectory replay (subagent + shell commands + reads with doc-fetch bodies + create-file diff + LSP probe), and sidebar impact (1 file, +35 −0) for the file-creating session

Note

CI may currently be red on develop itself: imported_history_stat is registered in handler_list.inc and called from stat.ts, but the Rust command function isn't committed yet (it exists in a local working tree). This PR neither touches nor depends on that command.

Add Qoder (Alibaba's agentic IDE) as an external-history source using the
existing imported-history pipeline:

- reader discovers per-project transcripts at
  ~/.qoder/cache/projects/<proj>/conversation-history/<task>/<task>.jsonl
  (Anthropic-style content blocks, text-only), keyed by the composite
  <projectDir>/<taskDir> id since task dir names are truncated prefixes
  unique only per project
- session metadata (title, timestamps, workspace) joined from the
  aicoding.questTaskListSnapshot key in Qoder's global state.vscdb,
  degrading gracefully when the app holds the db
- best-effort trajectory recovery from per-launch logs: ACP tool_call
  events, SubAgentService registrations, ToolInvokeHandler/exthost
  invocations (terminal commands with cwd), FileChangeTracking edit
  events; attribution is content-first (workspace/cache paths) with an
  unambiguous-window fallback, and agent-tools spill files attach as
  read_file outputs
- real edit diffs and per-session impact stats (files changed, +/- via
  line diff, touched files) from the chatEditingSessions snapshot store;
  store mtime folded into the discovery fingerprint (parser v2)
- canonical mappings: run_in_terminal -> run_command_line, get_problems
  -> query_lsp, FileChangeTracking ops -> edit_file_by_replace
- frontend registration: source descriptor, replay adapter, recent
  paths, source stats, kanban filter, model icon
- turn duration label reads "<1min" instead of "0s" for imported
  transcripts that carry no timestamps
@sudomaggie
sudomaggie merged commit b00bfbe into develop Jul 16, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants