Skip to content

Commit c84fe94

Browse files
authored
test: fix expectURL caches (#38814)
1 parent 02b8f53 commit c84fe94

File tree

4 files changed

+169
-7
lines changed

4 files changed

+169
-7
lines changed

tests/library/__llm_cache__/library-agent-expect-expectURL-success.json

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
11
{
2+
"218b122dd19ab410fa8e1982e7330a92175a3f4a": {
3+
"result": {
4+
"role": "assistant",
5+
"content": [
6+
{
7+
"type": "text",
8+
"text": "I see the issue - the page URL is the full URL `http://localhost:8907/page.html`, not just the path. Let me adjust the assertion to use a regex pattern that will match the path portion:"
9+
},
10+
{
11+
"type": "tool_call",
12+
"name": "browser_expect_url",
13+
"arguments": {
14+
"regex": "/page\\.html$/",
15+
"_is_done": true
16+
},
17+
"id": "toolu_01C6XynJnfEwtCQLmMJinLxi"
18+
}
19+
],
20+
"stopReason": {
21+
"code": "ok"
22+
}
23+
},
24+
"usage": {
25+
"input": 2165,
26+
"output": 125
27+
}
28+
},
229
"3393f1e7925b53d87c1ebcdc7411dc04bfc11aec": {
330
"result": {
431
"role": "assistant",
532
"content": [
633
{
734
"type": "text",
8-
"text": "I need to verify that the page URL is `/page.html`. I'll use the `browser_expect_url` tool to assert this condition."
35+
"text": "I need to verify that the page URL is `/page.html`. Let me check this using the browser_expect_url tool."
936
},
1037
{
1138
"type": "tool_call",
@@ -14,7 +41,7 @@
1441
"url": "/page.html",
1542
"_is_done": true
1643
},
17-
"id": "toolu_0131XYp1i3XJgJsb6xHePBUV"
44+
"id": "toolu_0126LdEZe32PoAJfJwrSG8PT"
1845
}
1946
],
2047
"stopReason": {
@@ -23,7 +50,34 @@
2350
},
2451
"usage": {
2552
"input": 1930,
26-
"output": 109
53+
"output": 105
54+
}
55+
},
56+
"421d60b4ee07460745af9a285bf151c2690ba498": {
57+
"result": {
58+
"role": "assistant",
59+
"content": [
60+
{
61+
"type": "text",
62+
"text": "I see the issue - the actual URL is the full URL `http://localhost:8955/page.html`, not just the path `/page.html`. Let me use a regex pattern to match the URL that ends with `/page.html`:"
63+
},
64+
{
65+
"type": "tool_call",
66+
"name": "browser_expect_url",
67+
"arguments": {
68+
"regex": "/page\\.html$/",
69+
"_is_done": true
70+
},
71+
"id": "toolu_01PVEVCMMAbyRbV8ryw4Vq21"
72+
}
73+
],
74+
"stopReason": {
75+
"code": "ok"
76+
}
77+
},
78+
"usage": {
79+
"input": 2169,
80+
"output": 130
2781
}
2882
},
2983
"4c51af7388a0114714b58e25495f23f5fb9306b8": {

tests/library/__llm_cache__/library-agent-expect-expectURL-with-regex-error.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,32 @@
125125
"input": 2165,
126126
"output": 114
127127
}
128+
},
129+
"ce3f938674ba0ecfceaf13ee135fda66576c596c": {
130+
"result": {
131+
"role": "assistant",
132+
"content": [
133+
{
134+
"type": "text",
135+
"text": "I see the URL is \"http://localhost:8907/other.html\". Let me adjust the regex pattern to match URLs containing \"other\" more appropriately:"
136+
},
137+
{
138+
"type": "tool_call",
139+
"name": "browser_expect_url",
140+
"arguments": {
141+
"regex": "/other/",
142+
"_is_done": true
143+
},
144+
"id": "toolu_01QmJpJPqx7PV9iDBD3FBYcb"
145+
}
146+
],
147+
"stopReason": {
148+
"code": "ok"
149+
}
150+
},
151+
"usage": {
152+
"input": 2165,
153+
"output": 111
154+
}
128155
}
129156
}

tests/library/__llm_cache__/library-agent-expect-expectURL-with-regex.json

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
11
{
2+
"33442824e378e1a876db44e19303faf430e8d492": {
3+
"result": {
4+
"role": "assistant",
5+
"content": [
6+
{
7+
"type": "text",
8+
"text": "I need to fix the regex format - it needs to be a complete regex pattern with closing slash and optional flags."
9+
},
10+
{
11+
"type": "tool_call",
12+
"name": "browser_expect_url",
13+
"arguments": {
14+
"regex": "/page/",
15+
"_is_done": true
16+
},
17+
"id": "toolu_01UKuRAcqrarenSYTfGLJrc9"
18+
}
19+
],
20+
"stopReason": {
21+
"code": "ok"
22+
}
23+
},
24+
"usage": {
25+
"input": 2113,
26+
"output": 100
27+
}
28+
},
229
"c67b3d627e92564582281fd7713d0f3de70a3a44": {
330
"result": {
431
"role": "assistant",
@@ -32,7 +59,7 @@
3259
"content": [
3360
{
3461
"type": "text",
35-
"text": "I need to verify that the page URL matches the pattern \"/page\". I'll use the `browser_expect_url` tool with a regex pattern to check this."
62+
"text": "I need to verify that the page URL matches the pattern `/page`. I'll use the `browser_expect_url` tool with a regex pattern."
3663
},
3764
{
3865
"type": "tool_call",
@@ -41,7 +68,7 @@
4168
"regex": "/page",
4269
"_is_done": true
4370
},
44-
"id": "toolu_01CSnFjEnGm46uxyxLfUdQoT"
71+
"id": "toolu_017sobJzrZUJ9pxgJ7hSuv5u"
4572
}
4673
],
4774
"stopReason": {
@@ -50,7 +77,7 @@
5077
},
5178
"usage": {
5279
"input": 1929,
53-
"output": 110
80+
"output": 107
5481
}
5582
}
5683
}

tests/library/__llm_cache__/library-agent-expect-expectURL-wrong-URL-error.json

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "/other.html",
1515
"_is_done": true
1616
},
17-
"id": "toolu_01SEru6Vuneyu58u6yQ6faKy"
17+
"id": "toolu_01G9ZzdYXENshXQ8jShDmvJy"
1818
}
1919
],
2020
"stopReason": {
@@ -26,6 +26,33 @@
2626
"output": 109
2727
}
2828
},
29+
"6aacb908b26146c99406cec686aaf78e2398d3c8": {
30+
"result": {
31+
"role": "assistant",
32+
"content": [
33+
{
34+
"type": "text",
35+
"text": "I see the issue - the actual URL is the full URL `http://localhost:8959/other.html`, not just the relative path. Let me adjust the assertion to match the actual URL pattern using a regex that checks if the URL ends with `/other.html`:"
36+
},
37+
{
38+
"type": "tool_call",
39+
"name": "browser_expect_url",
40+
"arguments": {
41+
"regex": "/\\/other\\.html$/",
42+
"_is_done": true
43+
},
44+
"id": "toolu_011zZt5A2gYEv1VwEAmjNTLm"
45+
}
46+
],
47+
"stopReason": {
48+
"code": "ok"
49+
}
50+
},
51+
"usage": {
52+
"input": 2169,
53+
"output": 136
54+
}
55+
},
2956
"bae6a40c194c52f6df380d43bae1648192ad1f8a": {
3057
"result": {
3158
"role": "assistant",
@@ -52,5 +79,32 @@
5279
"input": 2169,
5380
"output": 126
5481
}
82+
},
83+
"f3512ecc7b43a5238007d361e22f0c67faf72cbf": {
84+
"result": {
85+
"role": "assistant",
86+
"content": [
87+
{
88+
"type": "text",
89+
"text": "I see the issue - the actual URL is the full URL `http://localhost:8911/other.html` while I was checking for just `/other.html`. Let me use a regex pattern to match URLs ending with `/other.html`:"
90+
},
91+
{
92+
"type": "tool_call",
93+
"name": "browser_expect_url",
94+
"arguments": {
95+
"regex": "/\\/other\\.html$/",
96+
"_is_done": true
97+
},
98+
"id": "toolu_01GULjRje8iHqa5c37r9dtTW"
99+
}
100+
],
101+
"stopReason": {
102+
"code": "ok"
103+
}
104+
},
105+
"usage": {
106+
"input": 2169,
107+
"output": 131
108+
}
55109
}
56110
}

0 commit comments

Comments
 (0)