Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog.d/319.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Added

- **OpenCode V2** session logs: sessions stored in the new `session_v2`/`session_message`
database tables are now parsed for prompts, models, tokens, tools, file edits, and inline
image attachments, alongside the classic V1 tables. Migrated sessions that appear in both
formats are counted once, and on the Timeline each session carries its title from the
database (#319)
- `subagent` tool calls now count as investigation activity in the Curiosity view, and OpenCode
subagent sessions are recognized as automated turns instead of user turns (#319)
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"extjs",
"falsey",
"fastapi",
"filediff",
"finalizable",
"foxpro",
"fpath",
Expand Down
6 changes: 5 additions & 1 deletion docs/content/getting-started/supported-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Reads session history from OpenAI's Codex terminal agent. Captures prompts, comp

Parses session logs from the open-source OpenCode terminal tool that supports multiple LLM backends.

Both OpenCode 1 and OpenCode 2 are supported. The reader detects V1 SQLite tables or V2's inline message format automatically, capturing prompts, assistant responses, model and reasoning-effort selections, token counts, tool calls, and file edits. Migrated sessions that remain in both formats are counted once, using the V2 copy.

Databases are discovered in the standard OpenCode data directories, including `~/.local/share/opencode/`, `$XDG_DATA_HOME/opencode/`, and platform-specific application data directories. Channel-specific databases such as `opencode-nightly.db` are also included. Legacy V1 JSON storage remains supported when a database or SQLite runtime support is unavailable. All database connections are read-only.

## GitHub Copilot for Xcode

Reads Copilot Chat conversation logs from Apple's Xcode IDE. Sessions are parsed from SQLite databases stored in the GitHub Copilot configuration directory.
Expand All @@ -54,7 +58,7 @@ Coding Moments counts image attachments on user turns and loads the original ima
| GitHub Copilot CLI and App | User-event attachments and image variables, matched to the corresponding conversation turn |
| Claude | Inline image content, including image-only turns and merged subagent transcripts |
| Codex | User image content and local image attachments; mirrored event records count only once |
| OpenCode | Image file parts in legacy JSON storage or current SQLite databases |
| OpenCode | V1 image file parts in JSON storage or SQLite, and V2 user file attachments |
| Xcode | Stored image references on user turns |

Image extraction runs in the existing parse worker, not on the extension-host thread. Raw image payloads are not stored in the analytics cache. Extraction returns at most four images per turn, with a 10 MB limit per image. Local PNG, JPEG, GIF, WebP, BMP, and AVIF images are supported. Reconstructing raw VS Code JSON or JSONL state is limited to 50 MB per session file.
Expand Down
5 changes: 4 additions & 1 deletion src/core/curiosity-activity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { detectCuriosity } from './curiosity';
describe('Recorded Curiosity tools', () => {
it.each([
['functions.view', true], ['functions.web_fetch', true], ['apply_patch', true],
['Agent', true], ['spawn_agent', true], ['multi_tool_use.parallel', true],
['Agent', true], ['spawn_agent', true], ['subagent', true], ['multi_tool_use.parallel', true],
['bash', false], ['task_complete', false], ['unknown_read_tool', false],
])('checks evidence eligibility before reading arguments: %s', (name, eligible) => {
expect(hasRecordedToolEvidence(name)).toBe(eligible);
Expand Down Expand Up @@ -59,6 +59,9 @@ describe('Recorded Curiosity tools', () => {
it('uses recorded roles for investigation evidence, never agent names or prompt keywords', () => {
expect(recordedInvestigation('functions.task', { agent_type: 'research' })).toBe('research');
expect(recordedInvestigation('Agent', { subagent_type: 'Explore' })).toBe('explore');
expect(recordedInvestigation('subagent', { agent: 'explore' })).toBe('explore');
expect(recordedInvestigation('subagent', { agent: 'RESEARCH' })).toBe('research');
expect(recordedInvestigation('subagent', { agent: 'general', prompt: 'Research the web.' })).toBeUndefined();
expect(recordedInvestigation('spawn_agent', { agent_type: 'general-purpose', prompt: 'Research the web.' })).toBeUndefined();
expect(recordedInvestigation('unknown_research_agent', { agent_type: 'research' })).toBeUndefined();
});
Expand Down
4 changes: 2 additions & 2 deletions src/core/curiosity-activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const NEUTRAL_TOOLS = new Set([
'list_bash', 'list_powershell', 'task_complete',
]);
const CLARIFICATION_TOOLS = new Set(['ask_user', 'askuserquestion', 'vscode_askquestions']);
const INVESTIGATION_TOOLS = new Set(['task', 'agent', 'spawn_agent']);
const INVESTIGATION_TOOLS = new Set(['task', 'agent', 'spawn_agent', 'subagent']);

export function toolIdentity(name: string): string {
return name.slice(name.lastIndexOf('.') + 1).toLowerCase();
Expand Down Expand Up @@ -88,7 +88,7 @@ function record(value: unknown): Record<string, unknown> | undefined {
export function recordedInvestigation(name: string, args: unknown): 'research' | 'explore' | undefined {
if (!INVESTIGATION_TOOLS.has(toolIdentity(name))) return undefined;
const data = record(args);
const role = data?.agent_type ?? data?.subagent_type;
const role = data?.agent_type ?? data?.subagent_type ?? data?.agent;
if (typeof role !== 'string') return undefined;
const normalized = role.toLowerCase();
return normalized === 'research' || normalized === 'explore' ? normalized : undefined;
Expand Down
Loading