Repository navigation
Conversation
added 3 commits
November 12, 2026 14:16
…ption) Re-implements the 20261027 OpenAPI adaptation on top of current main (post-modelscope#77 rewrite), replacing the pre-modelscope#77 implementation previously carried on this branch: - CLI: studio settings/create expose the OAuth app configuration flags (--oauth-enabled/--no-oauth-enabled, --oauth-scope, --oauth-token-expire-time, --oauth-callback-url, --oauth-homepage-url); lone oauth_* settings without an explicit oauth_enabled are rejected client-side, mirroring the server's HTTP 400 gate - CLI/API: --description on studio secret/variable add/update (and the top-level secret family); description is tri-state on update — None omits the field (server keeps the stored one), empty string clears it - CLI: secret/variable list now renders the description column the server returns - compat: legacy add/update_studio_secret/variable forward passthrough kwargs (description) instead of silently dropping them - fixture: openapi.json gains the oauth_* fields on CreateStudioRequest / UpdateStudioSettingsRequest / GetStudioResponse with service-master-aligned descriptions Verified: full cli subset 868 passed / 37 skipped; ruff + mypy clean; modelscope SDK tests/studios/test_studio_cli.py against this build: 19 passed / 19 skipped (gates active).
…erance Three review findings on modelscope#83 plus a help-text clarification: - create: reject OAuth flag combinations the server would silently drop. The create contract decodes oauth_enabled as a plain bool, so detail fields without an explicit flag never reach the OAuth app creation — the studio deploys without its login runtime variables. Lone details and non-studio misuse now fail fast before any request (openapi/backend/studio.go:634, service/space.go:3899). - secret/variable list: keep keys (and variable values) untruncated — server-legal keys run to 128 bytes and must stay copyable; only the description column is capped via the new per-column max_widths (openapi/types/studio.go:216). - compat: forward only description on add/update_studio_secret/variable; unknown kwargs keep the legacy silent-ignore behaviour instead of raising TypeError from the fixed-signature modern API. - CLI help: --oauth-callback-url now distinguishes create (defaults to the studio subdomain) from update (keeps existing callbacks). Verified: full non-remote suite 1775 passed / 1 skipped; ruff + mypy clean; modelscope tests/studios with this build: 23 passed / 19 skipped.
… cap variable values - ms secret list did not forward max_widths to render_table, so the default 80-char truncation hit the key column: server-legal keys (contract maxLength 128) rendered with an ellipsis, and copying them from the screen made update/delete 404. This is the exact failure mode utils/format.py's max_widths was introduced to prevent and that ms studio secret list already guards against. The key column is now untruncated and the description capped at 80. - Removed the updated_at column: StudioSecretItem (service contract, modelscope_service openapi/types/studio.go) has only key/description, so the column always rendered "-". The mock fixture carried a fictional updated_at that masked this. - ms studio variable list left the value column untruncated (max_widths=(None, None, 80)) on the theory that values are copyable identifiers; they are not — the key is the identifier, the value is data, and a contract-legal 4096-char value rendered as one giant cell that hard-wrapped and destroyed the table. The value column is now capped at 120 (keys stay untruncated).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release Notes — modelscope_hub
Features
Studio OAuth app configuration
ms create <repo_id> --repo-type studioandms studio settingsnow support configuring a Studio's OAuth app:--oauth-enabled/--no-oauth-enabled,--oauth-scope,--oauth-token-expire-time(1=15min … 6=30days),--oauth-callback-url(repeatable),--oauth-homepage-url.--oauth-callback-urlomitted on create defaults to the studio subdomain; on update the existing callbacks are kept.--oauth-enabled; the flags are studio-only.Secret & variable descriptions
ms secret add/update,ms studio secret|variable add/updateaccept--description(max 512 chars).""to clear.ms secret list,ms studio secret|variable listnow render the description column.add_secret/update_secret/add_variable/update_variableacceptdescription=; the OpenAPI client's studio secret/variable methods likewise.Fixes
add_studio_secret/add_studio_variable/update_*no longer silently drop adescription=kwarg; unknown kwargs still ignored as before (noTypeError).ms secret list/ms studio secret list: keys up to the contract's 128 bytes now render untruncated and stay copyable — previously the default truncation made copied keys fail with 404 on update/delete.ms studio secret list: removed the always-emptyupdated_atcolumn (not part of the server contract).ms studio variable list: long values (up to 4096 chars) are now capped so a single value can no longer destroy the table layout; keys remain untruncated.Compatibility