RSDK-8814: Make module_file_info required in upload_module_file#1111
RSDK-8814: Make module_file_info required in upload_module_file#1111claude[bot] wants to merge 1 commit intomainfrom
Conversation
|
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 |
There was a problem hiding this comment.
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.pyis modified;gen/is untouched. AppClienthas no superclass definingupload_module_file, so no interface needs updating.Optionalis 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.
Summary
module_file_infoparameter required (non-Optional) inAppClient.upload_module_file(), since the gRPC server requires it in the first upload packet and passingNoneresults in anINVALID_ARGUMENTerror.Test plan
test_upload_module_filetest passesuv run make formatpassesuv run make lintpasses🤖 Generated with Claude Code