Skip to content

replace sqlite query opencode native commands#439

Merged
peyton-alt merged 1 commit intofeat/add-opencodefrom
gtrrz-victor/replace-sqlite-query-opencode-native-commands
Feb 20, 2026
Merged

replace sqlite query opencode native commands#439
peyton-alt merged 1 commit intofeat/add-opencodefrom
gtrrz-victor/replace-sqlite-query-opencode-native-commands

Conversation

@gtrrz-victor
Copy link
Contributor

No description provided.

@gtrrz-victor gtrrz-victor requested a review from a team as a code owner February 20, 2026 06:15
Copilot AI review requested due to automatic review settings February 20, 2026 06:15
@cursor
Copy link

cursor bot commented Feb 20, 2026

PR Summary

Medium Risk
Touches core checkpoint I/O and resume/rewind plumbing by adding optional ExportData handling, which could affect session restoration across agents if buggy, though changes are largely additive and guarded.

Overview
Adds a new preview opencode agent integration, including an auto-generated OpenCode plugin (.opencode/plugins/entire.ts) that writes JSONL transcripts plus a native export JSON and invokes entire hooks opencode for session/turn lifecycle events.

Extends checkpoint storage and session restore flows to carry optional agent ExportData (export.json) through commit/condense, resume, and rewind; the OpenCode agent uses this to delete/re-import sessions via native opencode session delete + opencode import (with timeouts) so opencode -s <id> works after resume/rewind.

Updates summarization/condensation and transcript scoping to understand OpenCode’s JSONL schema (prompts, tool calls, token usage), and expands uninstall/detection/integration tests to cover OpenCode hooks and end-to-end strategy flows.

Written by Cursor Bugbot for commit fff26c6. Configure here.

@gtrrz-victor gtrrz-victor force-pushed the gtrrz-victor/replace-sqlite-query-opencode-native-commands branch from fff26c6 to 58d768c Compare February 20, 2026 06:17
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 adds first-class OpenCode support across the Entire CLI pipeline (hooks → lifecycle → checkpointing/condensation → resume/rewind → summarization), including persisting OpenCode-native export data so sessions can be restored into OpenCode’s SQLite-backed store.

Changes:

  • Introduces a new opencode agent implementation (hooks, transcript parsing, token usage, and native import/export integration).
  • Extends checkpoint storage + restore flows to persist and restore optional agent ExportData (e.g., OpenCode export JSON).
  • Adds unit + integration coverage for OpenCode summarization, hook flows, and strategy composition.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cmd/entire/cli/summarize/summarize_test.go Adds OpenCode condensed-transcript tests; updates Gemini tool-detail helper naming.
cmd/entire/cli/summarize/summarize.go Adds OpenCode transcript condensation and generalizes tool-detail extraction across Gemini/OpenCode.
cmd/entire/cli/strategy/manual_commit_types.go Adds ExportData to extracted session data for checkpoint persistence.
cmd/entire/cli/strategy/manual_commit_rewind.go Restores sessions via agent WriteSession (supports native import via ExportData).
cmd/entire/cli/strategy/manual_commit_condensation.go Reads export data from session metadata; adds OpenCode prompt + token usage extraction.
cmd/entire/cli/strategy/common.go Extends agent detection heuristics to recognize OpenCode projects.
cmd/entire/cli/setup.go Includes OpenCode in uninstall detection and hook removal.
cmd/entire/cli/rewind.go Restores export data from committed checkpoints / shadow commits and uses WriteSession when present.
cmd/entire/cli/resume.go Plumbs export data through resume path into AgentSession.
cmd/entire/cli/paths/paths.go Adds export.json filename constant for checkpoint/session metadata.
cmd/entire/cli/lifecycle.go Copies OpenCode export JSON into session metadata directory at turn end.
cmd/entire/cli/integration_test/testenv.go Adds OpenCode project dir to integration test environment and removes unsupported agent setting.
cmd/entire/cli/integration_test/opencode_hooks_test.go New integration tests for OpenCode hook flow, rewind, and condensation.
cmd/entire/cli/integration_test/hooks.go Adds an OpenCode hook runner + helpers for generating OpenCode JSONL transcripts in tests.
cmd/entire/cli/integration_test/agent_test.go Registers OpenCode agent and adds OpenCode agent detection/hook/session tests.
cmd/entire/cli/hooks_cmd.go Registers the OpenCode agent so hook subcommands are available.
cmd/entire/cli/explain.go Treats OpenCode transcript offsets like JSONL (line-based) for scoping/offset computation.
cmd/entire/cli/checkpoint/temporary.go Adds ability to read export data from shadow-branch commit trees.
cmd/entire/cli/checkpoint/committed.go Writes/reads optional export data in committed checkpoints and extends session log lookup.
cmd/entire/cli/checkpoint/checkpoint.go Adds ExportData to committed write options and session content model.
cmd/entire/cli/agent/session.go Adds ExportData to AgentSession for native restore/import flows.
cmd/entire/cli/agent/registry.go Adds OpenCode agent name/type constants.
cmd/entire/cli/agent/opencode/types.go New OpenCode transcript + hook payload types.
cmd/entire/cli/agent/opencode/transcript_test.go New unit tests for JSONL parsing, prompts/files extraction, chunking, and token accounting.
cmd/entire/cli/agent/opencode/transcript.go New JSONL parser + transcript analyzer/token calculator implementation for OpenCode.
cmd/entire/cli/agent/opencode/plugin.go Embeds the OpenCode TypeScript plugin template.
cmd/entire/cli/agent/opencode/opencode.go New OpenCode agent implementation, including best-effort native import via opencode import.
cmd/entire/cli/agent/opencode/lifecycle_test.go New unit tests for mapping OpenCode hooks to normalized lifecycle events.
cmd/entire/cli/agent/opencode/lifecycle.go New hook handler mapping OpenCode hook verbs to normalized lifecycle events.
cmd/entire/cli/agent/opencode/hooks_test.go New tests for installing/uninstalling the OpenCode plugin file.
cmd/entire/cli/agent/opencode/hooks.go Installs/removes the OpenCode plugin file under .opencode/plugins/.
cmd/entire/cli/agent/opencode/entire_plugin.ts New OpenCode plugin that emits hook events and writes JSONL + export JSON.
cmd/entire/cli/agent/opencode/cli_commands.go Wraps opencode session delete and opencode import with timeouts for native restore.
Comments suppressed due to low confidence (1)

cmd/entire/cli/agent/opencode/opencode.go:123

  • os.ReadFile(input.SessionRef) will likely trigger gosec G304 (file path provided as variable). Other code paths reading hook-provided paths annotate this with //nolint:gosec plus a short justification or validate the path before reading to satisfy lint/CI.

	return &agent.AgentSession{
		AgentName:     a.Name(),
		SessionID:     input.SessionID,
		SessionRef:    input.SessionRef,
		NativeData:    data,
		ModifiedFiles: modifiedFiles,
	}, nil

Copy link
Contributor

@peyton-alt peyton-alt left a comment

Choose a reason for hiding this comment

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

🙌

@peyton-alt peyton-alt merged commit 79ec168 into feat/add-opencode Feb 20, 2026
3 checks passed
@peyton-alt peyton-alt deleted the gtrrz-victor/replace-sqlite-query-opencode-native-commands branch February 20, 2026 08:32
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

Comments