-
Notifications
You must be signed in to change notification settings - Fork 3
Integration #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration #32
Conversation
PATCH /config hot-reload w/ selective cache invalidation
* Fix cache corruption bug in refresh function
* adding favorite model picker
Resolved conflicts by taking add-model-favorites version: - nix/hashes.json: use hash from add-model-favorites - dialog-model.tsx: use version from add-model-favorites (includes .slice(0,5) for recents, removes unused ModelValue interface and Free component)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx (1)
205-211: Guard favorite toggle to only operate on model entries.The ctrl+f keybind handler casts
option.valueto{ providerID: string; modelID: string }without verification. When!connected(), provider options from lines 180-191 are included with a different value shape. Hitting ctrl+f on a provider option will cause a runtime error or corrupt favorites.Apply the type guard suggested in the previous review to prevent this:
{ keybind: Keybind.parse("ctrl+f")[0], title: "Favorite", onTrigger: (option) => { + const value = option.value as any + if ( + !value || + typeof value.providerID !== "string" || + typeof value.modelID !== "string" + ) { + return + } - local.model.toggleFavorite(option.value as { providerID: string; modelID: string }) + local.model.toggleFavorite(value) }, },Based on past review comments.
packages/opencode/src/cli/cmd/tui/context/local.tsx (1)
130-138: Add error handling for file write operations.The
save()function callsBun.write()without handling promise rejection. If the write fails (disk full, permissions, I/O errors), the failure will be silent, leading to potential data loss without user feedback.Apply this diff to add error handling:
function save() { Bun.write( file, JSON.stringify({ recent: modelStore.recent, favorite: modelStore.favorite, }), - ) + ).catch((error) => { + toast.show({ + variant: "error", + message: `Failed to save model preferences: ${error.message}`, + duration: 5000, + }) + }) }Based on past review comments.
🧹 Nitpick comments (3)
UPSTREAM-SYNC-PLAN.md (2)
9-19: Add language specifier to code block.The ASCII diagram block at line 9 should explicitly specify a language (e.g.,
text) to comply with markdown linting standards.-``` +```text integration (DEFAULT) ← Your working branch, custom features, workflow configs ↑ │ merge │ dev (MIRROR) ← Read-only mirror of upstream release tags ↑ │ hard reset │ upstream/tags ← sst/opencode release tags -``` +```
265-327: Add language specifier to ASCII diagram code block.The workflow diagram at line 265 should explicitly specify a language (e.g.,
text) to comply with markdown linting standards.-``` +```text ┌─────────────────┐ │ Schedule/Manual │ ... [Workflow End] -``` +```packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx (1)
28-54: Consider extracting ordering logic into helper functions.The ordering logic for
orderedRecents,orderedFavorites, andorderedRecentListis correct but dense. Extracting these into named helper functions would improve readability and testability.Example refactor:
function orderWithCurrentFirst<T extends { providerID: string; modelID: string }>( items: T[], current: { providerID: string; modelID: string } | undefined ): T[] { if (!current) return items return [ ...items.filter(item => isCurrent(item, current)), ...items.filter(item => !isCurrent(item, current)) ] } function isCurrent( item: { providerID: string; modelID: string }, current: { providerID: string; modelID: string } ) { return item.providerID === current.providerID && item.modelID === current.modelID }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
UPSTREAM-SYNC-PLAN.md(1 hunks)packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx(6 hunks)packages/opencode/src/cli/cmd/tui/context/local.tsx(4 hunks)packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,jsx,ts,tsx}: DO NOT do unnecessary destructuring of variables
DO NOT useelsestatements unless necessary
DO NOT usetry/catchif it can be avoided
AVOIDtry/catchwhere possible
AVOIDletstatements
PREFER single word variable names where possible
Use as many Bun APIs as possible like Bun.file()
Files:
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsxpackages/opencode/src/cli/cmd/tui/context/local.tsxpackages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
AVOID using
anytype
Files:
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsxpackages/opencode/src/cli/cmd/tui/context/local.tsxpackages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
packages/opencode/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
Use Bun with TypeScript ESM modules as the runtime environment
Files:
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsxpackages/opencode/src/cli/cmd/tui/context/local.tsxpackages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
packages/opencode/**/*.{ts,tsx}
📄 CodeRabbit inference engine (packages/opencode/AGENTS.md)
packages/opencode/**/*.{ts,tsx}: Use relative imports for local modules with named imports preferred
Use Zod schemas for validation
Use TypeScript interfaces for defining data structures
Use camelCase for variable and function names
Use PascalCase for class and namespace names
Use Result patterns for error handling; avoid throwing exceptions in tools
Organize code using namespace-based structure (e.g.,Tool.define(),Session.create())
PasssessionIDin tool context and useApp.provide()for dependency injection
Validate all inputs with Zod schemas
UseLog.create({ service: "name" })pattern for logging
UseStoragenamespace for data persistence
Files:
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsxpackages/opencode/src/cli/cmd/tui/context/local.tsxpackages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
🧬 Code graph analysis (1)
packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx (1)
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx (1)
filter(149-151)
🪛 LanguageTool
UPSTREAM-SYNC-PLAN.md
[uncategorized] ~333-~333: The official name of this software platform is spelled with a capital “H”.
Context: ... Files to Create/Modify 1. Create: .github/workflows/upstream-sync.yml - Main wor...
(GITHUB)
[uncategorized] ~335-~335: The official name of this software platform is spelled with a capital “H”.
Context: ...onflict detection helper 3. Create: .github/last-synced-tag - Tracks last synced u...
(GITHUB)
[uncategorized] ~336-~336: The official name of this software platform is spelled with a capital “H”.
Context: ...ced upstream release tag 4. Create: `.github/ISSUE_TEMPLATE/upstream-sync-conflict.m...
(GITHUB)
[uncategorized] ~355-~355: The official name of this software platform is spelled with a capital “H”.
Context: ...Actions run history + commit messages + .github/last-synced-tag | --- ## Risks and M...
(GITHUB)
🪛 markdownlint-cli2 (0.18.1)
UPSTREAM-SYNC-PLAN.md
9-9: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
265-265: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: update
🔇 Additional comments (5)
UPSTREAM-SYNC-PLAN.md (2)
331-338: Note: Ignore false-positive GitHub capitalization warnings.Static analysis tools flagged
.github/paths for capitalization, but this is incorrect. The.github/directory is GitHub's reserved path and must be lowercase by convention. The current formatting is correct.
1-327: Comprehensive upstream sync pipeline blueprint.This document provides a well-structured, phased approach to automating upstream synchronization while preserving custom features. The workflow architecture (4-phase design with tag detection, conflict auto-resolution, post-merge validation, and issue reporting) is sound and operationally complete.
Key strengths:
- Clear branch architecture (dev as read-only mirror, integration as default)
- Intelligent conflict-resolution strategies (lock file regeneration, categorized handling)
- Robust failure modes (issue creation, validation gates)
- Practical runbooks for manual intervention
- Comprehensive risk mitigations
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx (1)
240-240: LGTM! Improved keybind bar spacing.The increased gap improves visual clarity for the keybind items in the bottom bar.
packages/opencode/src/cli/cmd/tui/context/local.tsx (2)
228-254: LGTM! Well-implemented favorite cycling.The
cycleFavoritefunction correctly handles:
- Filtering invalid favorites before cycling
- User feedback when no favorites exist
- Wrap-around navigation in both directions
- Deduplication and size limiting of the recent list
- Persistence via
save()
274-293: LGTM! Robust favorite toggle implementation.The
toggleFavoritefunction properly validates the model before mutation, provides user feedback for invalid models, and correctly toggles the favorite state with proper filtering logic and persistence.
020ee56 to
83c47e0
Compare
Resolved conflicts: - packages/opencode/src/config/config.ts: Keep plugin path resolution helpers, add debug logging - packages/opencode/test/config/config.test.ts: Keep comprehensive tests with Global.Path.config mocking Closes #39
|
/oc rerun with fork action |
|
/oc retry with local build |
|
/oc retry with bun runner |
|
/oc retry after app install |
|
The repository is on the
The Since there's no specific task in the comment beyond "retry after app install", this appears to be a test to verify that:
All of these are working correctly. The workflow has successfully executed and I (opencode) am now running and able to interact with the repository. Is there a specific task you'd like me to perform? |

Summary by CodeRabbit
New Features
Bug Fixes
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.