forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 3
Merge shuvcode-dev: upstream v1.0.220 sync, UI improvements, and merged upstream PRs #231
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…o#6481) Co-authored-by: Daniel Smolsky <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
The variant field was accidentally removed during a cherry-pick that fixed plugin commands. This restores variant support in PromptInput, CommandInput, and the corresponding message/command handlers.
Move CORS origin validation to cors.ts for better testability and add support for *.shuv.ai domain alongside *.opencode.ai.
…nvironments - Persist active server selection across sessions (server.v4 storage) - Add WelcomeScreen for hosted environments when server connection fails - Add connection state machine (connecting/ready/needs_config/error) - Add hosted environment detection utilities
Replace O(n²) tree building with O(n) using FileNode class: - Map lookup for O(1) child access during construction - Lazy sorting: only sort nodes visited during BFS - Parent references for bottom-up selection propagation - Comprehensive TSDoc comments explaining BFS and round-robin Performance on 42k file repo: 8,625ms → 79ms 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-authored-by: qio <[email protected]>
Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: David Hill <[email protected]>
…support - Add ctrl+shift+v keybind for Linux clipboard paste - Create parseUriList() helper to handle file:// URIs and text/uri-list format - Update onPaste handler to detect and process file:// URIs as images - Support Wayland and X11 display servers Closes #230
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Merged from sst/opencode v1.0.220. Notable upstream changes: - Desktop: Status bar removed, new elements in header - Desktop: Unified diff toggle in review pane - Core: Configurable CORS hosts - Core: MCP tool call timeout - Core: Model variants support - CLI: New debug agent <name> subcommand - MCP: Prompts as slash commands - Format: rustfmt formatter for Rust files Resolved conflicts: - README.md: Keep fork install instructions - bun.lock: Accept upstream - header.tsx: Keep ours (fork has custom inline header) - status-bar.tsx: Keep ours (fork uses StatusBar component) - layout.tsx (context): Merge both fork review pane + upstream diffStyle - home.tsx: Keep DialogCreateProject (fork feature) - layout.tsx (pages): Keep fork header, remove chooseProject - session.tsx: Keep ours (fork has mobile PWA features) - command/index.ts: Merge fork plugin features + upstream mcp/hints - config.ts: Keep fork validation + add upstream unique() - server.ts: Keep fork CORS via isOriginAllowed - types.gen.ts: Merge both fork aliases + upstream hints
- Re-add Header import and usage in layout.tsx (lost during merge) - Move ThemePicker/FontPicker to only show in mobile sidebar - Desktop now shows header with all buttons (terminal, review, share, theme, font) - Mobile PWA keeps theme/font pickers in sidebar menu
Change MAX_WIDTH_RATIO from 0.33 to 0.5 to allow the review pane to expand to 50% of the screen. Default width remains at 450px.
The previous clamping logic was preventing the session pane from being resized smaller, which blocked the review pane from being made larger. The ResizeHandle component already enforces min/max constraints, so the additional clamping was unnecessary and counterproductive. Removed: - getMinSessionWidth() helper function - clampSessionWidth() function - Window resize listener for clamping - Clamping in session.resize() function
…reens - Use smaller text (text-12-medium) on mobile, normal (text-14-medium) on sm+ - Add truncate and min-w-0 to allow text to shrink - Reduce horizontal padding on mobile (px-2 vs px-3) - Wrap text in span with truncate for proper ellipsis - Add shrink-0 to icons so they don't compress
Replace the Button toggle with the built-in RadioGroup in SessionReview: - Remove local diffSplit state from session store - Use layout.review.diffStyle() and setDiffStyle() for persistence - The toggle now uses the slider-style RadioGroup component like upstream
On small screens (< sm breakpoint): - 'Add Existing' -> 'Existing' - 'Create New' -> 'New' - 'Git Clone' -> 'Clone' Icons remain visible at all sizes.
- Use <bdi> element to isolate text from RTL direction, fixing the ~ appearing at the wrong position - Add click-to-copy functionality with tooltip feedback - Show checkmark icon briefly after copying - Full path is copied (not the shortened ~ version)
…or large repositories (109x faster)
…ested changes before applying
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR merges the shuvcode-dev branch into integration, containing upstream sync to v1.0.220, multiple UI/UX improvements, and locally-merged upstream PRs for enhanced functionality.
Changes
Upstream Sync (v1.0.220)
Locally Merged Upstream PRs
App UI Improvements
New Features from Upstream
opencode debug agent <name>)TUI Enhancements
Fixes
Tests
Breaking Changes
None
Testing
Existing tests cover changes. New tests added for Ripgrep optimization, permission editor, and provider functionality.
Greptile Summary
This PR successfully merges upstream v1.0.220 with three locally-merged upstream PRs and significant UI improvements.
Key Changes
Ripgrep Optimization (PR fix: optimize Ripgrep.tree() for large repositories (109x faster) anomalyco/opencode#6507): Complete rewrite of
Ripgrep.tree()using BFS traversal with round-robin selection and O(1) Map lookups, achieving 109x performance improvement for large repositories (40k+ files)Editable Suggested Changes (PR feat: allow users to edit suggested changes before applying anomalyco/opencode#6476): Users can now modify AI-suggested code edits before applying them. The system tracks user modifications and notifies the agent to prevent rollback attempts. Includes new
PermissionEditormodule and comprehensive test coverageParallel Subtasks & Model Inheritance (PR add command.execute.before hook + allow parallel subtasks + fix model inheritance anomalyco/opencode#6478): Task tool now executes multiple subtasks concurrently and implements proper model inheritance chain (extra → agent → message → default)
UI/UX Improvements:
Provider Enhancements: Model variants now support config-based enabling/disabling with proper merging. Added
@ai-sdk/vercelprovider andgemini-3-flashto fast models listMCP Integration: MCP prompts now available as slash commands with async template support and argument substitution
CORS Configuration: New dedicated CORS module allowing
*.shuv.ai(fork's hosted domain) alongside*.opencode.ai, with proper HTTPS enforcementTest Coverage: Added comprehensive test suites for ripgrep optimization, permission editor, provider transforms, and CORS validation
Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Agent participant EditTool participant Permission participant PermissionEditor participant IDE participant File Note over User,File: PR #6476: Edit Suggested Changes Before Applying User->>Agent: Request code change Agent->>EditTool: execute(old_string, new_string) EditTool->>File: Read current content File-->>EditTool: contentOld EditTool->>EditTool: Calculate contentNew alt permission == "ask" EditTool->>Permission: ask(type="edit", metadata) Note right of EditTool: metadata: {filePath, originalContent, suggestedContent} Permission->>PermissionEditor: canEdit(permission) PermissionEditor-->>Permission: true Permission->>IDE: openDiff(filePath, contentNew) IDE-->>Permission: response Permission->>User: Show diff with editor User->>User: Edit suggested content User->>Permission: Approve with modifications Permission-->>EditTool: result.modified.content EditTool->>EditTool: contentNew = user's content EditTool->>EditTool: userModified = true end EditTool->>File: write(contentNew) EditTool->>EditTool: Compute final diff alt userModified EditTool->>Agent: Return with note about user modifications else EditTool->>Agent: Return with original suggestion applied end Note over User,File: PR #6507: Ripgrep.tree() Optimization (109x faster) User->>Agent: Request file tree Agent->>Ripgrep: tree(cwd, limit) Ripgrep->>Ripgrep: List all files Ripgrep->>Ripgrep: Build tree with O(1) Map lookups Ripgrep->>Ripgrep: BFS traversal with round-robin selection Ripgrep->>Ripgrep: Select up to limit nodes Ripgrep->>Ripgrep: Render selected nodes Ripgrep-->>Agent: Formatted tree string Agent-->>User: Display file structure Note over User,File: PR #6478: Parallel Subtasks & Model Inheritance User->>Agent: Execute task with subtasks Agent->>SessionPrompt: process() SessionPrompt->>SessionPrompt: Filter subtasks from tasks par Execute subtasks in parallel SessionPrompt->>TaskTool: execute(subtask1) TaskTool->>TaskTool: Resolve model (extra > agent > msg > default) TaskTool->>SubAgent1: Run with inherited model and SessionPrompt->>TaskTool: execute(subtask2) TaskTool->>TaskTool: Resolve model (extra > agent > msg > default) TaskTool->>SubAgent2: Run with inherited model end SubAgent1-->>SessionPrompt: result1 SubAgent2-->>SessionPrompt: result2 SessionPrompt-->>User: Combined results