As you might know, Commits have been renamed to Versions in the new frontend.
They are a bit trickier to find: simply expand the model history, and click on a version. Its commitId will be appended to the URL after the @.
As @teocomi says, not all the underlying SDKs have fully implemented both terminology sets yet.
Consequently, depending on how full a URL you pass to the StreamWrapper, you will indeed get different results between the new URL schema (projects and models) and the legacy (streams and branches)
If you directly address a version in the new schema, as per Teo’s screenshot, this will be signified with an @, and StreamWrapper will return this as a commit_id… yes, backwards compatibility has a cognitive load
# Initialise StreamWrapper and retrieve model and commit IDs
wrapper = StreamWrapper(
"https://app.speckle.systems/projects/395d60e295/models/c25813b37a")
commit_id = wrapper.commit_id
# Fetch commit and create a transport for operations
if commit_id is None:
stream = client.stream.get(wrapper.stream_id)
model = next((branch for branch in stream.branches.items
if branch.id == wrapper.model_id), None)
commit = model.commits.items[0] if model else None
transport = ServerTransport(client=client, stream_id=wrapper.stream_id)
# Retrieve and process the referenced object if commit is available
commit_data = (operations.receive(obj_id=commit.referencedObject,
remote_transport=transport) if commit else None)