Skip to content

feat(cli): add vlmrun artifacts subcommand#195

Merged
dineshreddy91 merged 1 commit into
mainfrom
devin/1781135359-add-artifacts-cli
Jun 11, 2026
Merged

feat(cli): add vlmrun artifacts subcommand#195
dineshreddy91 merged 1 commit into
mainfrom
devin/1781135359-add-artifacts-cli

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the missing vlmrun artifacts get CLI subcommand that wraps the existing client.artifacts.get() method.

vlmrun artifacts get <object_id> --session-id <sid>     # by chat session
vlmrun artifacts get <object_id> --execution-id <eid>   # by agent execution
vlmrun artifacts get img_a1b2c3 -s <sid> -o image.jpg   # save to custom path
vlmrun artifacts get img_a1b2c3 -s <sid> --raw           # raw bytes

The command validates that exactly one of --session-id / --execution-id is provided, delegates to client.artifacts.get(), and handles the heterogeneous return types (PIL Image → saves as JPEG, Path → copies, bytes → writes directly). Without --output, files are saved to the SDK's default artifact cache (~/.vlmrun/cache/artifacts/<id>/).

Registered as app.add_typer(artifacts_app, name="artifacts") in cli.py, matching the pattern used by files, executions, skills, etc.

Includes 6 CLI tests (tests/cli/test_cli_artifacts.py) using the existing mock_client fixture.

Link to Devin session: https://app.devin.ai/sessions/e5919db7748c40d7a5a4194cb59f487a
Requested by: @spillai


Open in Devin Review

Add `vlmrun artifacts get` CLI command to download artifacts by
object_id with either --session-id or --execution-id. Supports
--output for custom save path and --raw for raw bytes.

Wraps the existing client.artifacts.get() method.

Co-Authored-By: Sudeep Pillai <sudeep.pillai@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🚩 Mock Artifacts.get always returns bytes — only the raw_response=True path is tested

The mock Artifacts.get in tests/conftest.py:750-765 always returns b'mock artifact content' regardless of the raw_response parameter. This means the tests only exercise the isinstance(result, bytes) branch (line 104) and the _write_to_output bytes path (line 160-161). The Path branch (line 110), the PIL Image fallback (line 124), and the corresponding _write_to_output branches for Path (line 162-165) and PIL Image (line 167-168) are never tested. This is a gap in test coverage for the new feature.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


# No explicit output — display what the SDK returned
if isinstance(result, bytes):
if output is None:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🟡 Redundant if output is None: guard is always True — dead code

At line 86, the code checks if output is not None: and returns at line 101. By the time execution reaches line 105, output is guaranteed to be None. The if output is None: check on line 105 is therefore always True and serves no purpose. While it doesn't cause incorrect behavior, it suggests an incomplete refactoring and could mislead future developers into thinking there's a code path where output is not None past line 101.

Suggested change
if output is None:
console.print(
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@dineshreddy91 dineshreddy91 self-requested a review June 11, 2026 00:20
@dineshreddy91 dineshreddy91 merged commit 81fb615 into main Jun 11, 2026
5 checks passed
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.

2 participants