docs(config): unify config.get reads and remove ALLOW_* gates
All checks were successful
技能自动化发布 / release (push) Successful in 5s
All checks were successful
技能自动化发布 / release (push) Successful in 5s
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
from jiangchang_skill_core import config
|
||||
|
||||
from service.adapter.base import BatchAdapterBase, BatchItem, BatchSubmitResult
|
||||
from service.adapter.mock import MockBatchAdapter
|
||||
from service.adapter.simulator_rpa import SimulatorBrowserRpaAdapter
|
||||
@@ -23,7 +24,7 @@ __all__ = [
|
||||
|
||||
|
||||
def select_adapter(artifacts_dir: Optional[str] = None) -> BatchAdapterBase:
|
||||
target = os.environ.get("OPENCLAW_TEST_TARGET", "").strip().lower()
|
||||
target = (config.get("OPENCLAW_TEST_TARGET") or "").strip().lower()
|
||||
|
||||
if target in ("mock", "unit"):
|
||||
logger.info("target '%s': MockBatchAdapter", target)
|
||||
|
||||
@@ -9,6 +9,8 @@ import re
|
||||
import time
|
||||
from typing import List, Optional
|
||||
|
||||
from jiangchang_skill_core import config
|
||||
|
||||
from service.adapter.base import BatchAdapterBase, BatchItem, BatchSubmitResult
|
||||
from service.browser_session import browser_session, find_chrome_executable
|
||||
from util.constants import (
|
||||
@@ -45,8 +47,7 @@ class SimulatorBrowserRpaAdapter(BatchAdapterBase):
|
||||
) -> None:
|
||||
self.base_url = (base_url or resolve_simulator_base_url()).rstrip("/")
|
||||
if headless is None:
|
||||
env = os.environ.get("OPENCLAW_BROWSER_HEADLESS", "").strip().lower()
|
||||
self.headless = env in ("1", "true", "yes")
|
||||
self.headless = config.get_bool("OPENCLAW_BROWSER_HEADLESS", default=False)
|
||||
else:
|
||||
self.headless = headless
|
||||
self.artifacts_dir = artifacts_dir
|
||||
|
||||
Reference in New Issue
Block a user