Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exclude = ["examples", "tests", "docs", "scripts"]
default-members = ["ras-cli", "ras-daemon"]

[workspace.package]
version = "3.3.0"
version = "3.4.0"
edition = "2024"
rust-version = "1.95.0"
license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Multi-Tenant Phase 3 — Agent Target Binding (AR-3)

**Goal:** Agents drive an explicitly bound tab, not "the last focused tab" — removing the cross-session race. Builtins read the target from `ToolContext`; `RunAgent` can bind a target; single-user keeps the `focused_target` fallback (only in `run_step`, never in builtins).

**Repo rules:** ≤200 LOC/file, no `//` comments, no `.unwrap()` in non-test code, conventional commits.

## One cohesive change (interdependent — implement together)
- `ras-tools/src/domain/registry.rs`: add `pub target: Option<TargetId>` to `ToolContext`.
- 7 builtins (navigate, click ×2, type_text, scroll, screenshot, press_and_hold ×2): replace `let target = ctx.browser.focused_target().await?;` with `let target = ctx.target.clone().ok_or_else(|| AppError::NotFound("no active target".into()))?;`.
- `ras-agent/src/application/run_agent.rs`: add `bound_target: Option<TargetId>` field (default None) + `with_target(mut self, t: TargetId) -> Self`.
- `ras-agent/src/application/run_step.rs`: source target from the bound target first, else `focused_target().ok()`; pass it into `ToolContext.target`.
- Fix the 2 test `ToolContext` construction sites to set `target`.

**Scope note:** AR-3's "required target / no fallback" is satisfied at the builtin layer (no builtin calls `focused_target`). The single-user `focused_target` fallback survives only in `run_step`; the multi-tenant `SessionManager` (Phase 5) always binds, so MT never hits the fallback.
Loading