Skip to content

Documentation: Upstream sync workflow #11779

Closed as not planned
Closed as not planned

Description

@randomm

Parent Epic

Part of #11762 (Ink-based TUI Rewrite)

Objective

Document the process for syncing backend changes from upstream sst/opencode repository.

Background

oclite is a fork of opencode. We want:

  • Backend features/fixes from upstream (session, provider, tools, MCP)
  • Our own TUI implementation (Ink-based)
  • Cherry-pick workflow, never full merge

Documentation to Create

UPSTREAM_SYNC.md

# Upstream Sync Guide

## Overview
This document describes how to sync backend changes from upstream sst/opencode.

## Setup (One-time)
\`\`\`bash
git remote add upstream https://github.com/sst/opencode.git
\`\`\`

## Sync Workflow

### 1. Fetch upstream changes
\`\`\`bash
git fetch upstream
\`\`\`

### 2. Identify relevant commits
\`\`\`bash
# Backend-only commits
git log --oneline upstream/dev -- \
  packages/opencode/src/session \
  packages/opencode/src/provider \
  packages/opencode/src/tool \
  packages/opencode/src/mcp \
  packages/opencode/src/skill \
  packages/opencode/src/agent \
  packages/opencode/src/permission
\`\`\`

### 3. Review and cherry-pick
\`\`\`bash
git cherry-pick <commit-hash>
\`\`\`

### 4. Handle conflicts
- **cli/lite/**: Always keep ours (--ours)
- **cli/cmd/tui/**: Always keep ours (--ours)
- **Backend code**: Merge carefully, test after

### 5. Update sync log
Add entry to this file with commit hash and date.

## Include Patterns
- fix(provider):, feat(provider):
- fix(session):, feat(session):
- fix(tool):, feat(tool):
- fix(mcp):, feat(mcp):
- fix(skill):, feat(skill):

## Exclude Patterns
- tui:, fix(tui):, feat(tui):
- fix(app):, feat(app):
- desktop:

## Sync Log

| Date | Upstream Commit | Description |
|------|-----------------|-------------|
| 2026-02-02 | (initial fork) | Fork from sst/opencode |

## Recommended Cadence
- Weekly: Check for critical fixes
- Bi-weekly: Cherry-pick accumulated changes
- Per release: Review CHANGELOG for breaking changes

Tasks

  • Create UPSTREAM_SYNC.md in repo root
  • Add initial sync log entry
  • Document any special handling for specific files
  • Add to README.md reference

Acceptance Criteria

  • Document is clear and actionable
  • Commands are tested and work
  • Include/exclude patterns are accurate
  • Sync log format is established

Estimated Effort

0.5 days

Risk

Low - documentation task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions