[Feature]: Devin (local CLI / Desktop) host adapter for agent-hook-plugin — capture from sessions.db
中文见下
Issue Origin
Observed or reproduced in a real environment
Problem Statement
agent-hook-plugin has host adapters for Cursor, Kimi Code, Trae and ZCode, but none for Devin (local CLI / Desktop).
Devin for Terminal can install the Claude Code plugin (#6880), but capture does not work there. The Claude plugin's auto-capture.mjs needs transcript_path in Stop stdin and skips without it. Devin's Stop stdin only has hook_event_name, session_id, prompt_id, stop_hook_active and last_assistant_message.
Devin keeps the full conversation in a local SQLite store, ~/.local/share/devin/cli/sessions.db (WAL mode), shared by the CLI and Desktop.
Observed on 2026-11-09 with Devin CLI 3000.11.205, Desktop bundled 3000.11.238 and store schema migration 20:
- Every message is already in the store when Stop fires, in both CLI and Desktop.
- Each message has a stable
message_id. Context rebuilds copy nodes but keep the samemessage_id. /compactstarts a new chain. The summary node points back to the old chain throughsummarized_from./exit, Ctrl-C,-pand quitting Desktop all fireSessionEnd.
Details: https://github.com/zyaiire/openviking-devin-memory/blob/main/DESIGN.md
Proposed Solution
We'll build a community adapter in https://github.com/zyaiire/openviking-devin-memory, laid out like Kimi Code's:
- A
.devin-pluginwith hooks,.mcp.jsonand skills. memory-plugin-sharedandscripts/vendored from a pinned commit, unmodified.- Our own
hosts/devin.mjsandhosts/devin-turns.mjs.
Capture reads only sessions.db. It opens the file read-only with node:sqlite so WAL content is included, and walks the main chain. It turns user input and assistant text into {role, content, turn_id}, using message_id as turn_id, and sends them through the shared incremental-turn-capture with addAgentMessages. It commits on SessionEnd and PreCompact, following the Kimi policy. Stop stdin is only the trigger. Local only, no Devin Cloud. We don't use ATIF or --export.
Once it works, we'd like to upstream it as hosts/devin if maintainers want it.
Questions for maintainers
- Is an upstream
hosts/devinwelcome, or should it stay a community plugin? - Capture needs a Node version with built-in
node:sqlite(tested on v26.11.1). Recall and MCP still run on Node 18. Is that split acceptable? - Does using a host message id (not a per-turn id) as
turn_idfitincremental-turn-captureas intended?
Alternatives Considered
- Installing the Claude Code plugin in Devin: recall works, capture is skipped (see above).
- Using Stop's
last_assistant_message: it has only the final reply and loses user input and earlier messages. - ATIF /
--export: a second file format, out of scope for v1.
Feature Area
Other
Use Case
Using Devin (CLI and Desktop) alongside other agents on the same machine, all sharing one OpenViking memory: profile at session start, recall on prompt submit, capture at session end, plus OpenViking MCP tools.
Contribution
- [x] I am willing to contribute to implementing this feature
中文
agent-hook-plugin 现在没有 Devin(本机 CLI / Desktop)的宿主适配。在 Devin 里装 Claude Code 插件(#6880),召回可用,但抓对话会被跳过:Claude 插件需要 Stop 事件里有 transcript_path,而 Devin 的 Stop 事件里没有这个字段。
Devin 把完整对话存在本机的 ~/.local/share/devin/cli/sessions.db(SQLite,WAL 模式),CLI 和 Desktop 共用这个库。2026-11-09 实测确认了四点:Stop 触发时消息已经入库;每条消息有稳定的 message_id;压缩后摘要节点会通过 summarized_from 指回旧链;各种退出方式都会触发 SessionEnd。
我们先在 https://github.com/zyaiire/openviking-devin-memory 做社区版,结构仿照 Kimi Code。抓对话只读 sessions.db,用 message_id 当 turn_id,在 SessionEnd 和 PreCompact 时提交。只支持本机,不做 Cloud,不用 ATIF。跑通后,如果维护者愿意,再提 hosts/devin 的 PR。
想请维护者回答的问题:
- 是否欢迎上游收录
hosts/devin,还是保持社区插件? - 抓对话需要自带
node:sqlite的 Node 版本(实测 v26.11.1),召回和 MCP 仍可在 Node 18 运行。这样拆分能接受吗? - 用宿主的消息 id(而不是按轮的 id)当
turn_id,符合incremental-turn-capture的设计吗?