Skip to content

Releases: pghoya2956/toss-browser-bridge

v0.4.2 — headless + lean Chrome (리소스 절감)

Choose a tag to compare

@pghoya2956 pghoya2956 released this 17 Jun 00:35
c124ef7

추가

브라우저는 토스 화면을 렌더하지 않고 in-page fetch(credentials:include)로 cert API를 직접 호출 + App-Version 서명 호스트 역할만 한다. 따라서 렌더링은 순수 오버헤드 → opt-in 토글로 제거 가능.

  • TOSS_BRIDGE_HEADLESS=on — headless 기동(창 없음)
  • TOSS_BRIDGE_LEAN=on — GPU·이미지 디코드·확장 비활성 경량 플래그

둘 다 기본 off, 미설정 시 현행(headed)과 동일(하위호환).

실측 (PR #4 Phase 2)

  • headless+lean에서 토스 차단 없음, 조회 4종(account/positions/quote/completed) 정상
  • Chrome RSS 6916.7MB → 1062.6MB (~85%↓)

운영 주의

headless는 세션 만료 시 재로그인(인증서/2FA) UI를 못 띄운다 → headed 1회 로그인 → headless 재기동 하이브리드 권장.

v0.4.1

Choose a tag to compare

@pghoya2956 pghoya2956 released this 31 May 18:28
  • Fix positions lookup by requesting Toss SORTED_OVERVIEW asset section.\n- Treat health positions_ready as false when Toss returns empty sections.\n- Includes prior 0.4.1 market limit_price auto-fill and submit_blocked idempotency skip changes.

v0.4.0 — payload pass-through framework

Choose a tag to compare

@pghoya2956 pghoya2956 released this 05 May 14:26
60b54f9

Highlights

  • Payload pass-through framework — bridge 가 정책성 boolean/enum flag 를 hardcoded 가 아닌 외부 인자로 받아 그대로 transport. AI Native 정공 (bridge transport / wrapper enum→bool / SKILL 결정).
  • 1차 적용 = isReservationOrder — KRX 휴장 / 정규장 분기 자동 처리.
  • /api/v2/wts/trading/order/create/direct endpoint fix — KRX 휴장 시 broker create 거절 (HTTP 400 / DC-3850) 결함 해소.
  • _market_status_issue 화이트리스트 fix — "N" 제거 (정규장/휴장 모두 "N" default 인 토스 wts API 한계 대응).

Breaking changes

없음 (backward compat). signature 모두 default None 으로 기존 호출자 영향 0.

CLI 신규 인자

toss-bridge place-order --reservation-mode {auto, on, off} ...
  • auto (default) — 인자 omit. bridge 내부는 Optional[bool] 그대로 (None → False).
  • onis_reservation_order=True. KRX 휴장 / 정규장 외 시점에 다음 거래일 예약.
  • offis_reservation_order=False. 정규장 즉시 체결 강제 (시장 closed 시 broker reject 가능).

Supervised live 검증

pghoya2956/financier-v2 tasks/20260505-toss-bridge-payload-passthrough/ Phase 5 양쪽 path 통과:

P5-01 reservation=on (KRX 휴장)

  • broker_ack is_reserved: true, code: OK, http_status: 200, order_no: 251199

P5-02 reservation=off user_override (NYSE 정규장)

  • broker_ack is_reserved: false, code: OK, http_status: 200, order_no: 5
  • 실 체결 (position +1주 + cash -$31.49)

OQ-04 자연 capture

  • 토스 wts derived.market_status 가 정규장/휴장 모두 "N" default 인 통찰 확보 — 화이트리스트 보강만으론 불충분, 시간 기반 lookup 정공 (follow-up task)

Tests

  • env -u TOSS_BRIDGE_PORT -u TOSS_BRIDGE_HOME uv run pytest tests/86 passed, 1 skipped (회귀 0)
  • _market_status_issue 회귀 10건 추가 — "N" 제거 정합 확인

Upgrade

uv tool upgrade toss-browser-bridge
toss-bridge shutdown && toss-bridge health
# health 응답에서 bridge_version: 0.4.0 확인

What's Changed

  • feat(payload-passthrough): isReservationOrder pass-through P1-02~06
  • test(submit-runtime): P1-07 isReservationOrder pass-through + _market_status_issue 회귀 10건
  • chore(version): 0.3.0 → 0.4.0
  • chore(toss-bridge): P6-01.1 diagnostic — /create/direct + body schema match

Full Changelog: v0.3.0...v0.4.0

v0.3.0 — Phase 2 market order 분기 (US 단일 흐름)

Choose a tag to compare

@pghoya2956 pghoya2956 released this 04 May 16:17
f69ab99

요약

Phase 0 P0-02 결정적 발견 ("토스 미국주식 시장가 UI = client-level 추상화. API 는 `orderPriceType="00"` 단일") 반영. 별도 market endpoint 코드 작성 없이 limit 흐름 재사용. PR #2 merge.

변경

  • P2-01: validate_place_order_params limit-only 가드 → ORDER_TYPES_SUPPORTED = {limit, market} 체크
  • P2-02: resolve_order_price_type(market_bucket, order_type) 신규 — US+market → "00" (P0-02 확정), KR+market → "03" placeholder
  • P2-06: 단위 테스트 4건 신규 + 1건 정정 (32 PASS)

P0-02 정책 박제

  • US market 은 client-level 추상화로 API limit 단일 흐름. 추측 코드 없음
  • KR market 의 "03" 은 placeholder. Phase 6 supervised capture 까지 미검증 명시
  • limit_price 는 limit/market 모두 필수 (market 도 SKILL 이 NBBO 가격 채움)

단위 테스트

  • 75 PASS / 1 skipped / 1 무관 fail (bridge_lib.PORT 환경 분리)

다음

financier-v2 측 wrapper Phase 4 진입 가능 (scripts/toss-mcp/server.py).

🤖 Generated with Claude Code

v0.2.0 — Phase 1 final create POST 활성화

Choose a tag to compare

@pghoya2956 pghoya2956 released this 04 May 16:09
53fd337

요약

place-order 의 broker create POST 봉인을 풀고, 디폴트 OFF 가드 (TOSS_BRIDGE_ENABLE_FINAL_SUBMIT) 를 유지한 신규 마이너 릴리즈. 사용자 명시 enable 없이는 라이브 호출 발생 X. PR #1 merge.

변경

  • P1-01: _run_prepare_preflight 봉인 raise 제거 + _run_broker_create skeleton 추가. place_order_final_submit_enabled 가드 분기
  • P1-02: BROKER_REJECTED_* enum 9건 + classify_broker_reject(message, status_code, error) 함수 + timeout/HTTP status 분기 정밀화
  • P1-03: BROKER_ACK_ALLOWED_FIELDS 9 → 15필드 (broker_order_id, order_no, order_date, is_reserved, http_status, guard_reason 추가)
  • P1-04: place_order submit 직후 auto_verify=True hook + --auto-verify CLI flag (디폴트 OFF — 외부 polling 과 중복 회피)
  • P1-05: 단위 테스트 5건 — broker create mock fixture (success/missing-orderId/timeout) + classify_broker_reject 분기 + auto_verify aggregator
  • P1-06: health 응답 top-level bridge_version 필드 노출 (importlib.metadata 기반, pyproject ↔ __version__daemon.BRIDGE_VERSION 3중 동기)

정책 박제

  • TOSS_BRIDGE_ENABLE_FINAL_SUBMIT 디폴트 OFF 영구 유지 — supervised live validation 통과 후에도 디폴트 ON 전환 안 함
  • PYTEST_CURRENT_TEST 환경에서는 추가 가드 (TOSS_BRIDGE_ALLOW_TEST_FINAL_SUBMIT) 도 set 해야 봉인 우회
  • live e2e 봉인 유지tests/test_live_e2e.py 의 final submit 테스트는 그대로 skipped

RQ-01 idempotency 결정

broker create idempotency 토스 측 미문서. 본 릴리즈 보수적 채택:

  • _fetch_many RuntimeError timeout → 즉시 BROKER_REJECTED_TIMEOUT 반환, 자동 재시도 X
  • 동일 mutation_id 재발행은 wrapper / SKILL 레이어에서 차단

단위 테스트

  • 70 PASS / 1 skipped / 1 무관 fail (bridge_lib.PORT 환경 분리 — 42184 격리 stack vs 42194 public, 본 릴리즈와 무관)

다음

financier-v2 측 wrapper(P4-06) startup 시 bridge_version minimum 검증 후 supervised P6 진입 (사용자 PC + 정규장 + 4건 supervised: limit buy / limit sell / market sell / fx KRW→USD).

🤖 Generated with Claude Code