Skip to content

Validate model short_description length in the CLI and schema - #6594

Merged
Nicolas Palpacuer (NickPPC) merged 2 commits into
mainfrom
module-manifest-description-limit
Oct 15, 2026
Merged

Nicolas Palpacuer (NickPPC) merged 2 commits into
mainfrom
module-manifest-description-limit

Conversation

@NickPPC

@NickPPC Nicolas Palpacuer (NickPPC) commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Summary

Check model short_description length on the client side, so modules catch it in CI instead of when a release fails. app.viam.com rejects descriptions over 100 characters, but only the server checks this. Today modules find out when viam module update fails mid-deploy (e.g. beanjamin).

Changes

  • New offline viam module validate: needs no credentials, so any module's PR CI can run it against meta.json
  • module update / module upload fail before the RPC: same check, with an error that names every offending model
  • Schema field fixed: the model field was documented as description, but the CLI reads short_description. It now has maxLength: 100, so editors that apply $schema flag long descriptions as you type
  • Same byte count as the server: the CLI uses len(), like app. JSON Schema counts code points, so the two only differ for non-ASCII text

Testing

  • go test ./cli -run 'TestValidateManifestLimits|TestValidateModuleAction': covers the limit boundary, several offending models, and the command end to end without auth
Claude Code prompts used
  • "Hi Claude, we just got this error in CD: https://github.com/viamrobotics/beanjamin/actions/runs/36877394749/job/110422025513. We have seen this before and it is inconvenient that we discover this only after a new release is attempted. Could we add something in our CI to check for this? Given that it affects most Viam module what is the recommend way to fix this in a way that will benefit most of those modules"
  • "Can you start a worktree and create a draft PR for the upstream change in rdk? You can find the repo at @~/code/rdk/"

🤖 Generated with Claude Code

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Oct 4, 2026
@NickPPC
Nicolas Palpacuer (NickPPC) marked this pull request as ready for review October 5, 2026 16:09
@NickPPC
Nicolas Palpacuer (NickPPC) requested a review from a team as a code owner October 5, 2026 16:09
@NickPPC
Nicolas Palpacuer (NickPPC) added this pull request to stack #6598 October 5, 2026 16:12
@NickPPC
Nicolas Palpacuer (NickPPC) force-pushed the module-manifest-description-limit branch from 6bdbdc7 to a8dc8cf Compare October 5, 2026 16:13
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Oct 5, 2026
Comment thread cli/module.schema.json
"description": "A colon-delimited triple of NAMESPACE:ANYTHING:NAME. Namespace must match your org's public namespace (if you have one)."
},
"description": {
"short_description": {

@ale7714 Ale Paredes (ale7714) Oct 7, 2026 •

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.

is this different from our api? i guess should we keep it consistent?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is not different from our API, short_description is the correct key. The struct field is called Description and that's why I assume we got the key wrong in the schema (or maybe the key changed afterwards).

type ModuleComponent struct {
API          string  `json:"api"`
Model        string  `json:"model"`
Description  *string `json:"short_description,omitempty"`
MarkdownLink *string `json:"markdown_link,omitempty"`
}

Comment thread cli/app.go Outdated
Action: createActionCommandWithT[updateModuleArgs](UpdateModuleAction),
},
{
Name: "validate",

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 like this idea but i think this is more of a syntax check than a full validate. the only reason i think the distintiction matters is that you could pass this validate and still have errors (like uploading a duplicate model to the registry) that would fail during cloud build time. i don't a good proposal for a name or maybe the usage text could be more clear that this is a syntax check

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We could use maybe module lint-manifest?

@NickPPC
Nicolas Palpacuer (NickPPC) force-pushed the module-manifest-description-limit branch from a8dc8cf to 21ed1b9 Compare October 12, 2026 14:40
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Oct 12, 2026
app.viam.com rejects a model short_description over 100 characters, but
nothing on the client side checks it, so modules only find out when a
release runs `viam module update`. Mirror the limit in the CLI (update,
upload, and a new offline `viam module validate` for CI) and in
module.schema.json, whose model field was also misnamed `description`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The command only checks meta.json offline, so passing it does not mean
an upload will succeed (e.g. a duplicate model is only caught by the
registry). Name and describe it as a lint to set that expectation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@NickPPC
Nicolas Palpacuer (NickPPC) force-pushed the module-manifest-description-limit branch from 46ea5b8 to b2b10ba Compare October 15, 2026 20:04
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Oct 15, 2026
@NickPPC
Nicolas Palpacuer (NickPPC) merged commit e29217f into main Oct 15, 2026
24 checks passed
@NickPPC
Nicolas Palpacuer (NickPPC) deleted the module-manifest-description-limit branch October 15, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants