Title: bug: Discovered devcontainers are not marked outdated after configuration changes · Issue #32066 · coder/coder · GitHub
Open Graph Title: bug: Discovered devcontainers are not marked outdated after configuration changes · Issue #32066 · coder/coder
X Title: bug: Discovered devcontainers are not marked outdated after configuration changes · Issue #32066 · coder/coder
Description: Is there an existing issue for this? I have searched the existing issues Current Behavior I am working on a prototype which uses Coder internally and AI discovered that Coder does not detect changes to devcontainer.json in all cases. The...
Open Graph Description: Is there an existing issue for this? I have searched the existing issues Current Behavior I am working on a prototype which uses Coder internally and AI discovered that Coder does not detect change...
X Description: Is there an existing issue for this? I have searched the existing issues Current Behavior I am working on a prototype which uses Coder internally and AI discovered that Coder does not detect change...
Opengraph URL: https://github.com/coder/coder/issues/32066
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: Discovered devcontainers are not marked outdated after configuration changes","articleBody":"### Is there an existing issue for this?\n\n- [x] I have searched the existing issues\n\n### Current Behavior\n\nI am working on a prototype which uses Coder internally and AI discovered that Coder does not detect changes to `devcontainer.json` in all cases. The following bug report has been generated via AI based on the findings it had in its context.\n\n---\n\n### Summary\n\nWhen Coder discovers a Project on disk and adopts its existing devcontainer,\nediting `.devcontainer/devcontainer.json` does not mark the container outdated.\n\nThe same configuration edits are detected when filesystem Project discovery\nis disabled and Coder discovers the container through Docker instead.\n\nRelated feature request: #16424\n\n### Actual behavior\n\nThe devcontainer remains marked current. Its `dirty` field in\n`GET /api/v2/workspaceagents/\u003cagent-id>/containers` remains `false`.\n\nThe initial observation waited 180 seconds without detecting the change.\nShorter, focused probes reproduced the failure repeatedly.\n\nExplicitly rebuilding the devcontainer works and applies the changed\nconfiguration.\n\n### Suspected cause\n\nIn `agent/agentcontainers/api.go`:\n\n1. Filesystem Project discovery creates an entry with a nonempty `ConfigPath`\n and stores it without registering a configuration-change watch:\n [lines 541–565](https://github.com/coder/coder/blob/v2.39.1/agent/agentcontainers/api.go#L541-L565).\n\n2. When Docker container discovery finds that existing entry, it registers\n a watch only if `dc.ConfigPath == \"\" && configFile != \"\"`. Because\n filesystem discovery already populated `ConfigPath`, registration is\n skipped. The subsequent `continue` bypasses the new-entry path:\n [lines 970–985](https://github.com/coder/coder/blob/v2.39.1/agent/agentcontainers/api.go#L970-L985).\n\n3. By comparison, the new-entry path registers the configuration-change\n watch when a config path is available:\n [lines 987–1003](https://github.com/coder/coder/blob/v2.39.1/agent/agentcontainers/api.go#L987-L1003).\n\nRegistering the config watch when filesystem discovery adds the entry\nmay resolve this. No patch has been tested.\n\nA regression test could force filesystem discovery to complete before\nDocker container adoption, then edit the configuration and verify that\nthe devcontainer becomes outdated.\n\n### Relevant Log Output\n\n```shell\n\n```\n\n### Expected Behavior\n\nCoder detects the configuration change and marks the devcontainer outdated.\n\n### Steps to Reproduce\n\n1. In a Coder workspace with Docker and devcontainer support, place a Git\n repository containing `.devcontainer/devcontainer.json` where Coder's\n filesystem Project discovery can find it.\n2. Create the container independently:\n `devcontainer up --workspace-folder \u003crepository>`\n3. Start or restart the workspace's Coder agent with filesystem Project\n discovery enabled.\n4. Wait until Coder discovers the repository and reports its existing\n devcontainer as running.\n5. Edit `.devcontainer/devcontainer.json`, for example by changing a value\n in `containerEnv`.\n6. Check whether Coder marks the devcontainer outdated.\n\nThe failure appears dependent on discovery order: filesystem discovery must\nrecord the repository before Coder processes its Docker container.\n\n### Environment\n\n- Coder 2.38.7, released binary\n- Coder agent running on Linux ARM64\n- Rootless Docker\n- devcontainer CLI 0.80.2\n- Filesystem Project discovery enabled:\n `CODER_AGENT_DEVCONTAINERS_PROJECT_DISCOVERY_ENABLE=true`\n\nThe affected source file, `agent/agentcontainers/api.go`, is identical in\n2.38.7, 2.39.0 and 2.39.1. Only 2.38.7 was tested at runtime.\n\n### Additional Context\n\n_No response_","author":{"url":"https://github.com/jnehlmeier","@type":"Person","name":"jnehlmeier"},"datePublished":"2026-11-11T23:46:18Z","url":"https://github.com/coder/coder/issues/32066"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8936f530-6033-d9a4-8bec-3b664a6dd097 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A75E:1F35:739BC6:A1A159:6B042D99 |
| html-safe-nonce | a6bf185124482d86a06edffbe34455e7a993e7564fd4cedc102ebe2a00f7864f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzVFOjFGMzU6NzM5QkM2OkExQTE1OTo2QjA0MkQ5OSIsInZpc2l0b3JfaWQiOiI4OTA2NTQ4MTA2NzAzOTQxMDE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4f9c6cd516603478a969ee5403cd9f2d89ac8a1f9b27e5ed41afb75b07564919 |
| hovercard-subject-tag | issue:6339325820 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/32066/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0e0245cb42f09b60f45b9738194dfd6269d5fc9ffe80103018eaef0398cbc1ea/coder/coder/issues/32066 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0e0245cb42f09b60f45b9738194dfd6269d5fc9ffe80103018eaef0398cbc1ea/coder/coder/issues/32066 |
| og:image:alt | Is there an existing issue for this? I have searched the existing issues Current Behavior I am working on a prototype which uses Coder internally and AI discovered that Coder does not detect change... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jnehlmeier |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width