배경
OpenChrome은 DOM mode에 compact serializer와 delta compression이 있지만, AX mode는 큰 accessibility tree를 그대로 포맷한 뒤 output limit에서 truncate하거나 명시적 DOM fallback을 수행한다. agent-browser는 AX snapshot에서 compact, maxDepth, selector, diff_snapshot을 제공해 ref/value 중심으로 토큰을 줄인다.
목표
read_page mode="ax"에 opt-in compact/delta 기능을 추가해 AX 기반 워크플로우의 토큰 사용량을 줄인다.
구현 범위
read_page 입력 schema에 AX 전용 compact?: boolean을 추가한다.
mode="ax" compact=true일 때 다음 라인만 보존한다.
- ref가 있는 interactive/content node 라인
- value/name/state가 의미 있게 있는 라인
- 위 라인들의 ancestor 라인
- 기존
filter="interactive", depth, ref_id, fallback 동작과 조합 가능해야 한다.
compression="delta"가 mode="ax"에서도 동작하도록 AX snapshot cache key를 DOM cache와 분리한다.
- delta가 noisy하거나 변화율이 큰 경우 기존처럼 full compact AX로 fallback한다.
비범위
- 기본 AX 출력 포맷 변경
- DOM mode delta 알고리즘 대규모 교체
- LLM 요약 기반 compression 도입
성공 기준
compact=false 또는 미지정 시 기존 AX 출력이 유지된다.
compact=true는 fixture 기준 AX 출력 문자 수를 baseline 대비 최소 30% 줄이되, 모든 ref-bearing interactive line은 유지한다.
compression="delta"는 같은 URL/같은 tab의 반복 AX read에서 변경분만 반환한다.
- URL 변경, 대규모 DOM 변경, cache miss에서는 full snapshot으로 안전하게 fallback한다.
테스트 계획
단위/통합 테스트
- AX fixture/mock으로 다음을 검증한다.
- no-ref wrapper만 있는 가지는 compact 결과에서 제거된다.
- ref가 있는 버튼/링크와 ancestor는 유지된다.
- checked/disabled/expanded/selected 등 상태 라인은 유지된다.
ref_id scoped AX read에서도 compact가 적용된다.
- AX delta store가 DOM snapshot store와 key collision을 일으키지 않는지 테스트한다.
- 기존
read_page mode="ax" 테스트가 변경 없이 통과해야 한다.
OpenChrome 실검증
- local fixture에 깊은 wrapper 구조와 버튼/입력/상태 변화 요소를 만든다.
read_page baseline:
{"tabId":"<tab>","mode":"ax","filter":"all"}
- compact read:
{"tabId":"<tab>","mode":"ax","filter":"all","compact":true}
- compact 결과가 baseline보다 짧고, 버튼/입력 ref와 ancestor 문맥은 유지되는지 확인한다.
- 버튼 클릭 또는 JS로 상태 변경 후:
{"tabId":"<tab>","mode":"ax","compact":true,"compression":"delta"}
- 결과가 변경된 라인 중심의 delta를 반환하는지 확인한다.
- 다른 URL로 이동 후 같은 호출이 full snapshot으로 fallback하는지 확인한다.
리스크와 완화
- 리스크: compact가 문맥을 너무 많이 제거해 LLM이 의미를 잃을 수 있다.
- 완화: ancestor 라인은 항상 보존하고 기본값은 opt-in으로 둔다.
- 리스크: AX tree line diff는 DOM보다 순서 변동이 커 noisy할 수 있다.
- 완화: 변화율 threshold를 두고 초과 시 full compact AX 반환.
Curated scope, overlap handling, and verification checklist
Scope classification
- Canonical lane: page-state reading and semantic observation.
- Primary deliverable: Add compact and delta modes for AX read_page snapshots.
- Open PR: none currently linked in the active priority map; verify GitHub again before implementation.
- Detected labels: enhancement, performance.
- Affected OpenChrome surfaces from issue text:
read_page, act, interact.
- Non-goal: breaking existing tool response compatibility, changing defaults without opt-in, or adding server-side autonomous planning.
Overlap and conflict resolution
Implementation checklist
Success criteria
Post-merge OpenChrome live verification checklist
배경
OpenChrome은 DOM mode에 compact serializer와 delta compression이 있지만, AX mode는 큰 accessibility tree를 그대로 포맷한 뒤 output limit에서 truncate하거나 명시적 DOM fallback을 수행한다.
agent-browser는 AX snapshot에서compact,maxDepth,selector,diff_snapshot을 제공해 ref/value 중심으로 토큰을 줄인다.목표
read_page mode="ax"에 opt-in compact/delta 기능을 추가해 AX 기반 워크플로우의 토큰 사용량을 줄인다.구현 범위
read_page입력 schema에 AX 전용compact?: boolean을 추가한다.mode="ax" compact=true일 때 다음 라인만 보존한다.filter="interactive",depth,ref_id,fallback동작과 조합 가능해야 한다.compression="delta"가mode="ax"에서도 동작하도록 AX snapshot cache key를 DOM cache와 분리한다.비범위
성공 기준
compact=false또는 미지정 시 기존 AX 출력이 유지된다.compact=true는 fixture 기준 AX 출력 문자 수를 baseline 대비 최소 30% 줄이되, 모든 ref-bearing interactive line은 유지한다.compression="delta"는 같은 URL/같은 tab의 반복 AX read에서 변경분만 반환한다.테스트 계획
단위/통합 테스트
ref_idscoped AX read에서도 compact가 적용된다.read_page mode="ax"테스트가 변경 없이 통과해야 한다.OpenChrome 실검증
read_pagebaseline:{"tabId":"<tab>","mode":"ax","filter":"all"}{"tabId":"<tab>","mode":"ax","filter":"all","compact":true}{"tabId":"<tab>","mode":"ax","compact":true,"compression":"delta"}리스크와 완화
Curated scope, overlap handling, and verification checklist
Scope classification
read_page,act,interact.Overlap and conflict resolution
Implementation checklist
Success criteria
Post-merge OpenChrome live verification checklist