Skip to content

feat: add OpenCode V2 session parsing and subagent curiosity detection - #319

Open
Jarno Peltoniemi (jarnopeltoniemi) wants to merge 1 commit into
microsoft:mainfrom
jarnopeltoniemi:feat/opencode-v2
Open

Jarno Peltoniemi (jarnopeltoniemi) wants to merge 1 commit into
microsoft:mainfrom
jarnopeltoniemi:feat/opencode-v2

Conversation

@jarnopeltoniemi

Copy link
Copy Markdown

Summary

Add support for parsing OpenCode V2 session logs stored in SQLite databases with the new session_v2 and session_message tables, and extend curiosity activity detection to recognize V2-style subagent tool calls.

Changes

  • OpenCode V2 parser: Detects V1 vs V2 tables at runtime. V2 sessions are read from session_v2/session_message with inline text/files/content fields. Migrated sessions appearing in both formats are counted once (V2 wins).
  • V2 image support: Inline file attachments (base64 + local URI) on V2 user messages are counted and extracted.
  • Multi-round turns: Output tokens accumulate across assistant messages within a single turn; agent and variant are read from assistant model data.
  • File edit accuracy: fileDiffs array on V1 parts captures replace-all/overwrite behavior that input fields alone cannot.
  • Curiosity detection: subagent tool added to investigation tools; data.agent fallback for V2-style role detection.
  • Docs: Updated supported tools page to describe V1+V2 support and channel-specific DB discovery.

Testing

  • Unit tests pass (except 2 pre-existing image-data failures unrelated to these changes).
  • New test cases cover V2 inline attachments, direct V2 image reads, and empty directory discovery.

@jarnopeltoniemi

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@san360

Copy link
Copy Markdown
Contributor

Thanks for adding OpenCode V2 support! A heads-up on overlap with token work in flight on src/core/parser-opencode.ts:

@jarnopeltoniemi

Copy link
Copy Markdown
Author

Rebased on main. Dropped tokenSource merge, now using addOpenCodeTokens(). OpenCode V2 changes preserved.

@jarnopeltoniemi
Jarno Peltoniemi (jarnopeltoniemi) force-pushed the feat/opencode-v2 branch 2 times, most recently from 243b901 to d1e8428 Compare November 3, 2026 14:22
@jarnopeltoniemi

Copy link
Copy Markdown
Author

Rebased onto main; V2 subagent sessions are now recognized, and session titles from the DB show on the Timeline.

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.

2 participants