Skip to content

Comments

remove ExportData field and dead file write from OpenCode WriteSession#461

Merged
Soph merged 3 commits intosoph/opencode-refactorfrom
gtrrz-victor/opencode-refactor
Feb 23, 2026
Merged

remove ExportData field and dead file write from OpenCode WriteSession#461
Soph merged 3 commits intosoph/opencode-refactorfrom
gtrrz-victor/opencode-refactor

Conversation

@gtrrz-victor
Copy link
Contributor

  • replace sql queries with opencode session delete
  • remove ExportData field and dead file write from OpenCode WriteSession

replace sql queries with opencode session delete
Copilot AI review requested due to automatic review settings February 23, 2026 00:38
@gtrrz-victor gtrrz-victor requested a review from a team as a code owner February 23, 2026 00:38
@cursor
Copy link

cursor bot commented Feb 23, 2026

PR Summary

Medium Risk
Changes the rewind/resume restore mechanism for OpenCode and replaces direct DB deletes with an external CLI command, so behavior depends on opencode output/availability and could impact rewind correctness.

Overview
Simplifies OpenCode session persistence by removing the AgentSession.ExportData field and updating resume/rewind/logs-only restore paths to rely solely on NativeData when calling WriteSession.

OpenCodeAgent.WriteSession no longer writes a checkpoint JSON file and now only (re)imports the transcript into OpenCode; rewind cleanup is switched from direct SQLite sqlite3 deletion to a new runOpenCodeSessionDelete wrapper around opencode session delete (treating “session not found” as success).

Written by Cursor Bugbot for commit 895468c. Configure here.

@gtrrz-victor
Copy link
Contributor Author

@cursor review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ExportData from agent.AgentSession and updated call sites to pass only NativeData.
  • Deleted the OpenCode SQLite helper (direct sqlite3 query execution) and replaced it with opencode session delete.
  • Simplified OpenCodeAgent.WriteSession to import only (no longer writes the transcript file to SessionRef).

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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

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
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

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
@Soph Soph merged commit d9e540a into soph/opencode-refactor Feb 23, 2026
3 checks passed
@Soph Soph deleted the gtrrz-victor/opencode-refactor branch February 23, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants