Skip to content

Keep workspace folders when live configuration overtakes the cache - #8178

Merged
code-asher merged 1 commit into
coder:mainfrom
kyuz0:codex/workspace-initialization
Dec 4, 2026
Merged

code-asher merged 1 commit into
coder:mainfrom
kyuz0:codex/workspace-initialization

Conversation

@kyuz0

@kyuz0 kyuz0 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Keep saved workspace folders when the live configuration finishes between cached workspace creation and its first assignment. The existing late-initialization branch marks the cached snapshot ready without refreshing its folders, leaving Explorer and extensions with an empty workspace.

Extract the normal workspace constructor into one synchronous helper and reuse it in that branch. This keeps folders, transient state, workspace identity and URI handling consistent.

I reproduced the race in code-server 4.146.0 and forced the same callback order in Chromium against the released workbench and the equivalent compiled correction.

Check Result
Empty cached folders overtaken by live configuration Original failed; correction passed
Stale folders and transient state overtaken by live configuration Original failed; correction passed
Already-initialized workspace and callback after assignment Both retained the expected state and object identity
Real browser and extension host Correction delivered both named folders to Explorer and workspaceFolders; the Pi workflow received and rendered its prompt
Patch application Complete patch applied to the pinned VS Code files with zero fuzz
Corrected release module node --check passed

The maintained browser regression gates the real cached/live reads without replacing the snapshot or retrying the page.

The full source build and upstream test suite were not run.

@kyuz0
kyuz0 marked this pull request as ready for review December 1, 2026 20:01
@kyuz0
kyuz0 requested a review from a team as a code owner December 1, 2026 20:01

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense thank you!

@code-asher
code-asher merged commit 80246c7 into coder:main Dec 4, 2026
10 checks passed
fengwk added a commit to fengwk/code-server that referenced this pull request Dec 4, 2026
Take upstream coder#8178 for the workspace initialization race; it supersedes the
kk-studio refresh in local-storage.diff. Keep the upstream CI files that
kk-studio removed.
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.

2 participants