@@ -484,6 +484,77 @@ def test_byteplus_piagent_dockerfile_prefers_official_github_then_mirror() -> No
484484 )
485485
486486
487+ def test_byteplus_codex_runtime_uses_byteplus_image_and_dependencies () -> None :
488+ project = generate_project_from_draft (
489+ AgentDraft (
490+ name = "byteplus-codex" ,
491+ cloudProvider = "byteplus" ,
492+ runtime = "codex" ,
493+ )
494+ )
495+ files = _file_map (project )
496+ agent_py = files ["agents/byteplus_codex/agent.py" ]
497+ dockerfile = files ["Dockerfile" ]
498+ requirements = files ["requirements.txt" ]
499+
500+ assert dockerfile .startswith (
501+ "FROM agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/"
502+ "base/py-simple:python3.12-bookworm-slim-latest"
503+ )
504+ assert "RUN uv pip install -r requirements.txt" in dockerfile
505+ assert "repo.huaweicloud.com" not in dockerfile
506+ assert 'runtime="codex"' in agent_py
507+ assert "'cloudProvider': 'byteplus'" in agent_py
508+ assert "'runtime': 'codex'" in agent_py
509+ assert "openai-codex==0.1.0b3" in requirements
510+ assert "openai-codex-cli-bin==0.137.0a4" in requirements
511+
512+
513+ def test_byteplus_loop_root_with_piagent_child_preinstalls_binary_and_disables_bff_tools () -> (
514+ None
515+ ):
516+ project = generate_project_from_draft (
517+ AgentDraft (
518+ name = "byteplus-loop" ,
519+ cloudProvider = "byteplus" ,
520+ agentType = "loop" ,
521+ subAgents = [
522+ AgentDraft (
523+ name = "worker" ,
524+ cloudProvider = "byteplus" ,
525+ instruction = "Work." ,
526+ runtime = "piagent" ,
527+ )
528+ ],
529+ )
530+ )
531+ files = _file_map (project )
532+ agent_py = files ["agents/byteplus_loop/agent.py" ]
533+ app_py = files ["app.py" ]
534+ dockerfile = files ["Dockerfile" ]
535+
536+ assert dockerfile .startswith (
537+ "FROM agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/"
538+ "base/py-simple:python3.12-bookworm-slim-latest"
539+ )
540+ assert (
541+ 'PIAGENT_BINARY_BASE_URLS="https://github.com/earendil-works/pi/releases/download '
542+ 'https://ghfast.top/https://github.com/earendil-works/pi/releases/download"'
543+ in dockerfile
544+ )
545+ assert "ENV PIAGENT_BINARY=/opt/piagent/pi/pi" in dockerfile
546+ assert 'runtime="piagent"' in agent_py
547+ assert "'cloudProvider': 'byteplus'" in agent_py
548+ assert "'runtime': 'piagent'" in agent_py
549+ assert 'os.environ.setdefault("PIAGENT_BINARY", "/opt/piagent/pi/pi")' in app_py
550+ assert app_py .index ('os.environ.setdefault("PIAGENT_BINARY"' ) < app_py .index (
551+ "from agents.byteplus_loop.agent import"
552+ )
553+ assert '"enable_studio_tools": True' in app_py
554+ assert 'if not hasattr(_root_tools, "append"):' in app_py
555+ assert '_app_options["enable_studio_tools"] = False' in app_py
556+
557+
487558def test_codegen_disables_studio_bff_tools_for_toolless_orchestrator_root () -> None :
488559 project = generate_project_from_draft (
489560 AgentDraft (
0 commit comments