summaryrefslogtreecommitdiff
path: root/internal/showcase/showcase.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-18 08:50:57 +0200
committerPaul Buetow <paul@buetow.org>2026-03-18 08:50:57 +0200
commitd24a40f2f66999f36ab4d0e26cfe88c38d12e64e (patch)
treec283fab3cca9eeb7b2c8cd56abf502fc9b4215ba /internal/showcase/showcase.go
parentc0064e540e07225b5ff3a208b3b1c7dbb3f10841 (diff)
feat(ai): add opencode as default AI tool for releases and showcasesv0.15.6
Replace amp with opencode (local Ollama gpt-oss:120b) as the default AI tool. Opencode is tried first in both release notes generation and showcase summaries, with amp as the first fallback in the chain: opencode → amp → hexai → claude → aichat. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'internal/showcase/showcase.go')
-rw-r--r--internal/showcase/showcase.go30
1 files changed, 28 insertions, 2 deletions
diff --git a/internal/showcase/showcase.go b/internal/showcase/showcase.go
index dd5fc9c..24662e9 100644
--- a/internal/showcase/showcase.go
+++ b/internal/showcase/showcase.go
@@ -50,7 +50,7 @@ func New(cfg *config.Config, workDir string) *Generator {
return &Generator{
config: cfg,
workDir: workDir,
- aiTool: "amp", // default to amp
+ aiTool: "opencode", // default to opencode (local Ollama with gpt-oss:120b)
}
}
@@ -215,7 +215,25 @@ func findReadmeContent(repoPath string) ([]byte, string, bool) {
func selectSummaryTool(aiTool string) string {
switch aiTool {
- case "amp", "":
+ case "opencode", "":
+ // Default chain: opencode → amp → hexai → claude → aichat
+ if _, err := exec.LookPath("opencode"); err == nil {
+ return "opencode"
+ }
+ if _, err := exec.LookPath("amp"); err == nil {
+ return "amp"
+ }
+ if _, err := exec.LookPath("hexai"); err == nil {
+ return "hexai"
+ }
+ if _, err := exec.LookPath("claude"); err == nil {
+ return "claude"
+ }
+ if _, err := exec.LookPath("aichat"); err == nil {
+ return "aichat"
+ }
+ case "amp":
+ // Explicit amp: amp → hexai → claude → aichat
if _, err := exec.LookPath("amp"); err == nil {
return "amp"
}
@@ -251,6 +269,14 @@ func runSummaryTool(selectedTool, prompt, repoPath, readmeFile string, readmeCon
var cmd *exec.Cmd
switch selectedTool {
+ case "opencode":
+ fmt.Printf("Running opencode command (stdin payload)\n")
+ if readmeFound {
+ fmt.Printf(" echo <README content> | opencode run --model ollama/gpt-oss:120b \"%s\"\n", prompt)
+ fmt.Printf(" Using %s as input\n", readmeFile)
+ cmd = exec.Command("opencode", "run", "--model", "ollama/gpt-oss:120b", prompt)
+ cmd.Stdin = strings.NewReader(string(readmeContent))
+ }
case "amp":
fmt.Printf("Running amp command (stdin payload)\n")
if readmeFound {