Skip to content

Support Copilot CLI multi-storage recall and provider-based fallback#5

Open
jshessen wants to merge 2 commits intodezgit2025:mainfrom
jshessen:bug/issue-3-multistorage-recall
Open

Support Copilot CLI multi-storage recall and provider-based fallback#5
jshessen wants to merge 2 commits intodezgit2025:mainfrom
jshessen:bug/issue-3-multistorage-recall

Conversation

@jshessen
Copy link
Copy Markdown

@jshessen jshessen commented Apr 22, 2026

Summary

This PR resolves Copilot CLI 1.0.34+ storage compatibility by introducing provider-based multi-storage recall instead of assuming a single SQLite layout.

Closes #3

Storage model coverage by provider

Provider Storage location(s) Storage format Commands supported
cli (Copilot CLI) ~/.copilot/session-store.db SQLite (legacy/current where present) list, search, show, files, checkpoints, health, schema-check
cli fallback ~/.copilot/session-state/*/events.jsonl JSONL events list, search, show (schema-check reports compatibility mode)
vscode ~/.config/Code/User/workspaceStorage/**/chatSessions/*.jsonl (+ flatpak/snap variants) JSONL logs list, search, show, files
jetbrains ~/.config/github-copilot/chat-sessions/* + related chat files file-backed JSON/session logs list, search, show, files
neovim ~/.config/github-copilot/** and ~/.local/share/nvim/** chat JSON/JSONL file-backed JSON/JSONL list, search, show, files

Environment overrides supported

  • SESSION_RECALL_DB
  • SESSION_RECALL_CLI_STATE_ROOT
  • SESSION_RECALL_VSCODE_STORAGE
  • SESSION_RECALL_JETBRAINS_ROOT
  • SESSION_RECALL_NEOVIM_ROOT

Runtime behavior and fallback semantics

Provider discovery

At runtime, providers are discovered and filtered to those actually available on the machine:

  • CLI provider is available if either SQLite DB exists or session-state event files exist.
  • File-backed providers are available when their roots exist.

Command behavior in multi-storage mode

  • list, search, show, files, checkpoints now route through active providers.
  • schema-check is provider-aware:
    • Performs strict schema checks when CLI SQLite is present.
    • Returns compatibility detail (session-state-or-sqlite) when fallback event storage is active.
  • health is provider-aware:
    • Runs SQLite health dimensions when SQLite is available.
    • Falls back to provider compatibility dimensions when SQLite is not available.

UX and recall quality improvements

  • Added session-recall repos to summarize discovered repositories/workspaces across providers.
  • Improved repository attribution for CLI session-state parsing.
  • Improved list/repos alignment and sparse-scope behavior so recall output better matches discovered session reality.

What changed

  • Added provider architecture:
    • src/session_recall/providers/ (base.py, discovery.py, copilot_cli.py, file_backends.py, common.py)
  • Added repo discovery command:
    • src/session_recall/commands/repos.py
  • Updated command paths for provider fallback and multi-storage context:
    • list, search, show, files, checkpoints, health, schema-check
  • Improved repo detection/output formatting:
    • src/session_recall/util/detect_repo.py
    • src/session_recall/util/format_output.py
  • Added/updated tests:
    • test_provider_backends.py
    • test_health_schema_multistorage.py
    • test_repo_scope_fallback.py
    • test_repos_command.py
    • updates in test_list_sessions.py

How this differs from PR #4

PR #4 primarily introduces a DB-layer adapter approach (db/jsonl_store.py + connect/schema integration).

This PR addresses the same issue via provider routing and command-layer fallback, including:

  • dynamic provider discovery,
  • explicit session-state support for CLI,
  • cross-surface file-backed providers (VS Code / JetBrains / Neovim),
  • and provider-aware health/schema semantics.

Both aim at Issue #3 but with different architecture and operational surface area.

Validation

  • pytest src/session_recall/tests/ -q → 105 passed
  • ruff check src/ → all checks passed
  • Focused suite:
    • pytest -q src/session_recall/tests/test_provider_backends.py src/session_recall/tests/test_repo_scope_fallback.py src/session_recall/tests/test_repos_command.py src/session_recall/tests/test_list_sessions.py src/session_recall/tests/test_health_schema_multistorage.py → 18 passed

CONTRIBUTING checklist

  • Tests pass: pytest src/session_recall/tests/ -q
  • Lint passes: ruff check src/
  • No new runtime dependencies added
  • Docs updated for behavior changes (README.md)

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.

[Bug] Support Copilot CLI 1.0.34 session-state DB schema (session-store.db no longer present)

1 participant