Skip to content

Conversation

@shuv1337
Copy link
Collaborator

@shuv1337 shuv1337 commented Dec 4, 2025

Summary

  • Merges upstream sst/opencode v1.0.133 changes into the shuvcode fork
  • Resolves merge conflicts in 3 files while preserving fork-specific customizations

Conflict Resolutions

  • github/action.yml: Merged both - kept fork-specific OPENCODE_BIN_PATH and added upstream PROMPT env var
  • prompt/index.tsx: Merged both - kept our text getter and added upstream current getter to PromptRef type
  • session/index.tsx: Merged both - kept bash output view, search mode, initialValue prop, and integrated upstream promptRef.set() call

Closes #86

Summary by CodeRabbit

Release Notes v1.0.133

  • New Features

    • Sticky provider selection maintains AI provider choice across sessions.
    • Custom prompt override support for GitHub Actions workflows.
    • Added CodeCompanion.nvim integration for auto-completion.
    • SAP AI Core provider now supported.
  • Documentation

    • Added GitHub Actions custom prompt configuration guide.
    • New CodeCompanion.nvim setup instructions.
    • SAP AI Core provider documentation.

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

code-yeongyu and others added 24 commits December 3, 2025 22:28
Co-authored-by: Github Action <action@github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Co-authored-by: Github Action <action@github.com>
Co-authored-by: Dax Raad <d@ironbay.co>
Resolved conflicts:
- github/action.yml: merged both - kept fork-specific OPENCODE_BIN_PATH and added upstream PROMPT env var
- packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx: merged both - kept our 'text' getter and added upstream 'current' getter to PromptRef
- packages/opencode/src/cli/cmd/tui/routes/session/index.tsx: merged both - kept bash output view, search mode, initialValue prop, and integrated upstream promptRef.set()
@shuv1337 shuv1337 merged commit 5e8b15c into integration Dec 4, 2025
5 of 6 checks passed
@shuv1337 shuv1337 deleted the opencode/issue86-20251204220607 branch December 4, 2025 22:11
@coderabbitai
Copy link

coderabbitai bot commented Dec 4, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This release bumps versions from v1.0.132 to v1.0.133 and introduces sticky provider session persistence, custom prompt support via environment variables and GitHub Actions configuration, refactors TUI prompt state preservation across routes, and updates provider/model data assembly with explicit aliasing and async loader handling.

Changes

Cohort / File(s) Change Summary
Version Bumps
packages/console/app/package.json, packages/console/core/package.json, packages/console/function/package.json, packages/console/mail/package.json, packages/desktop/package.json, packages/enterprise/package.json, packages/function/package.json, packages/opencode/package.json, packages/plugin/package.json, packages/sdk/js/package.json, packages/slack/package.json, packages/tauri/package.json, packages/ui/package.json, packages/util/package.json, packages/web/package.json, sdks/vscode/package.json, .github/last-synced-tag, packages/opencode/src/global/index.ts
Version bumped from 1.0.132 to 1.0.133 across all package manifests and tags. Cache version also incremented.
GitHub Actions & Workflow
.github/workflows/review.yml, github/action.yml
Refactored review workflow trigger from pull_request_target to issue_comment-based gating requiring "/review" comment from OWNER/MEMBER; added optional prompt input to action.yml and forwarded as PROMPT environment variable. Changed runner to blacksmith-4vcpu-ubuntu-2404 and removed permission-check API call.
Sticky Provider Feature
packages/console/app/src/routes/zen/util/handler.ts, packages/console/app/src/routes/zen/util/stickyProviderTracker.ts (new), packages/console/core/src/model.ts
Added createStickyTracker() utility for session-based KV persistence of provider selection with 24-hour TTL. Integrated into handler to retrieve sticky provider at request start and store after successful selection. Extended ModelSchema with optional stickyProvider boolean field.
CLI Prompt Override
packages/opencode/src/cli/cmd/github.ts
Added PROMPT environment variable check in GithubRunCommand to short-circuit normal prompt construction when set.
TUI Prompt State Management
packages/opencode/src/cli/cmd/tui/app.tsx, packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx, packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx, packages/opencode/src/cli/cmd/tui/context/prompt.tsx (new), packages/opencode/src/cli/cmd/tui/context/route.tsx, packages/opencode/src/cli/cmd/tui/routes/home.tsx, packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Added PromptRefProvider/usePromptRef context for tracking prompt instance across routes. Updated PromptRef type with current: PromptInfo field; changed cursor color from theme.primary to theme.text. Home route now accepts optional initialPrompt and prefills prompt from route data. Autocomplete now synchronizes prompt state post-selection and post-hide.
Provider & Model Refactoring
packages/opencode/src/provider/provider.ts, packages/opencode/src/session/prompt.ts, packages/opencode/src/tool/read.ts
Explicit existingModel aliasing for clearer fallback sourcing in model assembly. Added SAP AI Core provider loader. Changed model field sourcing to use modelsDev data. Converted synchronous loader calls to awaited async calls. Updated session prompt Read tool to pass model via nested extra: { model } instead of spread. Simplified read.ts to use ctx.extra?.model directly instead of async Provider.getModel.
Tool & Worker Updates
packages/opencode/src/tool/bash.ts, packages/opencode/src/cli/cmd/tui/worker.ts
Bash tool now collects truncation/timeout/abort metadata in array and appends as standardized block to output. Worker now passes InstanceBootstrap to Instance.provide during upgrade checks.
Documentation & Testing
packages/web/src/content/docs/acp.mdx, packages/web/src/content/docs/github.mdx, packages/web/src/content/docs/providers.mdx, packages/web/src/content/docs/github-acp.txt, packages/opencode/test/provider/provider.test.ts
Added CodeCompanion.nvim integration example to ACP docs. Documented custom prompt field in GitHub config. Added SAP AI Core provider setup guidance (note: appears duplicated). Added test case validating custom model npm inheritance from models.dev config.
Plugin Versions
packages/opencode/src/plugin/index.ts
Bumped default plugin versions: opencode-copilot-auth 0.0.7→0.0.8, opencode-anthropic-auth 0.0.3→0.0.4.
Stats
STATS.md
Added 2025-12-04 download stats row.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Handler
    participant StickyTracker as Sticky<br/>Tracker
    participant KV as Gateway KV
    participant Provider as Provider<br/>Selection

    User->>Handler: Request with session ID
    Handler->>StickyTracker: createStickyTracker(enabled, sessionId)
    StickyTracker->>KV: Get sticky:${sessionId}
    KV-->>StickyTracker: Return cached provider ID (or null)
    StickyTracker-->>Handler: Return tracker instance
    
    alt Cached Provider Available
        Handler->>Provider: selectProvider(..., stickyProvider)
        Provider-->>Handler: Use cached provider
    else No Cache or Retry
        Handler->>Provider: selectProvider with normal logic
        Provider-->>Handler: Selected provider ID
        Handler->>StickyTracker: Store provider selection
        StickyTracker->>KV: Put sticky:${sessionId} → providerId (TTL: 24h)
        KV-->>StickyTracker: Stored
    end

    Handler-->>User: Response with provider
Loading
sequenceDiagram
    participant User
    participant Session as Session<br/>Action
    participant PromptRef as PromptRef<br/>Context
    participant Route as Router
    participant Home as Home Route

    User->>Session: Trigger "New session"
    Session->>PromptRef: usePromptRef()
    PromptRef-->>Session: promptRef instance
    Session->>PromptRef: Read promptRef.current.current.input
    PromptRef-->>Session: Current prompt text
    
    alt Prompt Input Exists
        Session->>Route: Navigate to home with initialPrompt
        Route->>Home: Provide route data
        Home->>Home: onMount: prefill from route.initialPrompt
    else Empty Prompt
        Session->>Route: Navigate to home (no initialPrompt)
        Route->>Home: Provide route data
        Home->>Home: onMount: fallback to args.prompt
    end
    
    Home-->>User: Display home with prefilled prompt
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Areas requiring extra attention:

  • packages/opencode/src/provider/provider.ts — Significant refactoring of model data assembly with explicit existingModel aliasing, addition of SAP AI Core provider, conversion of synchronous to asynchronous loader calls, and changes to how modelsDev data is sourced. Requires careful validation of model field precedence and async flow.
  • Sticky provider integration — Verify KV storage setup, TTL handling, and provider selection short-circuit logic in handler.ts; ensure stickyProviderTracker correctly constructs and manages keys.
  • TUI prompt state propagation — Confirm PromptRef context properly wires through all route transitions, prompt synchronization in autocomplete post-selection, and initialPrompt routing in home/session routes.
  • GitHub Actions workflow change — Validate the new issue_comment trigger correctly gates on "/review" prefix and proper OWNER/MEMBER associations.

Possibly related PRs

  • Merge Dev into Integration #30 — Modifies overlapping TUI components (packages/opencode/src/cli/cmd/tui/app.tsx and prompt/index.tsx) with similar state management patterns.
  • sync: merge upstream v1.0.130 #81 — Updates the same GitHub Actions workflow (.github/workflows/review.yml) and repository metadata (.github/last-synced-tag).
  • Integration #32 — Refactors packages/opencode/src/provider/provider.ts with overlapping model loading and parsing logic changes.

Poem

🐰 A sticky hop through sessions bright,
Prompts preserved in contextual flight,
Providers cached with TTL grace,
Prompts tracked throughout the TUI space—
One-three-three hops along, we race! 🚀

✨ 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/issue86-20251204220607

📜 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 2b44c14 and d953c4b.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (44)
  • .github/last-synced-tag (1 hunks)
  • .github/workflows/review.yml (1 hunks)
  • STATS.md (1 hunks)
  • github/action.yml (2 hunks)
  • packages/console/app/package.json (1 hunks)
  • packages/console/app/src/routes/zen/util/handler.ts (4 hunks)
  • packages/console/app/src/routes/zen/util/stickyProviderTracker.ts (1 hunks)
  • packages/console/core/package.json (1 hunks)
  • packages/console/core/src/model.ts (1 hunks)
  • packages/console/function/package.json (1 hunks)
  • packages/console/mail/package.json (1 hunks)
  • packages/desktop/package.json (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 (1 hunks)
  • packages/opencode/src/cli/cmd/github.ts (1 hunks)
  • packages/opencode/src/cli/cmd/tui/app.tsx (4 hunks)
  • packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx (2 hunks)
  • packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx (4 hunks)
  • packages/opencode/src/cli/cmd/tui/context/prompt.tsx (1 hunks)
  • packages/opencode/src/cli/cmd/tui/context/route.tsx (1 hunks)
  • packages/opencode/src/cli/cmd/tui/routes/home.tsx (3 hunks)
  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx (3 hunks)
  • packages/opencode/src/cli/cmd/tui/worker.ts (2 hunks)
  • packages/opencode/src/global/index.ts (1 hunks)
  • packages/opencode/src/plugin/index.ts (1 hunks)
  • packages/opencode/src/provider/provider.ts (4 hunks)
  • packages/opencode/src/session/prompt.ts (2 hunks)
  • packages/opencode/src/tool/bash.ts (1 hunks)
  • packages/opencode/src/tool/bash.txt (1 hunks)
  • packages/opencode/src/tool/read.ts (1 hunks)
  • packages/opencode/test/provider/provider.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/acp.mdx (1 hunks)
  • packages/web/src/content/docs/github.mdx (2 hunks)
  • packages/web/src/content/docs/providers.mdx (1 hunks)
  • sdks/vscode/package.json (1 hunks)

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

@opencode-agent opencode-agent bot restored the opencode/issue86-20251204220607 branch December 4, 2025 22:11
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.133