Skip to content

Update module reconfiguration lifecycle docs#5042

Open
shannonbradshaw wants to merge 2 commits into
mainfrom
claude/update-module-reconfigure-lifecycle
Open

Update module reconfiguration lifecycle docs#5042
shannonbradshaw wants to merge 2 commits into
mainfrom
claude/update-module-reconfigure-lifecycle

Conversation

@shannonbradshaw
Copy link
Copy Markdown
Collaborator

Source changes

Docs changes

  • docs/build-modules/module-reference.md: Removed the "In-place reconfigure" row from the Python/Go defaults table (Python's reconfigure() via the Reconfigurable protocol is no longer called by viam-server). Added a paragraph clarifying that viam-server always rebuilds modular resources. Updated the ReconfigureResource RPC 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

  • Xref lookup: search-patterns.yaml entry for Resource.Reconfigure (discovered 2026-04-15)
  • Grep matches: grep -rl "Reconfigure" docs/build-modules/ found 4 pages; the module-reference.md table had the incorrect Python claim

Generated by daily docs change agent


Generated by Claude Code

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
@netlify
Copy link
Copy Markdown

netlify Bot commented May 6, 2026

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 45c5ae7
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/6a1600fa0e3618000821c9d6
😎 Deploy Preview https://deploy-preview-5042--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 38 (🔴 down 6 from production)
Accessibility: 99 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 92 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label May 6, 2026
Copy link
Copy Markdown
Collaborator Author

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. Reconfigure is back on the Resource interface temporarily while the cascade-fix bakes on main.

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

@viamrobotics-overwatch
Copy link
Copy Markdown

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
@viamrobotics-overwatch
Copy link
Copy Markdown

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.

@viamrobotics-overwatch
Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Member

@danielbotros danielbotros left a comment

Choose a reason for hiding this comment

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

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.

Comment thread docs/build-modules/module-reference.md Outdated
Comment on lines +239 to +252
@@ -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.
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.

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.

Comment thread docs/build-modules/module-reference.md Outdated
| --------------------- | ----------------------------------------------------------------------------------- |
| `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). |
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.

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.

Comment on lines +1 to +2
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.
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.

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
@shannonbradshaw
Copy link
Copy Markdown
Collaborator Author

Thanks, @danielbotros. Will hold off on merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to build This pull request is marked safe to build from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants