Merge shuvcode-dev: upstream v1.1.6 sync, grep streaming, spinner and PWA fixes #279
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
Changes
Features
Fixes
fix(grep): Stream ripgrep output to prevent memory exhaustion on large codebasesfix: Show spinner for running tool calls and subagent tasksfix(pwa): Lock viewport on iOS to prevent overscroll bouncefix(bedrock): Handle bundled AWS SDK export shapes from Bunfix: Resolve TypeScript errors in theme.tsx and prompt.tsRefactoring
Breaking Changes
None
Testing
Greptile Summary
This PR merges upstream v1.1.6 and includes critical bug fixes for memory exhaustion, iOS PWA viewport issues, and AWS SDK bundling compatibility.
Key Changes:
Grep streaming optimization (PR fix(grep): stream ripgrep output to prevent memory exhaustion anomalyco/opencode#5432): Refactored
grep.tsto stream ripgrep output instead of buffering all results in memory. Implements proper line-ending handling (Unix/Windows), early process termination at MATCH_LIMIT (100), and prevents memory exhaustion on large codebases.New truncation system: Introduced
truncation.tswith configurable limits (2000 lines, 50KB bytes) and head/tail direction support. Integrated into tool execution wrapper (tool.ts) to automatically truncate all tool outputs.Spinner for running tools: Added visual feedback in TUI for running tool calls and subagent tasks. Properly tracks
status === "running"and displays animated spinner in primary theme color.iOS PWA viewport locking: Fixed rubber-banding/overscroll bounce in PWA standalone mode by applying
position:fixedandoverscroll-behavior:noneto html/body/root elements. Scoped correctly to@media (display-mode: standalone).AWS SDK bundling fix: Resolved Bedrock provider compatibility with Bun bundling by handling multiple export shapes (unbundled,
default.fn,default.default.fn) using robust coalescing logic.TypeScript fixes: Resolved errors in
theme.tsx(usingonMountinstead ofcreateEffectfor initialization) andprompt.ts(import cleanup).Console billing infrastructure: Added Stripe webhook handlers for checkout completion, subscription lifecycle, payment methods, and refunds.
Upstream v1.1.6 sync: Includes permission enhancements with
PermissionNext, Zed extension updates, and desktop Tauri entitlements.Test Coverage:
Excellent test coverage added for:
amazon-bedrock.test.ts)truncation.test.ts)permission-task.test.ts)Fork Feature Tracking:
Updated
fork-features.jsonwith regression prevention markers for grep streaming and spinner implementation to help maintain these features during future upstream merges.Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Agent participant GrepTool participant Ripgrep participant TruncationSystem participant UI Note over User,UI: Grep Streaming Fix (PR #5432) User->>Agent: Request code search Agent->>GrepTool: Execute grep(pattern, path) GrepTool->>Ripgrep: spawn([rgPath, ...args]) Note over Ripgrep,GrepTool: Stream output instead of buffering loop Stream chunks until MATCH_LIMIT or done Ripgrep-->>GrepTool: ReadableStream chunk GrepTool->>GrepTool: decoder.decode(value, {stream: true}) GrepTool->>GrepTool: buffer += decoded, split by \r?\n GrepTool->>GrepTool: Parse lines into matches[] alt matches.length >= MATCH_LIMIT GrepTool->>Ripgrep: proc.kill() Note over GrepTool: Early termination saves resources end end GrepTool->>TruncationSystem: Truncate.output(result) TruncationSystem->>TruncationSystem: Check MAX_LINES (2000) & MAX_BYTES (50KB) TruncationSystem-->>GrepTool: {content, truncated: bool} GrepTool-->>Agent: Tool result with metadata Agent->>UI: Display results with spinner Note over UI: Spinner shows for running tools UI->>UI: createMemo(() => part.state.status === "running") UI->>UI: Show spinner in theme.primary color UI-->>User: Results displayed with visual feedback