Skip to content

Commit 15891dd

Browse files
committed
Fix quality-gate fixture drift for permissive tool-call policy
1 parent 97a81c4 commit 15891dd

File tree

6 files changed

+34
-21
lines changed

6 files changed

+34
-21
lines changed
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
2-
"calls": [],
2+
"calls": [
3+
{
4+
"name": "unknown_tool",
5+
"input": {
6+
"x": 1
7+
}
8+
}
9+
],
310
"sawToolCallSyntax": true,
4-
"rejectedByPolicy": true,
5-
"rejectedToolNames": [
6-
"unknown_tool"
7-
]
8-
}
11+
"rejectedByPolicy": false,
12+
"rejectedToolNames": []
13+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"calls": [
33
{
4-
"name": "read_file",
4+
"name": "Read_File",
55
"input": {
66
"path": "README.MD"
77
}
@@ -10,4 +10,4 @@
1010
"sawToolCallSyntax": true,
1111
"rejectedByPolicy": false,
1212
"rejectedToolNames": []
13-
}
13+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"calls": [
33
{
4-
"name": "read_file",
4+
"name": "read-file",
55
"input": {
66
"path": "README.MD"
77
}
@@ -10,4 +10,4 @@
1010
"sawToolCallSyntax": true,
1111
"rejectedByPolicy": false,
1212
"rejectedToolNames": []
13-
}
13+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"calls": [
33
{
4-
"name": "read_file",
4+
"name": "company.fs.read_file",
55
"input": {
66
"path": "README.MD"
77
}
@@ -10,4 +10,4 @@
1010
"sawToolCallSyntax": true,
1111
"rejectedByPolicy": false,
1212
"rejectedToolNames": []
13-
}
13+
}
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{
2-
"calls": [],
2+
"calls": [
3+
{
4+
"name": "unknown_tool",
5+
"input": {
6+
"x": 1
7+
}
8+
}
9+
],
310
"sawToolCallSyntax": true,
4-
"rejectedByPolicy": true,
5-
"rejectedToolNames": [
6-
"unknown_tool"
7-
]
8-
}
11+
"rejectedByPolicy": false,
12+
"rejectedToolNames": []
13+
}

tests/node/chat-stream.test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test('boolDefaultTrue keeps false only when explicitly false', () => {
5858
assert.equal(boolDefaultTrue(undefined), true);
5959
});
6060

61-
test('filterIncrementalToolCallDeltasByAllowed blocks unknown name and follow-up args', () => {
61+
test('filterIncrementalToolCallDeltasByAllowed keeps unknown name and follow-up args', () => {
6262
const seen = new Map();
6363
const filtered = filterIncrementalToolCallDeltasByAllowed(
6464
[
@@ -68,8 +68,11 @@ test('filterIncrementalToolCallDeltasByAllowed blocks unknown name and follow-up
6868
['read_file'],
6969
seen,
7070
);
71-
assert.deepEqual(filtered, []);
72-
assert.equal(seen.get(0), '__blocked__');
71+
assert.deepEqual(filtered, [
72+
{ index: 0, name: 'not_in_schema' },
73+
{ index: 0, arguments: '{"x":1}' },
74+
]);
75+
assert.equal(seen.get(0), 'not_in_schema');
7376
});
7477

7578
test('filterIncrementalToolCallDeltasByAllowed keeps allowed name and args', () => {

0 commit comments

Comments
 (0)