Class: Agent::Sessions::Adapters::Copilot
- Defined in:
- lib/agent/sessions/adapters/copilot.rb
Overview
GitHub Copilot CLI. Verified against a real store on this machine (2026-08-24): ~/.copilot/session-store.db, schema_version 3, one session.
This store has MOVED since tokentelemetry's parser was written against
it: that reads ~/.copilot/session-state/verified_on dates exist to make visible.
Constant Summary collapse
- SESSION_COLUMNS =
created_at/updated_at are ISO 8601 strings here, not the epoch milliseconds opencode and Cursor use — verified against a real row ("2026-05-26T04:36:01.288Z").
"id, cwd, created_at, updated_at"
Constants inherited from Base
Constants included from Enumeration
Class Method Summary collapse
Instance Method Summary collapse
- #project_paths ⇒ Object
- #sessions ⇒ Object
-
#sessions_for_project(dir) ⇒ Object
cwd is a real column holding a real absolute path, so filtering is a WHERE clause rather than a read-and-compare loop.
Methods inherited from Base
#base_dir, fidelity_value, homedir_config, #initialize, #locate, #retention, #retention_source, store_configs, #verify, #warnings
Methods included from Enumeration
#bytes_for, #encode_project, #project_dir_name, #project_path_for, #session_id_from, #started_at_for, #updated_at_for
Constructor Details
This class inherits a constructor from Agent::Sessions::Adapters::Base
Class Method Details
Instance Method Details
#project_paths ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/agent/sessions/adapters/copilot.rb', line 63 def project_paths db_path = primary_layer.path return [] unless File.exist?(db_path) paths = [] each_session_row(db_path, "SELECT DISTINCT cwd FROM sessions ORDER BY cwd") do |row| paths << row.first if row.first.is_a?(String) end paths.uniq end |
#sessions ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/agent/sessions/adapters/copilot.rb', line 38 def sessions db_path = primary_layer.path return [].lazy unless File.exist?(db_path) Enumerator.new do |yielder| each_session_row(db_path, "SELECT #{SESSION_COLUMNS} FROM sessions") do |row| yielder << build_row_session(db_path, row) end end.lazy end |
#sessions_for_project(dir) ⇒ Object
cwd is a real column holding a real absolute path, so filtering is a WHERE clause rather than a read-and-compare loop.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/agent/sessions/adapters/copilot.rb', line 51 def sessions_for_project(dir) dir = File.(dir) db_path = primary_layer.path return [].lazy unless File.exist?(db_path) Enumerator.new do |yielder| each_session_row(db_path, "SELECT #{SESSION_COLUMNS} FROM sessions WHERE cwd = ?", [dir]) do |row| yielder << build_row_session(db_path, row) end end.lazy end |