feat!: GAPT 컨테이너 샌드박스 제거 → XGeny 실행 세션 (3.0.0) - #2
Merged
Conversation
XGEN 은 GAPT 와 무관하다. 그런데 샌드박스 표면 전체가 GAPT 의 `docker exec`
전제 위에 얹혀 있었고, **XGEN 의 어떤 호스트도 그것을 쓰지 않았다** —
xgen-workflow 가 런타임에서 가져오는 것을 전수 확인한 결과 `tools._sandbox`,
`sandbox_exec_tool`, `build_container_cli_client`, `ContainerCLIRunner`
사용처 0건. 남겨 두면 새 실행 기반을 그 위에 또 얹게 된다.
제거
- tools/_sandbox.py — docker exec 전송 + 호스트↔컨테이너 경로 변환 3종
- ContainerCLIRunner / SandboxHandle / build_container_cli_client
- Pipeline.attach_runtime(containerize_cli=) — 샌드박스가 LLM 클라이언트의
스폰 방식을 바꾸던 결합. 이제 어떤 프로바이더든 클라이언트는 호스트에서
돌고, 샌드박스에는 도구를 통해서만 닿는다. 백엔드마다 격리 방식이 갈리면
"이 백엔드에서만 되는 도구"가 생긴다.
추가 — tools/_xgeny_sandbox.py
- XgenySandbox 프로토콜(workdir + async ensure/exec/read_bytes/write_bytes)
- 파일 읽기·쓰기가 1급 연산이다. GAPT 는 cat / sh -c 'cat > …' 서브프로세스로
흉내냈는데, 그러면 파일 하나 읽는 데 프로세스가 뜨고 "없는 파일"과
"권한 없음"이 똑같이 "명령 실패"로 뭉개진다.
- 경로 가드가 sandbox_path 한 곳에 있다 — 세션 밖으로 나가는 경로는 전부
여기를 지난다. 도구마다 각자 막으면 새 도구가 매번 빠뜨린다.
- 경로 변환 계층이 없다: 호스트가 양쪽 루트를 같은 문자열로 맞춘다.
변경
- 내장 도구 7종(Bash/Read/Write/Edit/Glob/Grep/workspace_*)이 새 프리미티브를
쓴다. 분기 조건(if context.sandbox is not None)은 그대로 — 앞으로 추가될
도구도 같은 자리에서 갈라진다.
- SandboxExecTool 이 XgenySandbox 로 실행한다 (계약·직렬화 형식 불변).
4,732 passed, 15 skipped, ruff clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
왜
XGEN 은 GAPT 와 무관하다. 그런데 샌드박스 표면 전체가 GAPT 의
docker exec전제 위에 얹혀 있었고, XGEN 의 어떤 호스트도 그것을 쓰지 않았다. xgen-workflow 가 런타임에서 import 하는 것을 전수 확인한 결과tools._sandbox,sandbox_exec_tool,build_container_cli_client,ContainerCLIRunner사용처 0건.남겨 두면 새 실행 기반(xgen-workflow-sandbox)을 그 위에 또 얹게 된다.
제거 (BREAKING)
tools/_sandbox.py— docker exec + 경로 변환 3종ContainerCLIRunner/SandboxHandlebuild_container_cli_clientattach_runtime(containerize_cli=)attach_runtime(containerize_cli=)은 샌드박스가 LLM 클라이언트의 스폰 방식을 바꾸던 결합이었다. 이제 어떤 프로바이더든 클라이언트는 호스트에서 돌고 샌드박스에는 도구를 통해서만 닿는다 — 백엔드마다 격리 방식이 갈리면 "이 백엔드에서만 되는 도구"가 생긴다.추가 —
tools/_xgeny_sandbox.pycat/sh -c 'cat > …'서브프로세스로 흉내냈는데, 그러면 파일 하나 읽는 데 프로세스가 뜨고 "없는 파일"과 "권한 없음"이 똑같이 "명령 실패"로 뭉개진다.sandbox_path)에 있다. 세션 밖으로 나가는 경로는 전부 여기를 지난다 — 도구마다 각자 막으면 새 도구가 매번 빠뜨린다.변경
내장 도구 7종(Bash/Read/Write/Edit/Glob/Grep/workspace_*)이 새 프리미티브를 쓴다. 분기 조건(
if context.sandbox is not None)은 그대로 — 앞으로 추가될 도구도 같은 자리에서 갈라진다.Migration
호스트는
container_name대신workdir을 갖고exec/read_bytes/write_bytes를 구현하는 객체를ToolContext.sandbox에 넘긴다. 경로 변환은 필요 없다.검증
4,732 passed, 15 skipped, ruff clean. 활성 코드의
docker exec/container_name0건.🤖 Generated with Claude Code