Repository navigation
Start without AYON settings; only ayon:// URIs stay unresolved - #112
Merged
antirotor merged 2 commits intoNov 5, 2026
Conversation
With AYON_API_KEY, AYON_SERVER_URL or AYON_PROJECT_NAME unset, getAyonApiFromEnv() threw out of the ResolverContextCache constructor. The resolver is the primary resolver, so every stage operation in the process failed, even Usd.Stage.CreateInMemory() or opening a plain local file. The constructor now catches that, warns once (TF_WARN) and carries on without an AYON connection. getAsset() returns an ayon:// URI unresolved when there is none (as on any failed lookup, not anchored as a file path), and batchWarm() skips the AYON request; plain paths resolve as normal. getAyonApiFromEnv() also checks the variables before printing them: streaming a null char* to std::cout is undefined behaviour and in libstdc++ sets badbit, silencing every later write to std::cout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YRNAzpFt5VwUwBTHRbRQRm
antirotor
requested review from
antirotor
and
a balanced review from Copilot
and removed request for
Copilot
November 5, 2026 15:07
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the changes allowing the resolver to operate without AYON environment settings.
No open issues 🎉
What changed in this PR
This PR lets the USD resolver operate without AYON environment settings, preserving plain-path operations while leaving unresolved ayon:// lookups unresolved.
Changes:
- Catch AYON initialization failures and emit a warning instead of failing resolver construction.
- Skip AYON lookup and batch requests when no API connection is available.
- Validate required environment variables before logging them to avoid streaming null pointers.
| File | Description |
|---|---|
src/AyonUsdResolver/helpers/ayonApiGet.cpp |
Validate required variables before logging and clarify the missing-settings error. |
src/AyonUsdResolver/cache/resolverContextCache.cpp |
Handle initialization failures and guard AYON requests when no connection exists. |
Review effort: Balanced
1 task done
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.
Changelog Description
If
AYON_API_KEY,AYON_SERVER_URLorAYON_PROJECT_NAMEis unset, the resolver no longer makes every USD operation in the process fail. It logs one warning and carries on: plain paths resolve normally, andayon://URIs stay unresolved.Additional review information
getAyonApiFromEnv()threw out of theResolverContextCacheconstructor. Because this is the primary resolver, any stage operation then raisedRuntimeError, evenUsd.Stage.CreateInMemory()or opening a local.usda. We hit it with a standalone OpenUSD build in a shell where the AYON variables weren't set.TF_WARNnaming the variables, and leavesm_ayonempty.getAsset()returns anayon://URI unresolved when there's no connection, the same as any failed lookup. It doesn't fall into the plain-path branch, which would anchor it to the working directory.batchWarm()skips the AYON request.getAyonApiFromEnv()checks the variables before printing them. Streaming a nullchar*tostd::coutis undefined behaviour, and in libstdc++ it sets badbit and silences every later write tostd::cout.Relation to #103: #103 makes a missing site ID throw from
getAyonApiFromEnv(). Without this PR, that would also fail every stage operation in the process. With it, a missing site ID gives the same single warning and onlyayon://resolution stops.Testing notes:
Tested on our fork, where this change sits on top of #104, #108, #109, #110 and #106 (same diff), with a standalone OpenUSD 25.05 / Python 3.9 build:
AYON_API_KEY,AYON_SERVER_URLandAYON_PROJECT_NAME.Usd.Stage.CreateInMemory(), open a plain.usdafile, andusdcatit: all work, and a single warning is printed (before:RuntimeErroron each).Ar.GetResolver().Resolve("ayon://…")returns the URI unchanged, as for a missing asset.ayon://sublayer opens and reports "Could not load sublayer".ClearCache/DeleteFromCache.