MCPcopy Create free account
hub / github.com/HKUDS/OpenOPC / _refresh_cli_org_runtime

Function _refresh_cli_org_runtime

opc/cli/app.py:4310–4331  ·  view source on GitHub ↗
(state: _InteractiveChatState)

Source from the content-addressed store, hash-verified

4308 state.session_id = session_id
4309 await _restore_interactive_native_permission(state)
4310 title = getattr(target, "title", "") or "(untitled)"
4311 console.print(f"[info]Resumed session: {state.session_id} :: {title}[/info]")
4312
4313
4314def _start_new_chat_session(state: _InteractiveChatState) -> None:
4315 state.session_id = str(uuid.uuid4())
4316 state.native_permission_scope_id = state.session_id
4317 state.native_approval_level = normalize_native_approval_level(
4318 state.config.autonomy.native_approval_level
4319 )
4320 approval_engine = getattr(state.engine, "approval_engine", None)
4321 native_policy = getattr(approval_engine, "native_policy", None)
4322 if native_policy is not None:
4323 native_policy.set_session_level(
4324 state.native_permission_scope_id,
4325 state.native_approval_level,
4326 )
4327 console.print(f"[info]Started a new session: {state.session_id}[/info]")
4328
4329
4330async def _restore_interactive_native_permission(
4331 state: _InteractiveChatState,
4332) -> NativeApprovalLevel:
4333 """Restore one session's durable level without consulting other sessions."""
4334

Callers 4

_handle_org_slashFunction · 0.85
_handle_talent_slashFunction · 0.85
_handle_market_slashFunction · 0.85
_handle_reorg_slashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected