⚡ Bolt: Skip unnecessary polling and DB writes for terminal sessions - #67
⚡ Bolt: Skip unnecessary polling and DB writes for terminal sessions#67parvezk wants to merge 1 commit into
Conversation
This commit prevents redundant network calls and disk/database writes by checking if a session has already reached a terminal state (`completed` or `failed`). - In `src/commands/status.ts`: Skipped calling external adapters and writing to state if terminal. - In `web/app/api/sessions`: Skipped patching the database with identical terminal states, while still retrieving the unpersisted `summary` field. - In `web/components/session-drawer.tsx`: Removed an unnecessary `useEffect` lifecycle that triggered cascading re-renders when switching sessions, using a render-phase state update instead. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
💡 What: Added early exit conditions for database writes and external API calls when querying session states, and removed an unnecessary React
useEffect.🎯 Why: Sessions in a terminal state (
completedorfailed) do not change status, meaning continuous disk and database writes are redundant and waste resources. For the CLI, network polling can be skipped entirely.📊 Impact: Reduces unnecessary disk I/O, database writes, and external API requests for finished sessions, leading to a faster and less expensive polling loop. Reduces React component re-renders when toggling between sessions.
🔬 Measurement: Inspect the local state JSON file or database query logs during polling to see fewer updates for terminal sessions.
PR created automatically by Jules for task 13482745650273759955 started by @parvezk