Skip to content

seilk/opencode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode Custom Build

Fork of anomalyco/opencode with patches for LiteLLM proxy compatibility.

Patch: Gemini Finish Reason Fix

Problem: When using Gemini models through LiteLLM proxy (e.g., Letsur Gateway), the agent loop terminates after the first response instead of continuing with tool calls.

Cause: LiteLLM returns finish_reason: "stop" instead of "tool_calls" in streaming mode. (LiteLLM #12240)

Fix: Detect tool calls by checking message parts, regardless of finish_reason.

Usage

git clone git@github.com:seilk/opencode.git opencode-custom
cd opencode-custom
./update-and-build.sh

This will:

  1. Fetch the latest tag from upstream
  2. Skip if already on the latest version
  3. Create a patched branch fix-gemini-finish-reason-vX.X.X
  4. Apply the patch
  5. Build and install to ~/.opencode/bin/
  6. Auto-commit all changes to the new branch

Add to PATH:

export PATH="$HOME/.opencode/bin:$PATH"

Files

  • update-and-build.sh - Build script
  • patches/fix-gemini-finish-reason.patch - The patch file

Branch Structure

  • main - Scripts and patches only (this branch)
  • fix-gemini-finish-reason-vX.X.X - Patched builds based on upstream tags

Upstream

https://github.com/anomalyco/opencode

About

The open source coding agent.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%