Skip to content

feat(adapters): record Devin tool calls as session events - #308

Merged
lodyai[bot] merged 1 commit into
mainfrom
feat/tool-call-session-events
Oct 7, 2026
Merged

lodyai[bot] merged 1 commit into
mainfrom
feat/tool-call-session-events

Conversation

@samzong

@samzong samzong commented Oct 7, 2026

Copy link
Copy Markdown
Owner

What's changed?

  • The devin adapter now turns tool_calls on assistant messages and tool result messages in ~/.local/share/devin/cli/sessions.db into session events.
  • read, edit, and write calls carry file evidence from file_path. exec calls are command events with shell evidence resolved against workdir, or the session directory when workdir is missing. grep, find_file_by_name, and web_search are search events. Other tools are tool_call events. Each result keeps its tool name and gets a success/error status from Devin's result metadata.
  • Events are deduplicated by message_id, the same way usage already is, so nodes copied across compaction branches are counted once. Tool calls made by Sidekick subagents in the same Devin session are recorded with no message_seq, because they do not belong to a message in the main discussion.
  • devin declares event parser version 1 and is added to source_supports_event_backfill(), so sessions indexed before this change get their events on the next recall sync or recall sync --backfill-events.

Why

  • Devin sessions were indexed with messages and usage but no session events, so file and command history did not cover Devin work.

Test evidence

  • Tool and version: Devin Desktop 3.10.48 (Devin Local), with data in ~/.local/share/devin/cli/sessions.db (33 visible sessions); Recall built from this branch with cargo build --release.
  • OS: macOS (Darwin 27.0.0).
  • Real data: a Devin Local session (long-marmot) that read sample.txt with the read tool, ran wc -l sample.txt, edited the file, and ran wc -l again. The checks below ran in a throwaway HOME that symlinks the real tool data and starts with an empty Recall index.
  • Before (origin/main binary): recall sync --source devin --project=all indexed 33 sessions with 1688 usage events and 0 session events. recall sync --backfill-events --dry-run reported unsupported: devin.
  • After (this branch, same index): --backfill-events --dry-run reported scanned=33, updated=27, no_events=6. recall sync --source devin --project=all then wrote 4544 events to the 33 already-indexed sessions: 2272 tool results and 2272 calls (1142 command, 360 file_read, 352 file_write, 290 tool_call, 128 search). Usage stayed at 1688 events. A second sync reported 33 unchanged and parsed 0 sessions.
  • recall session show --source devin --source-id long-marmot --include events --format json lists 8 events in order: file_read read, command wc -l sample.txt, two results, file_write edit, command wc -l sample.txt && tail -n 2 sample.txt, two results. All results report success, and the read and edit events carry file evidence for /tmp/recall-windsurf-probe/sample.txt.
  • MCP file_history with path=/tmp/recall-windsurf-probe/sample.txt, source=devin returns this session's edit and read events.
  • An independent review compared an index built by origin/main and then backfilled by this branch with an index built by this branch from scratch. The messages, usage, and sessions tables were identical, and so were the events tables (4544 rows each).
  • make check passes.
  • Not verified: shell commands such as wc -l produce command events without file evidence, because the shared shell evidence parser does not model read-only commands; this is unchanged behavior shared by all adapters. Remote Devin (cloud) sessions were not checked, since they are not stored in this database.

Closes #302

Parse tool_calls and tool results from the Devin sessions database into
session events with file and command evidence, and enable event backfill
for the devin source so previously indexed sessions gain events.

Closes #302

Signed-off-by: samzong <samzong.lu@gmail.com>
@samzong
samzong marked this pull request as ready for review October 7, 2026 23:17
@lodyai
lodyai Bot merged commit a1f0ba5 into main Oct 7, 2026
3 checks passed
@lodyai
lodyai Bot deleted the feat/tool-call-session-events branch October 7, 2026 23:18
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.

Record tool-call session events for Devin sessions

1 participant