remove ExportData field and dead file write from OpenCode WriteSession#461
Conversation
gtrrz-victor
commented
Feb 23, 2026
- replace sql queries with opencode session delete
- remove ExportData field and dead file write from OpenCode WriteSession
replace sql queries with opencode session delete
PR SummaryMedium Risk Overview
Written by Cursor Bugbot for commit 895468c. Configure here. |
|
@cursor review |
There was a problem hiding this comment.
Pull request overview
This PR refactors the OpenCode agent restore path by removing the ExportData field from agent.AgentSession, deleting the legacy direct-SQLite deletion code, and switching session cleanup to an OpenCode CLI session delete command before re-import.
Changes:
- Removed
ExportDatafromagent.AgentSessionand updated call sites to pass onlyNativeData. - Deleted the OpenCode SQLite helper (direct
sqlite3query execution) and replaced it withopencode session delete. - Simplified
OpenCodeAgent.WriteSessionto import only (no longer writes the transcript file toSessionRef).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/manual_commit_rewind.go | Stops populating ExportData when restoring logs-only sessions. |
| cmd/entire/cli/rewind.go | Removes ExportData usage when restoring transcripts from checkpoint/shadow storage. |
| cmd/entire/cli/resume.go | Removes ExportData usage when resuming a session from checkpoint storage. |
| cmd/entire/cli/agent/session.go | Removes the ExportData field from the shared session struct. |
| cmd/entire/cli/agent/opencode/sqlite.go | Deletes legacy direct SQLite deletion implementation. |
| cmd/entire/cli/agent/opencode/opencode.go | Updates OpenCode Read/Write session behavior; WriteSession becomes import-only and uses session delete before import. |
| cmd/entire/cli/agent/opencode/cli_commands.go | Adds runOpenCodeSessionDelete command wrapper for deleting sessions via OpenCode CLI. |
Replace file-write test (which tested removed behavior) with validation tests that don't need opencode installed on CI runners. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: d91f42f3046e
Follow repo convention of using cli/logging for operational diagnostics so messages go to .entire/logs/ instead of intermixing with user output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 7a7d20d47c1f