Repository navigation
feat(adapters): record Devin tool calls as session events - #308
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's changed?
devinadapter now turnstool_callson assistant messages andtoolresult messages in~/.local/share/devin/cli/sessions.dbinto session events.read,edit, andwritecalls carry file evidence fromfile_path.execcalls arecommandevents with shell evidence resolved againstworkdir, or the session directory whenworkdiris missing.grep,find_file_by_name, andweb_searcharesearchevents. Other tools aretool_callevents. Each result keeps its tool name and gets a success/error status from Devin's result metadata.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 nomessage_seq, because they do not belong to a message in the main discussion.devindeclares event parser version 1 and is added tosource_supports_event_backfill(), so sessions indexed before this change get their events on the nextrecall syncorrecall sync --backfill-events.Why
Test evidence
~/.local/share/devin/cli/sessions.db(33 visible sessions); Recall built from this branch withcargo build --release.long-marmot) that readsample.txtwith the read tool, ranwc -l sample.txt, edited the file, and ranwc -lagain. The checks below ran in a throwawayHOMEthat symlinks the real tool data and starts with an empty Recall index.recall sync --source devin --project=allindexed 33 sessions with 1688 usage events and 0 session events.recall sync --backfill-events --dry-runreportedunsupported: devin.--backfill-events --dry-runreportedscanned=33, updated=27, no_events=6.recall sync --source devin --project=allthen 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 reported33 unchangedand parsed 0 sessions.recall session show --source devin --source-id long-marmot --include events --format jsonlists 8 events in order:file_readread,commandwc -l sample.txt, two results,file_writeedit,commandwc -l sample.txt && tail -n 2 sample.txt, two results. All results reportsuccess, and the read and edit events carry file evidence for/tmp/recall-windsurf-probe/sample.txt.file_historywithpath=/tmp/recall-windsurf-probe/sample.txt,source=devinreturns this session's edit and read events.make checkpasses.wc -lproducecommandevents 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