Update module reconfiguration lifecycle docs#5042
Conversation
viam-server now always rebuilds modular resources (close + re-create) when their configuration changes. In-place reconfiguration via Reconfigure() is no longer supported for modular resources in any language. This removes the incorrect claim that Python modules can implement reconfigure() to handle config changes in place. Source: viamrobotics/rdk#5944 https://claude.ai/code/session_01Xd7GAtzjRzypiJK1amk4Uu
✅ Deploy Preview for viam-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hold: source change reverted. The RDK change this PR documents (viamrobotics/rdk#5944, Remove-Reconfigure) was reverted by viamrobotics/rdk#5997 on 2026-05-07. The #5997 PR description says: "To reland Remove-Reconfigure: revert this PR." So Remove-Reconfigure is expected to re-land in 1-2 weeks. Recommendation: Do not merge this PR until Remove-Reconfigure re-lands. Once it does, this PR's changes will be correct again and can be merged (possibly with minor updates if the re-land differs from #5944). Generated by daily docs change agent Generated by Claude Code |
|
Hey @shannonbradshaw — CI is green and no reviewer is assigned yet. Could you request one when you have a chance? Auto-comment from overwatch. Will not re-nudge for 7 days. |
2 similar comments
|
Hey @shannonbradshaw — CI is green and no reviewer is assigned yet. Could you request one when you have a chance? Auto-comment from overwatch. Will not re-nudge for 7 days. |
|
Hey @shannonbradshaw — CI is green and no reviewer is assigned yet. Could you request one when you have a chance? Auto-comment from overwatch. Will not re-nudge for 7 days. |
danielbotros
left a comment
There was a problem hiding this comment.
LGTM, but I would hold off on merging since we reverted the linked PR to let the additional fixes bake and will land the actual remove reconfigure in the next week or so.
| @@ -240,12 +240,16 @@ if __name__ == '__main__': | |||
|
|
|||
| The default behavior when you don't implement a method: | |||
|
|
|||
| | Behavior | Go | Python | | |||
| | ------------------------ | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------- | | |||
| | Rebuild on config change | Default (`viam-server` destroys and re-creates the resource) | Default (`viam-server` destroys and re-creates the resource) | | |||
| | In-place reconfigure | Not supported for modular resources | Implement `reconfigure()` (called if your class satisfies the `Reconfigurable` protocol) | | |||
| | No-op close | Embed `resource.TriviallyCloseable` | Default on `ResourceBase` | | |||
| | Skip config validation | Embed `resource.TriviallyValidateConfig` | Default on `EasyResource` | | |||
| | Behavior | Go | Python | | |||
| | ------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | |||
| | Rebuild on config change | Default (`viam-server` destroys and re-creates the resource) | Default (`viam-server` destroys and re-creates the resource) | | |||
| | No-op close | Embed `resource.TriviallyCloseable` | Default on `ResourceBase` | | |||
| | Skip config validation | Embed `resource.TriviallyValidateConfig` | Default on `EasyResource` | | |||
|
|
|||
| `viam-server` always rebuilds modular resources when their configuration | |||
| changes. It removes the existing resource instance and creates a new one | |||
| using the constructor. In-place reconfiguration is not supported for | |||
| modular resources in any language. | |||
There was a problem hiding this comment.
The rebuild row doesn't really fit the structure of this table anymore since there is no default / not-default behavior, the behavior is to always rebuild. It can probably be dropped and the paragraph at the bottom explaining how modular resources are always rebuilt can do the explaining. Also, rebuilds happen when dependencies change as well, if worth mentioning.
nit: As an aside. this table structure was a little confusing to me. I interpreted as: default behavior if you don't implement a Close method is a no-op close, which embeds resource.TriviallyCloseable. But it should be conveyed the other way around. If you embed resource.TriviallyCloseable then you get the default behavior of a no-op close.
| | --------------------- | ----------------------------------------------------------------------------------- | | ||
| | `Ready` | Handshake: module returns its supported API/model pairs. | | ||
| | `AddResource` | Create a new resource instance from config. | | ||
| | `ReconfigureResource` | Rebuild an existing resource with new config (removes and re-creates the resource). | |
There was a problem hiding this comment.
I think this is clear as-is, and the distinction is mostly one of internal mechanics but since we mention:
In-place reconfiguration is not supported for modular resources in any language.
consider mentioning the name ReconfigureResource is retained for compatibility reasons for more clarity.
| Reconfigure this resource. | ||
| Reconfigure must reconfigure the resource atomically and in place. | ||
| For modular resources, reconfiguration destroys the existing resource instance and creates a new one using the constructor. |
There was a problem hiding this comment.
Maybe we can move away from the language of reconfigure towards reconstruction? i.e.
Reconstruct this resource.
For modular resources, reconstruction destroys...
…nstruct language - Drop "Rebuild on config change" row from defaults table since rebuilds are universal, not a default-vs-custom behavior. Note dependency changes also trigger rebuilds. - Add compatibility note to ReconfigureResource RPC description. - Use "Reconstruct" language in sensor.Reconfigure override. https://claude.ai/code/session_01Xd7GAtzjRzypiJK1amk4Uu
|
Thanks, @danielbotros. Will hold off on merging. |

Source changes
Reconfigurefrom theResourceinterface; modular resources are now always rebuilt (close + re-create) instead of reconfigured in place.Docs changes
docs/build-modules/module-reference.md: Removed the "In-place reconfigure" row from the Python/Go defaults table (Python'sreconfigure()via theReconfigurableprotocol is no longer called byviam-server). Added a paragraph clarifying thatviam-serveralways rebuilds modular resources. Updated theReconfigureResourceRPC description to reflect it now rebuilds rather than updates in place.static/include/components/apis/overrides/protos/sensor.Reconfigure.md: Updated the override description to state that modular resources are rebuilt rather than reconfigured atomically in place.How I found these
search-patterns.yamlentry forResource.Reconfigure(discovered 2026-04-15)grep -rl "Reconfigure" docs/build-modules/found 4 pages; the module-reference.md table had the incorrect Python claimGenerated by daily docs change agent
Generated by Claude Code