Skip to content

refactor(cli): standardize studio manager contract and align tests - #49

Merged
moonandlife merged 2 commits into
mainfrom
feature/register_sage_studio_cli
Apr 3, 2026
Merged

refactor(cli): standardize studio manager contract and align tests#49
moonandlife merged 2 commits into
mainfrom
feature/register_sage_studio_cli

Conversation

@moonandlife

Copy link
Copy Markdown
Contributor

Summary

  • standardize SAGE Studio CLI calls to a single explicit manager contract
  • remove runtime compatibility wrapper/introspection logic in src/sage/studio/cli.py
  • keep direct command behavior:
    • start/restart call manager.start(port=...)
    • logs supports --backend and --follow only
    • open calls manager.open_browser()
  • align integration test fakes with the canonical manager API
  • remove lifecycle tests for deprecated logs --gateway and logs --lines options

Why

  • avoids compatibility shims and hidden behavior
  • keeps CLI call paths explicit and easier to maintain
  • updates test expectations to match the runtime manager contract

Validation

  • pytest tests/integration/test_studio_cli.py tests/integration/test_studio_lifecycle.py -q
  • pytest tests/ -q
  • result: all tests pass

Jeffrey added 2 commits April 3, 2026 18:15
…ager APIO

Made studio plugin registration argparse-compatible
- Added argparse bridge handler that dispatches to existing Typer app:
  - sage-studio/src/sage/studio/cli.py
- Updated register_studio_command to support both Typer and argparse callers:
  - sage-studio/src/sage/studio/cli.py
- Disabled wrapper-local help so sage studio --help reaches Typer help:
  - sage-studio/src/sage/studio/cli.py

align studio CLI-manager API

add dynamic loading for sage CLI plugins via sage.cli.plugins entry points
register studio command into argparse subcommands from plugin entry point
forward plugin args safely with parse_known_args so studio help/subcommands work
fix studio start/restart calls to use StudioManager.start(port=...) instead of frontend_port
fix studio open command to call open_browser()
align studio logs command with manager signature by removing unsupported gateway/lines forwarding
preserve clear error behavior for unknown args on non-plugin commands
@moonandlife
moonandlife merged commit fb23101 into main Apr 3, 2026
6 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.

1 participant