Skip resize + chromium restart when display already matches#255
Open
masnwilliams wants to merge 2 commits into
Open
Skip resize + chromium restart when display already matches#255masnwilliams wants to merge 2 commits into
masnwilliams wants to merge 2 commits into
Conversation
PatchDisplay and the multipart Configure both unconditionally proceeded through xrandr/xvfb resize plus a chromium restart even when the requested width/height/refresh-rate already matched the current display state. Detect the no-op case and return success immediately — skipping the idle check, recording stop, resize, and restart. Extract the merge logic into resolveDisplayParams so both handlers share one definition of "the request changes nothing." Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR modifies VM-side display handling logic, not kernel API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal); the companion API-side changes mentioned are in a separate PR. To monitor this PR anyway, reply with |
hiroTamada
approved these changes
May 28, 2026
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
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
VM-side companion to the API-side short-circuit. Both
PatchDisplayand the multipartChromiumConfigure(when display is the only thing in the request) currently proceed through the full xrandr/xvfb resize plus a chromium restart even when the requested width/height/refresh-rate already match the current display state. This change detects the no-op and returns success immediately — skipping the idle check, recording stop, resize, and restart.Sister PR on the API side: kernel/kernel#2233 (skips the configure call entirely when the request matches the pool image default). This PR catches the same case from the VM side, plus any caller that passes a non-default-but-already-current viewport.
Changes
resolveDisplayParamssoPatchDisplayandchromiumPrepareDisplayshare one definition of "the request changes nothing."PatchDisplayreturns 200 immediately whenchanged == false.chromiumPrepareDisplayreturns a nil plan, which the caller already handles as skip-apply.Test plan
go test ./cmd/api/api/— newTestResolveDisplayParamscovers matching dims with and without refresh-rate, mismatched width, refresh-rate-only mismatch, partial body, and nil bodyPatchDisplay {width:1920,height:1080}to an instance launched at 1920x1080, confirm no chromium restart in supervisor logs and no xrandr/xvfb activityNote
Low Risk
Targeted early-return on display APIs with unit tests; avoids disruptive side effects on no-op requests rather than changing resize semantics when values differ.
Overview
Adds a VM-side no-op path when display resize requests already match the current width, height, and refresh rate, so callers avoid idle checks, recording stops, xrandr/Xvfb work, and Chromium restarts.
resolveDisplayParamscentralizes merging the request with current display state and sets achangedflag when any of those fields would differ.PatchDisplayreturns 200 immediately when nothing would change;chromiumPrepareDisplayreturns a nil plan so configure skips display apply (existing behavior for nil plans).TestResolveDisplayParamscovers matching/mismatch cases, partial body fields, and nil body.Reviewed by Cursor Bugbot for commit 1ae4afa. Bugbot is set up for automated code reviews on this repo. Configure here.