fix(devcontainer): persist source override across workspace restarts#744
Merged
Conversation
The container image devcontainer override (--devcontainer image:<ref>) was passed only as a transient CLI option and never persisted to the workspace record. On restart the flag was absent, so the agent fell back to filesystem discovery and failed with "multiple devcontainer configurations found" when the repo contained more than one config. Persist DevContainerSource on the workspace and reuse it in getRawConfig when the CLI option is absent, so restarts reproduce the first-launch behavior.
✅ Deploy Preview for devsydev canceled.
|
✅ Deploy Preview for images-devsy-sh canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughWorkspace devcontainer source overrides now propagate through workspace resolution, persist in workspace metadata, and apply during configuration loading with CLI values taking precedence over persisted values. ChangesDevcontainer source override flow
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant WorkspaceResolver
participant WorkspaceConfig
participant DevcontainerConfig
CLI->>WorkspaceResolver: provide DevContainerSource
WorkspaceResolver->>WorkspaceConfig: persist source override
WorkspaceConfig-->>DevcontainerConfig: provide persisted source
CLI->>DevcontainerConfig: provide optional CLI source
DevcontainerConfig->>DevcontainerConfig: prefer CLI source, otherwise persisted source
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
skevetter
marked this pull request as ready for review
July 25, 2026 00:01
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
When the container image devcontainer override is selected (e.g.
--devcontainer image:<ref>), the workspace launches correctly the first time but fails to launch after a stop/restart with:Root cause
The override arrives as the transient CLI option
DevContainerSource. On the firstup, the agent takes the "ignore the project devcontainer, synthesize a config from just this image" branch. ButDevContainerSourcewas never persisted to the workspace record (unlikeDevContainerImage/DevContainerPath). On restart the desktop re-invokesupwith only the workspace id and no--devcontainerflag, so the override is lost and the agent falls through to filesystem discovery, which errors on repos that contain multiple.devcontainer/<id>/configs.Fix
DevContainerSourcefield to theWorkspacestruct.ResolveParamsand persist it inapplyDevContainerOverrides.buildWorkspaceOptions(proxy/daemon paths).getRawConfigfall back to the persistedWorkspace.DevContainerSourcewhen the CLI option is absent — this covers the local/docker machine-client path, which does not go throughbuildWorkspaceOptionsbut always receives the serializedWorkspace. The CLI option still wins when present.Persisting the source (rather than converting
image:<ref>into the existingDevContainerImagefield) preserves the "ignore the project devcontainer" semantics;DevContainerImageonly overrides the image inside a discovered config and would still require discovery.Added regression tests for the restart scenario, CLI-over-persisted precedence, and source persistence.
Summary by CodeRabbit
New Features
Bug Fixes