ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • GEODE: Computer Use 다중 프로바이더 지원
    Harness/tools 2026. 4. 7. 10:24

    Anthropic computer_20251124와 OpenAI computer_use_preview.
    프로토콜은 다르지만 실행 하네스는 같습니다.
    @ant/computer-use-swift가 비공개인 상황에서
    PyAutoGUI로 동일한 기능을 구현한 기록입니다.

    Date: 2026-04-07
    Author: geode-team
    Tags: computer-use, anthropic, openai, pyautogui, desktop-automation, tool-use


    목차

    1. 도입: 화면을 보고 클릭하는 에이전트
    2. 프론티어 비교 — 누가 어떻게 구현하는가
    3. Claude Code의 비공개 스택 역공학
    4. 하네스 설계 — 하나로 두 프로바이더
    5. 좌표 변환과 스크린샷 압축
    6. Safety Gate — DANGEROUS HITL
    7. 마무리

    1. 도입: 화면을 보고 클릭하는 에이전트

    Computer Use는 LLM이 스크린샷을 보고, 마우스와 키보드를 조작하는 기능입니다. 브라우저 자동화(Playwright, Puppeteer)와 근본적으로 다릅니다 — DOM selector가 아닌 픽셀 좌표로 동작합니다. Excel 스프레드시트도, Slack 데스크톱 앱도, 터미널도 제어할 수 있습니다.
    2026년 4월 기준, Anthropic과 OpenAI 모두 Computer Use API를 제공합니다. 하지만 두 프로바이더의 프로토콜이 다르고, 실행 하네스(로컬에서 실제로 클릭하는 코드)는 개발자가 직접 구현해야 합니다.
    이 글은 GEODE에서 하나의 하네스로 양쪽 프로바이더를 지원하도록 구현한 과정을 기록합니다.


    2. 프론티어 비교 — 누가 어떻게 구현하는가

    벤치마크 현황 (2026-04)

    Claude Opus 4.672.7%전체 데스크톱독립 평가 (xlang.ai)
    Claude Sonnet 4.672.5%전체 데스크톱독립 평가
    GPT-5.475.0% (self-reported)브라우저 중심OpenAI 자체 평가 (OSWorld-Verified)
    Human baseline72.4% 

    Anthropic은 xlang.ai의 독립 평가를 받았고, OpenAI는 자체 평가(OSWorld-Verified)입니다.
    독립 검증 전까지 직접 비교는 어렵지만, 양쪽 모두 인간 수준에 근접했습니다.

    아키텍처 차이

      Anthropic OpenAI Google (Mariner)
    Tool type computer_20251124 computer_use_preview Project Mariner
    범위 전체 데스크톱 브라우저 중심 웹 + 모바일
    API Messages API (beta) Responses API Gemini API
    Action 형식 tool_use(action, coordinate) computer_call(actions[]) 비공개
    하네스 개발자 구현 개발자 구현 클라우드 VM

    실행 하네스(screenshot + click)는 프로바이더와 무관하게 동일합니다.
    LLM이 "좌표 (640, 400)을 클릭해"라고 말하면, 하네스는 그냥 클릭합니다.
    프로바이더 차이는 API 프로토콜에만 있습니다.

     


    3. Claude Code의 비공개 스택 역공학

    Claude Code는 @ant/computer-use-swift@ant/computer-use-input이라는 비공개 NAPI 바이너리를 사용합니다.

    utils/computerUse/
    ├── executor.ts          ← 핵심: 모든 input/output 오퍼레이션
    ├── swiftLoader.ts       ← @ant/computer-use-swift 로딩
    ├── inputLoader.ts       ← @ant/computer-use-input (Rust/enigo)
    ├── mcpServer.ts         ← in-process MCP 서버
    ├── drainRunLoop.ts      ← CFRunLoop 펌프 (@MainActor 호출용)
    ├── computerUseLock.ts   ← 파일 기반 세션 락
    └── gates.ts             ← 구독 게이팅 (Max/Pro only)

    @ant/computer-use-swift는 Anthropic 내부 monorepo 패키지입니다.
    Claude Code CLI에도 Desktop App에도 바이너리가 포함되어 있지 않습니다.
    feature flag(tengu_malort_pedway) + Max/Pro 구독 뒤에 잠겨있으며,
    서버사이드에서 on-demand 배포되는 것으로 추정됩니다.

    역공학 결론: 바이너리 접근 불가. 오픈소스 대안 필요.

    기능 @ant/computer-use-swift PyAutoGUI (대안)
    스크린샷 ScreenCaptureKit (macOS native) pyautogui.screenshot()
    마우스 CGEvent dispatch pyautogui.click()
    키보드 enigo (Rust NAPI) pyautogui.typewrite()
    성능 네이티브, 60fps 애니메이션 충분 (50ms 간격)
    크로스플랫폼 macOS only macOS + Linux + Windows

    4. 두 프로바이더를 지원하기 위한 Computer-use 하네스

    통합 디스패치

    # core/tools/computer_use.py
    class ComputerUseHarness:
        def execute(self, action: str, **params: Any) -> dict[str, Any]:
            handlers = {
                "screenshot": lambda: self.screenshot(),
                "click": lambda: self.click(params["x"], params["y"]),
                "type": lambda: self.type_text(params["text"]),
                "key": lambda: self.key(params["keys"]),
                "scroll": lambda: self.scroll(params["x"], params["y"], params["direction"]),
                # Anthropic aliases
                "left_click": lambda: self.click(params["x"], params["y"], "left"),
                "right_click": lambda: self.click(params["x"], params["y"], "right"),
                "cursor_position": lambda: self._get_cursor_position(),
            }

     

    execute()는 action 이름으로 디스패치합니다.
    Anthropic의 left_click, right_click 같은 alias도 지원합니다.
    모든 action은 실행 후 스크린샷을 반환 — LLM이 결과를 보고 다음 action을 결정합니다.

    API 주입

    Anthropic과 OpenAI 각각의 adapter에서 native tool을 주입합니다:

    # core/llm/providers/anthropic.py
    if is_computer_use_enabled() and "computer" not in existing_names:
        api_tools.append({
            "type": "computer_20251124",
            "name": "computer",
            "display_width_px": 1280,
            "display_height_px": 800,
        })
    
    # core/llm/providers/openai.py
    if is_computer_use_enabled():
        oai_tools.append({
            "type": "computer_use_preview",
            "display_width": 1280,
            "display_height": 800,
            "environment": "mac",
        })

    is_computer_use_enabled()는 GEODE_COMPUTER_USE_ENABLED=true 환경변수와
    pyautogui 설치 여부를 확인합니다. 양쪽 조건이 충족되어야 tool이 주입됩니다.


    5. 좌표 변환과 스크린샷 압축

    LLM은 1280x800 해상도의 스크린샷을 봅니다. 실제 화면은 2560x1600(Retina)일 수 있습니다.

    def _scale_to_screen(self, x: int, y: int) -> tuple[int, int]:
        """LLM 좌표(1280x800) → 실제 화면 좌표."""
        sx = int(x * self._screen_width / self._target_width)
        sy = int(y * self._screen_height / self._target_height)
        return sx, sy

    Anthropic의 reference 구현은 XGA(1024x768), WXGA(1280x800), FWXGA(1366x768) 중
    화면 비율에 가장 가까운 해상도를 선택합니다.
    GEODE는 1280x800 고정 — 토큰 비용($0.003/이미지)과 정밀도의 균형점입니다.

    스크린샷은 JPEG 75% 품질로 압축하여 base64 인코딩합니다. PNG 대비 약 1/5 크기.


    6. Safety Gate — DANGEROUS HITL

    Computer Use는 화면을 직접 조작합니다. 잘못된 클릭 한 번이 파일 삭제, 메시지 전송, 설정 변경을 유발할 수 있습니다.

    # core/agent/safety_constants.py
    DANGEROUS_TOOLS: frozenset[str] = frozenset({
        "run_bash",
        "computer",  # computer-use: screen control
    })

    DANGEROUS tier는 매 호출마다 유저 승인이 필요합니다.
    run_bash와 동일한 수준입니다.
    활성화도 opt-in: GEODE_COMPUTER_USE_ENABLED=true + pip install pyautogui.


    7. 마무리

    요약

    항목 내용
    하네스 ComputerUseHarness — PyAutoGUI 기반, provider-agnostic
    Anthropic computer_20251124 native tool injection
    OpenAI computer_use_preview Responses API tool injection
    안전 DANGEROUS HITL + opt-in (GEODE_COMPUTER_USE_ENABLED)
    해상도 1280x800 (JPEG 75%)
    레퍼런스 Claude Code @ant/computer-use-swift (비공개), Anthropic quickstart

    한계와 다음 단계

    • OpenAI computer_call 응답 블록의 Anthropic 형식 정규화
    • 스크린샷 region capture (전체 화면 대신 관심 영역만)
    • 드래그 앤 드롭 정밀도 개선 (현재 ease-out-cubic 없음)

    Sources:

    댓글

ABOUT ME

🎓 부산대학교 정보컴퓨터공학과 학사: 2017.03 - 2023.08
☁️ Rakuten Symphony Jr. Cloud Engineer, Full-time: 2024.12.09 - 2025.08.31
🏆 2025 AI 새싹톤 우수상 수상: 2025.10.30 - 2025.12.02
🌏 이코에코(Eco²) BE/AI(Harness)/Infra/FE 24-node E2E 고도화 및 운영, 2600만원 소모: 2025.12 - 2026.02
🪂 넥슨 AI 엔지니어(2-3년, 과제합 -> 면접 탈락), 무신사 AI-Native(전환형 인턴, 진행 X) 채용 프로세스: 2026.01.31 - 2026.03.05
🪂 GEODE/REODE 개발, Agentic Loop-based 자율 수행 하네스 + 도메인 특화 DAG(Plug-In), AI R&D Freelance @Pinxlab : 2026.03 - 2026.05

Designed by Mango