Uh oh!
There was an error while loading. Please reload this page.
fix(devcontainer): persist source override across workspace restarts - #744
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 |
Uh oh!
There was an error while loading. Please reload this page.
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