Repository navigation
refactor(openshell): type the operations that may report rejections - #13108
Merged
Merged
Conversation
remote_rejection took an operation name and fell back to remote_error for any name outside a hard-coded list. RejectableOperation now names the credential-free gateway operations, so the compiler enforces the opt-in and the test for names outside the list is no longer needed.
Contributor
|
v1 documentation preview: https://nvidia-preview-nemoclaw-v1-pr-13108.docs.buildwithfern.com/nemoclaw |
This was referenced Oct 13, 2026
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.
remote_rejectionnow takes aRejectableOperationinstead of an operation name, so the compiler checks which gateway operations may report rejection text.Why
#13056 lets four gateway operations report a bounded, sanitized rejection message:
CreateWorkspace,CreateSandbox,DeleteProvider, andDeleteProviderProfile. Their requests contain no credentials.remote_rejectiontook a&'static strand checked it against a hard-coded list. Any other name, including a misspelled allowed one, fell back toremote_error, and no error reported the mismatch. A test passed names outside the list to check that fallback.Change
RejectableOperationenum names the four operations.remote_rejectionmaps each to the sameObservationError::Rejected { operation, … }string as before.openshell-providerpasses enum values, andnemoclaw-openshellandnemoclaw-discoveryre-export the type next toremote_rejection.Validation
cargo test -p nemoclaw-openshell -p openshell-provider -p nemoclaw-discovery: all passed.cargo cion linux_arm64: all steps passed.