Skip to content

Comments

Claude/optimize nextjs orchestration 9hn bh#44

Merged
agenticassets merged 6 commits intomainfrom
claude/optimize-nextjs-orchestration-9hnBH
Jan 27, 2026
Merged

Claude/optimize nextjs orchestration 9hn bh#44
agenticassets merged 6 commits intomainfrom
claude/optimize-nextjs-orchestration-9hnBH

Conversation

@agenticassets
Copy link
Collaborator

@agenticassets agenticassets commented Jan 27, 2026

Note

Optimizes server and client performance, reduces request latency, and improves resiliency across auth, tasks, and UI.

  • Non-blocking cleanups: use next/server.after to revoke OAuth tokens on signout and to stop sandboxes after PR merge
  • Broader API parallelization: fetch DB records, Octokit clients, params/body, and related resources concurrently in task routes (close-pr, reopen-pr, file-content, files, pr, merge-pr, continue, start-sandbox)
  • Token and auth hardening: add lib/github/validate-token with 5‑min LRU cache; consistently verify Octokit auth and improve 401/404 handling
  • Sandbox reliability & speed: parallel git/config checks, faster dependency detection/installation, concurrent process cleanup on shutdown, and earlier port detection
  • UI/runtime perf: introduce use-window-resize and use-latest hooks, memoization/startTransition tweaks, contentVisibility hints, dynamic import of heavy panes, replace <img> with next/image, and wrap Vercel analytics in VercelMetrics
  • Misc: refine redaction in logging, adjust optimizePackageImports, version localStorage keys, minor API polish in GitHub repos route

Written by Cursor Bugbot for commit fe3d571. Configure here.

claude and others added 6 commits January 27, 2026 08:05
…ce bundle size

Performance optimizations:
- Parallelize 3 independent user data fetches in start-sandbox route (~1200ms savings)
- Parallelize 5 sequential pkill commands in sandbox shutdown (~1000ms savings)
- Parallelize file existence checks and git config in sandbox creation (~600ms savings)
- Parallelize GitHub stars fetch with session in task page (~300ms savings)
- Run port detection in parallel with branch name polling in process-task (~400ms savings)
- Parallelize Claude CLI version/help diagnostic checks (~200ms)
- Parallelize sequential logger status/progress updates

Bundle size optimizations:
- Convert 10 client component value imports to `import type` for db/schema types,
  preventing potential leakage of drizzle-orm/pg-core into client bundle
- Dynamically import 5 heavy components in task-details.tsx (FileBrowser 1879 lines,
  TaskChat 1258 lines, FileDiffViewer 410 lines + @git-diff-view, CreatePRDialog,
  MergePRDialog) to reduce initial JS bundle
- Replace unused @radix-ui/react-icons with sonner and jotai in optimizePackageImports

https://claude.ai/code/session_01UHwJudy8YT9Ad258tFTkcv
CRITICAL - Waterfalls & Bundle:
- Parallelize 8 additional API route async operations (Promise.all)
- Defer Vercel Analytics/SpeedInsights after hydration (dynamic import)

HIGH - Server-Side Performance:
- Add React.cache() to 4 data fetching modules (user-token, client, user-keys, settings)
- Move sandbox cleanup and OAuth revocation to after() for non-blocking responses
- Add LRU cache for GitHub token validation (5min TTL, 100 entries)

MEDIUM-HIGH - Client-Side Data Fetching:
- Add passive flag to scroll event listeners (logs-pane, task-chat)
- Version localStorage keys with app:v1: prefix for migration support
- Centralize window resize listener into useWindowResize hook (5 components)

MEDIUM - Re-render Optimization:
- Remove useMemo for trivial ternary expression (file-editor theme)
- Fix useEffect dependency on repos array (task-form)
- Consolidate 4 duplicate effects into 1 (task-chat)
- Add startTransition for non-urgent auto-refresh updates
- Replace JSON.stringify dependency with ref-based array comparison

MEDIUM - Rendering Performance:
- Add content-visibility: auto for logs, task list, and file tree
- Wrap animated SVG icons in div wrappers (sub-agent-indicator)

LOW-MEDIUM - JavaScript Performance:
- Hoist 9 regex patterns to module level in logging utility

LOW - Advanced Patterns:
- Create useLatest hook for stable callback refs
- Stabilize keyboard and resize event handlers with useLatest

https://claude.ai/code/session_01UHwJudy8YT9Ad258tFTkcv
…-review-03b2

Deployment readiness review
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
aa-coding-agent Ready Ready Preview, Comment Jan 27, 2026 5:17pm

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@agenticassets agenticassets merged commit ca52a1b into main Jan 27, 2026
3 checks passed
@agenticassets agenticassets deleted the claude/optimize-nextjs-orchestration-9hnBH branch January 27, 2026 22:56
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.

3 participants