mirror of
https://github.com/alphaXiv/OpenResearch.git
synced 2026-11-12 10:05:24 +08:00
* OR-371 Stop the invocation gate from blocking Bash when the model is uncaptured Record tool identities from assistant events that arrive with no live turn (Claude resuming itself on background-task notifications), and fail open instead of denying when the gate still cannot find an identity. * Record between-turn identities off the Claude reader; test the uncaptured timeout
32 lines
1014 B
Rust
32 lines
1014 B
Rust
use std::io::Write;
|
|
use std::process::{Command, Stdio};
|
|
|
|
#[test]
|
|
fn uncaptured_invocation_allows_the_tool_call() {
|
|
let root = std::env::temp_dir().join(format!("orx-invocation-gate-{}", uuid::Uuid::new_v4()));
|
|
let mut child = Command::new(env!("CARGO_BIN_EXE_orx"))
|
|
.arg("invocation-gate")
|
|
.env("HOME", &root)
|
|
.env("XDG_CONFIG_HOME", root.join("config"))
|
|
.env("ORX_DATA_DIR", root.join("data"))
|
|
.stdin(Stdio::piped())
|
|
.stdout(Stdio::piped())
|
|
.stderr(Stdio::piped())
|
|
.spawn()
|
|
.unwrap();
|
|
child
|
|
.stdin
|
|
.take()
|
|
.unwrap()
|
|
.write_all(br#"{"tool_name":"Bash","tool_use_id":"toolu_never_captured","tool_input":{"command":"echo ok"}}"#)
|
|
.unwrap();
|
|
let output = child.wait_with_output().unwrap();
|
|
assert!(output.status.success());
|
|
assert!(
|
|
output.stdout.is_empty(),
|
|
"{}",
|
|
String::from_utf8_lossy(&output.stdout)
|
|
);
|
|
let _ = std::fs::remove_dir_all(root);
|
|
}
|