revert: computer-use cua-driver (PR #16919) (#16927)

Reverts PR #16919 (commits dad10a78d, 413ee1a28, b4a8031b2, afb958829)
which was merged prematurely. Restoring the pre-merge state so #14817
and #15328 can be revisited as standing PRs.

Reverted commits:
- afb958829 fix(computer-use): harden image-rejection fallback + AUTHOR_MAP
- b4a8031b2 fix(computer-use): unwrap _multimodal tool results
- 413ee1a28 feat(computer-use): background focus-safe backend
- dad10a78d feat(computer-use): cua-driver backend, universal any-model schema

Co-authored-by: teknium1 <teknium@users.noreply.github.com>
This commit is contained in:
Teknium
2026-04-28 01:57:21 -07:00
committed by GitHub
parent cf0852f92e
commit e63364b8df
27 changed files with 35 additions and 3536 deletions

View File

@@ -95,31 +95,13 @@ class TestEstimateMessagesTokensRough:
assert result == (len(str(msg)) + 3) // 4
def test_message_with_list_content(self):
"""Vision messages with multimodal content arrays.
Image parts are counted at a flat ~1500-token rate per image
rather than counting the base64 char length, so a tiny stub
payload still registers as full image cost.
"""
"""Vision messages with multimodal content arrays."""
msg = {"role": "user", "content": [
{"type": "text", "text": "describe"},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,AAAA"}}
]}
result = estimate_messages_tokens_rough([msg])
# Flat cost = 1500 per image plus the small text overhead. Allow
# a small band so this isn't a change-detector for the exact
# string representation.
assert 1500 <= result < 2000
def test_message_with_huge_base64_image_stays_bounded(self):
"""A 1MB base64 PNG must not explode to ~250K tokens."""
huge = "A" * (1024 * 1024)
msg = {"role": "tool", "tool_call_id": "c1", "content": [
{"type": "text", "text": "x"},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{huge}"}},
]}
result = estimate_messages_tokens_rough([msg])
assert result < 5000
assert result == (len(str(msg)) + 3) // 4
# =========================================================================