Skip to content

RSDK-8814: Make module_file_info required in upload_module_file#1111

Open
claude[bot] wants to merge 1 commit intomainfrom
claude/RSDK-8814-module-file-info-required
Open

RSDK-8814: Make module_file_info required in upload_module_file#1111
claude[bot] wants to merge 1 commit intomainfrom
claude/RSDK-8814-module-file-info-required

Conversation

@claude
Copy link

@claude claude bot commented Feb 24, 2026

Summary

  • Make module_file_info parameter required (non-Optional) in AppClient.upload_module_file(), since the gRPC server requires it in the first upload packet and passing None results in an INVALID_ARGUMENT error.

Test plan

  • Existing test_upload_module_file test passes
  • uv run make format passes
  • uv run make lint passes

🤖 Generated with Claude Code

@claude claude bot requested a review from a team as a code owner February 24, 2026 03:42
@claude claude bot requested review from allisonschiang and stuqdog February 24, 2026 03:42
@ale7714
Copy link
Member

ale7714 commented Feb 24, 2026

We didn't need AI but I was doing some testing. Looking at the api, it's not optional https://github.com/viamrobotics/api/blob/main/proto/viam/app/v1/app.proto#L1688

Copy link
Author

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Review

The change is correct and well-scoped.

Correctness: module_file_info is sent in the first streaming message to UploadModuleFile. Protobuf would silently omit a None value, causing the server to return INVALID_ARGUMENT. Making the parameter required at the Python type level accurately reflects the server contract.

Backwards Compatibility: This is technically a breaking change — any caller passing module_file_info=None will now get a type error from pyright. However, that call was already broken at runtime (server rejection), so this is a type-level correction of a pre-existing contract violation, not a genuine regression.

Scope: Exactly two lines changed — the signature and the docstring. No refactoring, no scope creep, no unrelated changes.

Validation:

  • Only src/viam/app/app_client.py is modified; gen/ is untouched.
  • AppClient has no superclass defining upload_module_file, so no interface needs updating.
  • Optional is still imported and used 93+ times elsewhere in the file — no stale import.
  • Lint passes (ruff check).
  • The existing test already exercises the only valid code path (non-None ModuleFileInfo), so no new test is needed.

No issues found. A human approver should confirm the API break is intentional and communicated to consumers.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant