修复--auth-stdin读取失败的bug

This commit is contained in:
2026-06-02 18:41:39 +08:00
parent c16e6e3d0c
commit f87dd91b2b
3 changed files with 46 additions and 4 deletions
+12 -2
View File
@@ -8,14 +8,24 @@ from .core import DEFAULT_TIMEOUT, build_runtime_context, emit_success, request_
def runtime_context(ctx: typer.Context):
obj = ctx.obj or {}
return build_runtime_context(
obj = ctx.obj
if not isinstance(obj, dict):
obj = {}
ctx.obj = obj
cached_runtime = obj.get("_runtime_context")
if cached_runtime is not None:
return cached_runtime
runtime = build_runtime_context(
server=obj.get("server"),
auth_stdin=obj.get("auth_stdin", False),
scheme=obj.get("scheme"),
timeout=obj.get("timeout", DEFAULT_TIMEOUT),
request_id=obj.get("request_id"),
)
obj["_runtime_context"] = runtime
return runtime
def emit_api(