feat: index Devin sessions - #48
Conversation
Devin (Cognition's agent) stores sessions in a plaintext SQLite database at `~/.local/share/devin/cli/sessions.db` (XDG data dir; the macOS app-support directory is probed as a legacy candidate). `sessions` carries metadata plus `main_chain_id`; `message_nodes` is a forest where retries and edits branch off mid-chain nodes, so the visible transcript is the chain walked back from that leaf along `parent_node_id`. Missing columns (older schemas), a dangling leaf or a cyclic chain fall back to listing every node — a session body can never silently vanish. - `hidden = 1` sessions (compaction helpers, deleted) and zero-content sessions are not listed. - `chat_message` JSON is decoded per node: user/assistant/system/tool roles, `thinking` objects (sealed signatures dropped), `tool_calls` with `role="tool"` rows back-filling output by `tool_call_id`, per-message `generation_model`, and `metrics` token counts accumulated along the main chain — including assistant nodes with empty content that still spent tokens. - Internal traffic folds to Meta: `system` rows, non-`user` telemetry sources (cache keep-alive), `is_user_input == false` and compaction request bodies; `<summary>` replies collapse into CompactSummary. - Open In resumes with `devin --resume <id>` inside the session's project directory (sessions are bucketed by cwd). - Remote sync mirrors `cli/sessions.db` (+ WAL) under the host cache; credentials live under `~/.config/devin`, outside the data root, and are never synced. Closes iAmCorey#46 Co-Authored-By: Devin <noreply@cognition.ai>
Resolve the conflicts with Craft Agents (iAmCorey#44), which landed on main after this branch was cut: Devin goes after Craft Agents in the enum, the sidebar order, the roster, the remote layouts, the brand list, the chart colors and the docs, and the agent counts become twenty-one. Both Unreleased CHANGELOG entries are kept, and the Devin one credits the contributor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wn nodes - main_chain: when a node on the way back from the leaf points at a parent that is not in the database, the walk stopped there and returned only the tail of the conversation. It now falls back to every node, as its doc comment says, and walks indices first so nodes are moved instead of cloned. - decode_nodes: chat_message values that do not parse and roles outside the known set are counted as unknown lines, Wake's format-drift canary, instead of being dropped silently. - Insights color: the azure at the top of the icon's gradient, which sits farther from Gemini and Cursor than the previous blue (CIEDE2000 from Gemini 9.2 -> 13.4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for this! It follows Wake's adapter conventions closely, and the fixture covers the tricky parts: the retry branch, the keep-alive and compaction traffic, and token accounting. I pushed two commits to your branch:
One question I can't answer without a Devin install. A user message is folded into Meta whenever its SELECT json_extract(chat_message, '$.metadata.telemetry.source') AS source, count(*)
FROM message_nodes
WHERE json_extract(chat_message, '$.role') = 'user'
GROUP BY source;If Devin Desktop or another entry point records real prompts under a different source, those prompts would disappear from titles, search and the Insights prompt counts, and I'd add those sources to the allow-list. I'll merge once CI is green. A fix for the source question can follow separately. |
On Windows, joining "cli/sessions.db" keeps the forward slash, so the adapter's virtual path (…\devin\cli/sessions.db) and the fixture's (…\.local/share/devin/cli/sessions.db) named the same file with different strings, and devin_parse_contract failed on windows-2022. Both sides now join one segment at a time and get native separators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The icon in this PR was Devin Desktop's whole macOS app tile (a blueprint grid with a W), which turns to noise at sidebar size and differs from the logos every other agent uses. It is now the mark devin.ai uses: three hexagons around a round notch, rendered from the site's SVG and cropped to the mark. Like Cursor and Grok it is monochrome, so there is a white version for dark mode (devin.png) and an ink one for light mode (devin-light.png). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Data from my install (macOS, Devin Desktop — every session in
So for One subtlety worth knowing: the 176 Unrelated heads-up: Desktop also keeps a per-session ACP transport log at |
Summary
Adds Devin (Cognition's agent) as a twentieth adapter, closing #46.
Devin stores sessions in a plaintext SQLite database at
~/.local/share/devin/cli/sessions.db(XDG data dir;~/Library/Application Support/devinis probed as a legacy macOS candidate).sessionscarries metadata plusmain_chain_id;message_nodesis a forest where retries and edits branch off mid-chain nodes. The visible transcript is the chain walked back from that leaf alongparent_node_id. When the leaf column is missing (older schemas), dangling, or the walk cannot reach a root, the adapter falls back to every node in write order — a session body can never silently vanish.hidden = 1sessions (compaction helpers, deleted sessions) and zero-content sessions are not listed.chat_messageJSON is decoded per node: user/assistant/system/tool roles,thinkingobjects (sealed signatures dropped),tool_callsarguments withrole="tool"rows back-filling output viatool_call_id, per-messagegeneration_model(more authoritative than the session row'smodel), andmetricstoken counts accumulated along the main chain — including assistant nodes with empty content that still spent tokens.systemrows, non-usertelemetry sources (cache keep-alive),is_user_input == false, and compaction request bodies;<summary>replies collapse into CompactSummary.devin --resume <id>inside its project directory (sessions are bucketed by cwd).cli/sessions.db(+ WAL) under the host cache. Credentials live under~/.config/devin, outside the data root, and are never synced.Reviewers may want to look at
crates/wake-core/src/adapters/devin.rs(schema probing, main-chain reconstruction, Meta classification) and the synthetic fixture incrates/wake-core/tests/common/mod.rs, which exercises hidden sessions, a retry side branch, keep-alive/compaction Meta folding, and token accumulation.Closes #46