Skip to content

⚡ Bolt: Skip unnecessary polling and DB writes for terminal sessions - #67

Open
parvezk wants to merge 1 commit into
mainfrom
bolt-skip-terminal-session-updates-13482745650273759955
Open

⚡ Bolt: Skip unnecessary polling and DB writes for terminal sessions#67
parvezk wants to merge 1 commit into
mainfrom
bolt-skip-terminal-session-updates-13482745650273759955

Conversation

@parvezk

@parvezk parvezk commented Jul 26, 2026

Copy link
Copy Markdown
Owner

💡 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 (completed or failed) 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

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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
polyagent Ready Ready Preview, Comment Jul 26, 2026 8:35am

@cursor

cursor Bot commented Jul 26, 2026

Copy link
Copy Markdown

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.

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.

1 participant