Skip to content

[Docs] Update news and bump version - #49

Merged
wangxingjun778 merged 20 commits into
mainfrom
feat/adap_sdk
Aug 1, 2026
Merged

[Docs] Update news and bump version#49
wangxingjun778 merged 20 commits into
mainfrom
feat/adap_sdk

Conversation

@wangxingjun778

Copy link
Copy Markdown
Member

No description provided.

…o facade

The compat snapshot_download wrapper forwards progress_callbacks to HubApi.download_repo, but the facade dropped the parameter and never passed it to DownloadManager.download_repo, so any real (non-mocked) call raised TypeError.

Restore full-chain propagation: HubApi.download_repo now accepts and forwards progress_callbacks to the DownloadManager delegate (DownloadManager already supports it); compat.snapshot_download accepts and forwards it. Add an integration-style test that mocks only the DownloadManager delegate so the real compat wrapper and HubApi facade both execute.
DownloadManager._find_legacy_repo_dir now probes both historical cache layouts in priority order: {base}/{type}s/{owner}/{name___} (MODELSCOPE_CACHE explicitly set) and {base}/hub/{type}s/{owner}/{name___} (default ~/.cache/modelscope/hub). It returns the first existing non-empty match, or None when the cache is clean so the caller falls back to the new layout. Adds network-free regression tests covering both layouts, multi-dot name encoding, clean cache, and empty legacy dir.
…oid conflict

modelscope and modelscope-hub both declared modelscope/ms console scripts, so installing both (modelscope depends on modelscope-hub) collided on the same binary (e.g. /usr/local/bin/modelscope-3.12 on FreeBSD pkg). Rename the hub entry points to modelscope-hub/ms-hub so the umbrella modelscope package keeps modelscope/ms while standalone modelscope-hub users get their own non-colliding CLI. Fixes modelscope/modelscope#1752.
Bring the News section up to date through v0.1.8 (v0.1.5-v0.1.8 expanded, v0.1.4 and older collapsed under a details block). Within each release, merge same-type entries (Feature/Fix) into a single bullet instead of listing them flat. CLI references use the new ms-hub command name.
`HubApi.login` caught `HubError` -- the base class of every SDK exception --
and re-raised everything as `AuthenticationError("...token was rejected by
the server")` while calling `clear_token()`. Three problems followed:

* network, timeout and 5xx failures were all reported as an invalid token
* the server's own message and RequestId were discarded, leaving no way to
  diagnose the failure or trace it server-side
* a failed attempt deleted the credential already on disk, so a single
  mistyped token logged the user out of a working session

Both ModelScope sites answer an unknown token with the same HTTP 400 and
business code 10010103009, so the server cannot distinguish "invalid token"
from "token issued by the other site" -- only the client knows which site it
addressed, which is why that disambiguation now happens here.

Changes:

* classify 4xx by the server business code, mapping 10010103009 to
  AuthenticationError (E3001); 5xx stays a retryable ServerError so a
  transient outage is never reclassified as permanent
* propagate non-authentication failures unchanged, preserving their type,
  error code, message and RequestId
* leave persisted credentials untouched on failure and roll back only the
  in-memory state of the instance
* probe the peer site when the endpoint was not pinned, and point at
  `--endpoint` when the token turns out to be valid there
* centralise endpoint normalisation in `HubConfig.normalize_endpoint` so a
  bare or upper-case scheme no longer fails deep inside the transport layer
* remove every credential artefact together on teardown, and propagate a
  cleared token to an already constructed legacy client
* print the full error cause chain under `--verbose`

Adds 29 regression tests that stub only the `requests` transport, so the
config, facade, legacy client and error-translation layers all take part.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@wangxingjun778
wangxingjun778 merged commit 9294041 into main Aug 1, 2026
4 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