mirror of
https://github.com/openai/codex.git
synced 2026-11-21 22:50:37 +00:00
codex: add dynamic tool hook support
This commit is contained in:
@@ -194,6 +194,14 @@ mod tests {
|
||||
fn literal_matcher_uses_exact_matching() {
|
||||
assert!(matches_matcher(Some("Bash"), Some("Bash")));
|
||||
assert!(!matches_matcher(Some("Bash"), Some("BashOutput")));
|
||||
assert!(matches_matcher(
|
||||
Some("dynamic__codex_app__automation_update"),
|
||||
Some("dynamic__codex_app__automation_update")
|
||||
));
|
||||
assert!(!matches_matcher(
|
||||
Some("dynamic__codex_app"),
|
||||
Some("dynamic__codex_app__automation_update")
|
||||
));
|
||||
assert!(matches_matcher(
|
||||
Some("mcp__memory__create_entities"),
|
||||
Some("mcp__memory__create_entities")
|
||||
@@ -228,6 +236,23 @@ mod tests {
|
||||
assert_eq!(validate_matcher_pattern("mcp__memory__.*"), Ok(()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dynamic_matchers_support_regex_wildcards() {
|
||||
assert!(matches_matcher(
|
||||
Some("dynamic__codex_app__.*"),
|
||||
Some("dynamic__codex_app__automation_update")
|
||||
));
|
||||
assert!(matches_matcher(
|
||||
Some("dynamic__.*__automation_update"),
|
||||
Some("dynamic__codex_app__automation_update")
|
||||
));
|
||||
assert!(!matches_matcher(
|
||||
Some("dynamic__other_app__.*"),
|
||||
Some("dynamic__codex_app__automation_update")
|
||||
));
|
||||
assert_eq!(validate_matcher_pattern("dynamic__codex_app__.*"), Ok(()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn matcher_supports_anchored_regexes() {
|
||||
assert!(matches_matcher(Some("^Bash$"), Some("Bash")));
|
||||
|
||||
Reference in New Issue
Block a user