Skip to content
Open
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
4 changes: 4 additions & 0 deletions src/crates/assembly/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ openbitfun-runtime-services = { path = "../../execution/runtime-services", featu
tempfile = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "test-util"] }

[[test]]
name = "computer_use_schema"
required-features = ["agent-runtime", "tools-computer-use"]

[[test]]
name = "git_contracts"
required-features = ["git"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,7 @@ Use ExecCommand for genuine shell work, never ad hoc GUI capture, clipboard or i
let properties = schema["properties"].as_object_mut().unwrap();
properties["app"]["description"] =
json!("Known app from list_apps, or exact {pid,window_id} from list_windows on window-target-v1 hosts. Omit to keep the bound window. Use list_windows when the title is wrong or a helper has no window.");
properties["mode"]["description"] =
json!("Default background. Foreground only for a user-requested takeover.");
properties["mode"]["description"] = json!("Default background. Use foreground for the requested GUI task when background delivery is unsupported or verified ineffective, unless the user required background-only/no-disruption.");
properties["ms"]["description"] = json!("wait duration. With app or a bound window, returns that window's observation after waiting; no separate get_app_state is needed.");
properties["query"]["description"] = json!("list_windows: case-insensitive match on application name, bundle id or title across processes (finds helper processes too); includes off-screen windows.");
properties["include_offscreen"]["description"] = json!("list_windows: also list minimized/hidden/other-Space windows. Default false unfiltered (counted per app), true with app/query.");
Expand Down
32 changes: 32 additions & 0 deletions src/crates/assembly/core/tests/computer_use_schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#![cfg(all(feature = "agent-runtime", feature = "tools-computer-use"))]

use openbitfun_core::agentic::tools::{
framework::{Tool, ToolUseContext},
implementations::ComputerUseTool,
};

#[tokio::test]
async fn compact_mode_describes_conditional_foreground_for_gui_tasks() {
let tool = ComputerUseTool::new();
let mut text_only = ToolUseContext::for_tool_listing(None, None);
text_only.primary_model_facts.supports_image_inputs = false;

for schema in [
tool.input_schema_for_model().await,
tool.input_schema_for_model_with_context(Some(&text_only))
.await,
] {
let mode = schema["properties"]["mode"]["description"]
.as_str()
.expect("compact mode description");
for clause in [
"Default background",
"Use foreground for the requested GUI task",
"unsupported or verified ineffective",
"unless the user required background-only/no-disruption",
] {
assert!(mode.contains(clause), "missing {clause:?} in {mode:?}");
}
assert!(!mode.contains("user-requested takeover"), "{mode}");
}
}