Skip to content

Commit c2db340

Browse files
committed
Merge remote-tracking branch 'origin/main' into light-mode
# Conflicts: # Cargo.lock # Cargo.toml # crates/browser-use-tui/Cargo.toml
2 parents cca0da2 + 1a37c58 commit c2db340

235 files changed

Lines changed: 84638 additions & 64369 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 86 additions & 462 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[workspace]
22
members = [
3+
"crates/browser-use-agent",
34
"crates/browser-use-browser",
45
"crates/browser-use-cli",
5-
"crates/browser-use-core",
6+
"crates/browser-use-llm",
67
"crates/browser-use-providers",
78
"crates/browser-use-python-worker",
89
"crates/browser-use-protocol",
@@ -19,12 +20,16 @@ version = "0.1.2"
1920
[workspace.dependencies]
2021
anyhow = "1"
2122
arboard = "3.6.1"
23+
async-trait = "0.1"
2224
base64 = "0.22"
2325
bm25 = "2.3.2"
26+
bytes = "1"
2427
chrono = { version = "0.4", default-features = false, features = ["clock"] }
2528
clap = { version = "4", features = ["derive"] }
2629
crossterm = "0.29"
30+
futures-util = "0.3"
2731
ignore = "0.4"
32+
rand = "0.9"
2833
iana-time-zone = "0.1"
2934
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "webp"] }
3035
ratatui = { version = "0.30", default-features = false, features = ["crossterm_0_29"] }
@@ -39,6 +44,9 @@ sha2 = "0.10"
3944
similar = "2.7.0"
4045
tempfile = "3"
4146
terminal-colorsaurus = "0.4"
47+
thiserror = "1"
48+
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
49+
tokio-util = "0.7"
4250
toml = "0.8"
4351
tree-sitter = "0.25.10"
4452
tree-sitter-bash = "0.25"

DECISIONS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# DECISIONS.md — settled choices & sanctioned divergences
2+
3+
Decision log for the rearchitecture (see `REARCHITECTURE.md`, `IMPLEMENTATION_PLAN.md`).
4+
Append new entries as they're made.
5+
6+
## Sanctioned divergences from codex (intentional — preserve, justify, test)
7+
- **D-DIV-1 Multi-provider** instead of OpenAI-only (the product needs OpenAI/Anthropic/local).
8+
- **D-DIV-2 SQLite as a write-only sink, not a hot loader.** Dump events/state to SQLite for durability + debuggability + resume, but keep runtime state **in-memory**; **never read/poll SQLite on the hot path**; read it **only on resume**. (Reading it hot is "slow as hell".)
9+
- **D-DIV-3 Sync/serial `view_image`** — blocking read, never parallel with browser actions, so screenshots are observed in order.
10+
- **D-DIV-4 Browser + Python tool surface** (our product; browser layer = `browser-harness-js`, treated as a black box).
11+
- **D-DIV-5 Drop the codex/ChatGPT backend** entirely (server-side, can't use) — its headers/OAuth/identifiers go with it.
12+
13+
Everything else = **EXTREME PARITY** with codex (mechanism, heuristics, thresholds, outputs), proven by tests.
14+
15+
## Settled open questions
16+
- **D-1 Context messages:** align with codex's typed `reference_context` mechanism for parity; our extra kinds (permissions/personality/goal/collaboration/hook/mention/generated-image/browser) become additional typed items. *(User: "sure whatever" → pick the parity-aligned option.)*
17+
- **D-2 Subagent wait:** **event-notify** (in-memory mailbox notification), not the 50ms SQLite poll. Messages still dumped to SQLite for the record. *(User: "I prefer event-notify"; consistent with D-DIV-2.)*
18+
- **D-3 Crate granularity:** engine = one `browser-use-core` crate with submodules; separate crates for `browser-use-llm`, `browser-use-mcp`, `browser-use-sandbox`, `browser-use-guardian`. *(User: "whatever you think is prettier".)*
19+
- **D-4 Async migration order:** top-down (runtime → loop → tools) behind the frozen Phase-0 interfaces, optimized for **correctness + testability, not speed**. *(User: "whatever will make you implement BETTER … focus is NOT speed … everything gets done, run and tested".)*
20+
- **D-5 v1 providers:** OpenAI (Responses), Anthropic (Messages + Claude-Code OAuth), Ollama, **DeepSeek, OpenRouter, Fireworks** (via the `openai-chat` protocol where compatible). The protocol × provider design makes additional providers config-only — added freely later.
21+
22+
## Process decisions
23+
- **D-P-1 No human in the loop.** The orchestrating agent does all coordination, review, gating, and the serial carve.
24+
- **D-P-2 Tests first, commit first.** Each WP commits parity/e2e tests before implementing; frequent working-increment commits; Phase 0 commits per extraction step.
25+
- **D-P-3 Run-and-test, not compile-only.** Acceptance = behavior runs + tests pass against a **live model**. E2E uses the **existing codex auth** as the live-model vehicle during the build (revisit once OpenAI/Anthropic direct auth is wired — see `IMPLEMENTATION_PLAN.md` §5).
26+
- **D-P-4 Goal = completeness over speed.** Parallelism is for isolation/depth, not finishing fast.

IMPLEMENTATION_PLAN.md

Lines changed: 298 additions & 0 deletions
Large diffs are not rendered by default.

REARCHITECTURE.md

Lines changed: 224 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[package]
2+
name = "browser-use-agent"
3+
edition.workspace = true
4+
license.workspace = true
5+
version.workspace = true
6+
7+
# The new async agent engine (rearchitecture Milestone 3, strategy B: parallel
8+
# rewrite). Built alongside the legacy sync `browser-use-core`; ported
9+
# subsystem-by-subsystem on top of the async `browser-use-llm`, with the TUI/CLI
10+
# cut over to it only at the end. WP-A0 lands the frozen compiling scaffold.
11+
12+
[dependencies]
13+
browser-use-browser = { path = "../browser-use-browser" }
14+
browser-use-llm = { path = "../browser-use-llm" }
15+
browser-use-providers = { path = "../browser-use-providers" }
16+
browser-use-protocol = { path = "../browser-use-protocol" }
17+
browser-use-python-worker = { path = "../browser-use-python-worker" }
18+
browser-use-store = { path = "../browser-use-store" }
19+
anyhow.workspace = true
20+
async-trait.workspace = true
21+
base64.workspace = true
22+
bm25.workspace = true
23+
rand.workspace = true
24+
regex.workspace = true
25+
reqwest = { workspace = true, features = ["stream"] }
26+
rustls.workspace = true
27+
serde.workspace = true
28+
serde_json.workspace = true
29+
sha2.workspace = true
30+
thiserror.workspace = true
31+
toml.workspace = true
32+
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "process", "io-util", "sync", "time", "net"] }
33+
tokio-util.workspace = true
34+
futures-util.workspace = true
35+
portable-pty.workspace = true
36+
37+
[dev-dependencies]
38+
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "sync", "time"] }
39+
tempfile.workspace = true
40+
41+
[features]
42+
# Opt-in flag gating the live multi-provider smoke test so it is never compiled
43+
# into the default `cargo test` binary. The live call needs a real provider key
44+
# in the environment (OPENAI_API_KEY / ANTHROPIC_API_KEY / LLM_BROWSER_*). Run:
45+
# cargo test -p browser-use-agent --features live -- --ignored live_model_smoke
46+
live = []

0 commit comments

Comments
 (0)