Files
OpenShell/python/openshell/__init__.py
Mrunal Patel 39cf4823f7 feat(api): add structured gateway errors and SDK decoding (#3313)
* feat(api): expose structured gateway errors across SDKs

Refs #3051. Add standard validation, conflict, and retry details; preserve raw transport status in Rust, Go, TypeScript, and Python; document status and recovery guidance.

This is the structured-error foundation only. Mutation result shapes, allow_missing, durable request deduplication, and exec retry semantics remain follow-up work.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

* fix(python): preserve wrapped RPC cleanup handling

Inspect the original gRPC call when handling missing sandboxes during deletion waits and managed cleanup. Add intercepted cleanup regressions and clarify the error-wrapper migration contract.

Addresses the cleanup review on #3313; part of #3051.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

---------

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2026-09-15 17:51:11 +00:00

58 lines
1.2 KiB
Python

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""OpenShell - Agent execution and management SDK."""
from __future__ import annotations
from .errors import ErrorInfo, FieldViolation, GatewayError, from_grpc_error
from .sandbox import (
ClientCredentialsAuth,
ExecChunk,
ExecResult,
Page,
Pager,
Sandbox,
SandboxClient,
SandboxError,
SandboxRef,
SandboxSession,
SandboxStatusRef,
SandboxTemplateClient,
SandboxWorkloadTemplateProvenanceRef,
TlsConfig,
WorkspaceClient,
WorkspaceRef,
)
try:
from importlib.metadata import version
__version__ = version("openshell")
except Exception:
__version__ = "0.0.0"
__all__ = [
"ClientCredentialsAuth",
"ErrorInfo",
"ExecChunk",
"ExecResult",
"FieldViolation",
"GatewayError",
"Page",
"Pager",
"Sandbox",
"SandboxClient",
"SandboxError",
"SandboxRef",
"SandboxSession",
"SandboxStatusRef",
"SandboxTemplateClient",
"SandboxWorkloadTemplateProvenanceRef",
"TlsConfig",
"WorkspaceClient",
"WorkspaceRef",
"__version__",
"from_grpc_error",
]