Conversation
PR SummaryMedium Risk Overview Introduces Wires OpenCode into existing CLI flows by registering the agent, enabling transcript scoping/counting in Written by Cursor Bugbot for commit 64e61d8. Configure here. |
0d53e93 to
64e61d8
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds first-class OpenCode agent support to Entire CLI, integrating OpenCode lifecycle hooks and transcript parsing so sessions can be captured, condensed, and explained similarly to existing Claude Code and Gemini CLI flows.
Changes:
- Registers a new
opencodeagent and implements hook installation/uninstallation via an embedded OpenCode plugin template. - Adds OpenCode transcript parsing/slicing plus token and prompt extraction, and wires OpenCode support into summarize/explain and manual-commit condensation paths.
- Extends uninstall/status-related messaging and detection to include OpenCode agent hooks.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/summarize/summarize.go | Adds OpenCode transcript condensation logic for summarize/explain prompt extraction. |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Adds OpenCode parsing for transcript item counting, prompt extraction, and token usage calculation. |
| cmd/entire/cli/strategy/common.go | Detects OpenCode agent type from git trees for shadow-branch scenarios. |
| cmd/entire/cli/setup.go | Includes OpenCode in uninstall detection and hook removal output. |
| cmd/entire/cli/hooks_cmd.go | Ensures the OpenCode agent package is imported/registered for hook command registration. |
| cmd/entire/cli/explain.go | Scopes OpenCode transcripts by message index (JSON) rather than line index (JSONL). |
| cmd/entire/cli/agent/registry.go | Adds AgentNameOpenCode / AgentTypeOpenCode identifiers. |
| cmd/entire/cli/agent/opencode/opencode.go | Implements the OpenCode agent (identity, transcript storage/chunking, legacy session methods). |
| cmd/entire/cli/agent/opencode/transcript.go | Implements OpenCode transcript parsing, slicing, prompt/file extraction, and token usage aggregation. |
| cmd/entire/cli/agent/opencode/types.go | Defines OpenCode transcript and hook payload types. |
| cmd/entire/cli/agent/opencode/lifecycle.go | Maps OpenCode hook verbs into normalized lifecycle events. |
| cmd/entire/cli/agent/opencode/hooks.go | Implements hook support by installing/removing the OpenCode plugin file. |
| cmd/entire/cli/agent/opencode/plugin.go | Embeds the OpenCode plugin template into the Go binary. |
| cmd/entire/cli/agent/opencode/entire_plugin.ts | OpenCode plugin implementation that writes transcripts and calls entire hooks opencode .... |
| cmd/entire/cli/agent/opencode/*_test.go | Adds unit tests for transcript parsing, lifecycle parsing, and hook install/uninstall behaviors. |
cmd/entire/cli/strategy/common.go
Outdated
| // Check for OpenCode config | ||
| if _, err := tree.Tree(".opencode"); err == nil { | ||
| return agent.AgentTypeOpenCode | ||
| } |
There was a problem hiding this comment.
ReadAgentTypeFromTree detects OpenCode only via the presence of a .opencode tree entry, but OpenCodeAgent.DetectPresence also treats a repo-root opencode.json as a presence signal. If opencode.json is the only committed config (and .opencode is gitignored), shadow-branch detection will incorrectly fall back to Unknown. Consider also checking for tree.File("opencode.json") here to keep agent detection consistent.
| // Check for OpenCode config | |
| if _, err := tree.Tree(".opencode"); err == nil { | |
| return agent.AgentTypeOpenCode | |
| } | |
| // Check for OpenCode config (either .opencode directory or repo-root opencode.json) | |
| if _, err := tree.Tree(".opencode"); err == nil { | |
| return agent.AgentTypeOpenCode | |
| } | |
| if _, err := tree.File("opencode.json"); err == nil { | |
| return agent.AgentTypeOpenCode | |
| } |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
0274aef to
3679252
Compare
a4606b7 to
2694a84
Compare
* use tmpDir for generated OpenCode session logs, we don't need them to stay around Entire-Checkpoint: 5c2efb4784e9 * use JSONL instead of JSON, some test fixes Entire-Checkpoint: 61dc94e5a51e
No description provided.