Skip to content

Conversation

@shuv1337
Copy link
Collaborator

@shuv1337 shuv1337 commented Dec 4, 2025

Summary

  • Merges upstream sst/opencode v1.0.130 into the shuvcode fork
  • Resolves all merge conflicts while preserving fork-specific customizations

Conflicts Resolved

  • AGENTS.md: Kept fork-specific IMPORTANT section + upstream Debugging section
  • packages/opencode/script/build.ts: Kept shuvcode naming + upstream Windows path fix
  • packages/opencode/src/session/processor.ts: Kept both Token import and Provider type import
  • packages/opencode/src/tool/task.ts: Kept filterSubagents export + upstream Config import

Additional Fix

  • Fixed type error in prompt.ts: model.modelID -> model.id (Provider.Model uses id not modelID)

Closes #80

Summary by CodeRabbit

  • New Features

    • Added "Jump to last user message" navigation command
    • Implemented dynamic theme-aware chart styling matching system preferences
    • New configurable keybinds for last user message navigation and tool details visibility
  • Bug Fixes

    • Fixed model release date display
    • Improved resource exhaustion detection for provider overload scenarios
  • Documentation

    • Added style guide for contributors
    • Updated documentation with new keybinds reference
  • Chores

    • Version bump to 1.0.130 across all packages
    • Updated dependencies

✏️ Tip: You can customize this high-level summary in your review settings.

actions-user and others added 28 commits December 3, 2025 12:04
…ould only be available to primary agents (anomalyco#4913)

Co-authored-by: GitHub Action <action@github.com>
…ge (implements anomalyco#4847) (anomalyco#4855)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Add comprehensive test suite for Provider module to ensure safe
refactoring of provider internals. Tests cover:
- Provider loading from env vars and config
- Provider filtering (disabled_providers, enabled_providers)
- Model whitelist/blacklist
- Model aliasing and custom providers
- getModel, getProvider, closest, defaultModel functions

Also adds Env module for instance-scoped environment variable access,
enabling isolated test environments without global state pollution.
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: thdxr <thdxr@users.noreply.github.com>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Resolved conflicts:
- AGENTS.md: kept fork-specific IMPORTANT section + upstream Debugging section
- packages/opencode/script/build.ts: kept shuvcode naming + upstream Windows path fix
- packages/opencode/src/session/processor.ts: kept both Token import and Provider type import
- packages/opencode/src/tool/task.ts: kept filterSubagents export + upstream Config import
Fixed type error in prompt.ts: model.modelID -> model.id
@shuv1337 shuv1337 merged commit 1984fae into integration Dec 4, 2025
3 of 5 checks passed
@shuv1337 shuv1337 deleted the opencode/issue80-20251204034025 branch December 4, 2025 03:46
@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This release (v1.0.130) refactors provider and session management systems, transitioning from ModelsDev types to new Provider.Model and Provider.Info abstractions. A GitHub Actions guidelines workflow is added, style guide documentation introduced, UI theming enhanced with color-scheme awareness, and comprehensive provider system tests added.

Changes

Cohort / File(s) Summary
Version Bumps
packages/*/package.json, packages/opencode/package.json, packages/sdk/js/package.json, packages/plugin/package.json, sdks/vscode/package.json, .github/last-synced-tag
Version updated from v1.0.129 to v1.0.130 across all package manifests and sync tag. Dependency updates: @opentui/core and @opentui/solid bumped to 0.1.56.
GitHub Workflows
.github/guidelines-check.yml, .github/workflows/review.yml
Removed legacy guidelines-check workflow. Added new "Guidelines Check" workflow triggering on pull_request_target and issue_comment events with opencode compliance checking, permission verification, and inline comment posting via gh CLI.
Configuration & Documentation
.opencode/opencode.jsonc, CONTRIBUTING.md, STYLE_GUIDE.md
Added new style guide referencing in opencode config. Created STYLE_GUIDE.md with coding recommendations (function composition, variable naming, API usage). Updated CONTRIBUTING.md to reference style guide.
Provider System Refactoring
packages/opencode/src/provider/provider.ts, packages/opencode/src/provider/models.ts, packages/opencode/src/provider/transform.ts, packages/opencode/src/config/config.ts
Major refactor transitioning from ModelsDev types to new Provider.Model/Provider.Info abstractions. Updated public function signatures in transform module. Added Provider/Info schemas with strict typing. Updated model cost structure with context_over_200k field.
Environment Abstraction
packages/opencode/src/env/index.ts
New Env namespace providing state-managed environment variable access: get, all, set, remove methods with lazy initialization.
Session System Updates
packages/opencode/src/session/processor.ts, packages/opencode/src/session/index.ts, packages/opencode/src/session/prompt.ts, packages/opencode/src/session/system.ts, packages/opencode/src/session/summary.ts, packages/opencode/src/session/compaction.ts
Refactored to use new Provider.Model type throughout. Updated function signatures for language retrieval, options construction, and streaming. Added experimental_repairToolCall handler. Updated system prompt provider logic to use model.api.id.
Tool & Agent System
packages/opencode/src/tool/registry.ts, packages/opencode/src/tool/read.ts, packages/opencode/src/tool/batch.ts, packages/opencode/src/tool/task.ts, packages/opencode/src/agent/agent.ts
Simplified ToolRegistry signatures (removed modelID parameter). Updated capability detection from model.info to model.capabilities. Added primary_tools config support in task tool. Updated agent language retrieval.
Build & CLI
packages/opencode/script/build.ts, packages/opencode/src/cli/cmd/models.ts, packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Added --skip-install flag and platform-aware Tree Sitter worker path handling. Updated models list source from provider.info.models to provider.models. Added "Jump to last user message" command in Session TUI.
Server API
packages/opencode/src/server/server.ts
Updated provider API responses to use Provider.Info instead of ModelsDev.Provider. Changed data transformation from item.info to full item with Provider.fromModelsDevProvider mapping.
Share & Desktop
packages/opencode/src/share/share-next.ts, packages/desktop/src/components/prompt-input.tsx
Updated ShareNext to collect full SDK.Model objects instead of info. Disabled release date display in model list with placeholder "unknown" value.
UI Theming
packages/console/app/src/routes/workspace/[id]/graph-section.tsx
Added color-scheme awareness with CSS variable-based theming. Dynamic chart styling for grid, ticks, tooltip, legend, and text using custom properties instead of hardcoded colors.
Test Coverage
packages/opencode/test/provider/provider.test.ts, packages/opencode/test/provider/transform.test.ts, packages/opencode/test/preload.ts
Added comprehensive provider system test suite covering loader precedence, merging, whitelisting, cost defaults, and error handling. Added DeepSeek reasoning content handling tests. Updated test preload with dynamic imports and environment setup.
Nix & Extension
nix/hashes.json, packages/extensions/zed/extension.toml
Updated nodeModules hash. Bumped Zed extension version and all target archive URLs from v1.0.129 to v1.0.130.
Documentation
packages/web/src/content/docs/1-0.mdx, packages/web/src/content/docs/keybinds.mdx, STATS.md
Removed Breaking changes subsections for Theme and Keybinds. Added messages_last_user keybind documentation. Added 2025-12-03 statistics entry.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • packages/opencode/src/provider/provider.ts — Large-scale refactoring with new Model/Info abstractions, multiple internal type conversions, and altered loader/merging logic across provider initialization
  • packages/opencode/src/provider/transform.ts — Significant public API signature changes affecting multiple callers; complex conditional logic for provider-specific handling (Claude, DeepSeek, Mistral, Google)
  • packages/opencode/src/session/* (processor.ts, prompt.ts, summary.ts, compaction.ts, system.ts) — Interconnected changes across session lifecycle; model type transitions and language retrieval threading throughout
  • packages/opencode/test/provider/provider.test.ts — Verify comprehensive coverage of new provider/model system; ensure config merging, whitelisting/blacklisting, and error paths are correct
  • Public API Changes — Multiple function signature updates across provider, transform, and session modules; verify all call sites are updated consistently

Possibly related PRs

  • Integration #32: Overlapping refactoring of provider and session core modules (provider/provider.ts, provider/transform.ts, session/*, tool/registry.ts) with related public API signature changes.
  • sync: merge upstream v1.0.129 #79: Upstream sync PR that likely introduces the foundation for these architectural changes and may have merge conflicts noted in linked issue #80.
  • Merge Dev into Integration #30: Touches same CLI TUI session route (packages/opencode/src/cli/cmd/tui/routes/session/index.tsx) with version bump coordination.

Poem

🐰 Models and providers dance anew,
From ModelsDev to abstractions true,
With colors glowing in the UI's view,
And workflows checking all we brew,
v1.0.130 hops on through! 🎉

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch opencode/issue80-20251204034025

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e012e1 and 43d2cc4.

⛔ Files ignored due to path filters (3)
  • bun.lock is excluded by !**/*.lock
  • flake.lock is excluded by !**/*.lock
  • packages/sdk/js/src/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (54)
  • .github/guidelines-check.yml (0 hunks)
  • .github/last-synced-tag (1 hunks)
  • .github/workflows/review.yml (1 hunks)
  • .opencode/opencode.jsonc (1 hunks)
  • CONTRIBUTING.md (1 hunks)
  • STATS.md (1 hunks)
  • STYLE_GUIDE.md (1 hunks)
  • nix/hashes.json (1 hunks)
  • packages/console/app/package.json (1 hunks)
  • packages/console/app/src/routes/workspace/[id]/graph-section.tsx (6 hunks)
  • packages/console/core/package.json (1 hunks)
  • packages/console/function/package.json (1 hunks)
  • packages/console/mail/package.json (1 hunks)
  • packages/desktop/package.json (1 hunks)
  • packages/desktop/src/components/prompt-input.tsx (1 hunks)
  • packages/enterprise/package.json (1 hunks)
  • packages/extensions/zed/extension.toml (2 hunks)
  • packages/function/package.json (1 hunks)
  • packages/opencode/package.json (2 hunks)
  • packages/opencode/script/build.ts (4 hunks)
  • packages/opencode/src/agent/agent.ts (2 hunks)
  • packages/opencode/src/cli/cmd/models.ts (1 hunks)
  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (2 hunks)
  • packages/opencode/src/config/config.ts (5 hunks)
  • packages/opencode/src/env/index.ts (1 hunks)
  • packages/opencode/src/provider/models.ts (2 hunks)
  • packages/opencode/src/provider/provider.ts (22 hunks)
  • packages/opencode/src/provider/transform.ts (7 hunks)
  • packages/opencode/src/server/server.ts (6 hunks)
  • packages/opencode/src/session/compaction.ts (4 hunks)
  • packages/opencode/src/session/index.ts (8 hunks)
  • packages/opencode/src/session/processor.ts (6 hunks)
  • packages/opencode/src/session/prompt.ts (14 hunks)
  • packages/opencode/src/session/retry.ts (1 hunks)
  • packages/opencode/src/session/summary.ts (4 hunks)
  • packages/opencode/src/session/system.ts (1 hunks)
  • packages/opencode/src/share/share-next.ts (3 hunks)
  • packages/opencode/src/tool/batch.ts (1 hunks)
  • packages/opencode/src/tool/read.ts (1 hunks)
  • packages/opencode/src/tool/registry.ts (2 hunks)
  • packages/opencode/src/tool/task.ts (3 hunks)
  • packages/opencode/test/preload.ts (1 hunks)
  • packages/opencode/test/provider/provider.test.ts (1 hunks)
  • packages/opencode/test/provider/transform.test.ts (1 hunks)
  • packages/plugin/package.json (1 hunks)
  • packages/sdk/js/package.json (1 hunks)
  • packages/slack/package.json (1 hunks)
  • packages/tauri/package.json (1 hunks)
  • packages/ui/package.json (1 hunks)
  • packages/util/package.json (1 hunks)
  • packages/web/package.json (1 hunks)
  • packages/web/src/content/docs/1-0.mdx (0 hunks)
  • packages/web/src/content/docs/keybinds.mdx (1 hunks)
  • sdks/vscode/package.json (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Upstream Sync] Merge conflict with v1.0.130

10 participants