Skip to content

[MEDIUM] Truthy check on custom_name silently falls back to model_id when name is empty string #41

@bluet

Description

@bluet

Summary

check.model.custom_name or check.model.model_id is used in several display contexts:

  • arguslm/server/api/monitoring.py:215, 295-296, 338-339
  • arguslm/server/api/benchmarks.py:329, 393, 440

custom_name is a user-set string. The PATCH endpoint update_custom_name accepts updates whenever "custom_name" in update_data.model_dump(exclude_unset=True) — so a user setting it to empty string "" is accepted. But the truthy check on "" is False, so the export and history will silently fall through to model_id instead of showing the user's (empty) name.

Impact

  • User edits the custom name to clear it → next view shows the model_id, not nothing — confusing
  • If empty string is meant to be valid (clear the override), the display silently substitutes
  • If empty string is meant to be invalid, the validation should reject it at the API layer, not silently fall through at display time

Suggested fix

Decide the intent first:

Option A — empty string means "no override": validate at API layer (reject "" or convert to None), keep the display logic.

Option B — empty string is a legal display value: change all sites to:

display_name = check.model.custom_name if check.model.custom_name is not None else check.model.model_id

Reference

Found by silent-failure-hunter audit.
Files:

  • arguslm/server/api/monitoring.py:215, 295-296, 338-339
  • arguslm/server/api/benchmarks.py:329, 393, 440

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions