Commit 5386473
committed
fix(control-hub): make browser.wait actually wait
`browser.wait` read only `duration_ms`, so the very plausible
`{ "ms": 1800000 }` was dropped and the call fell through to a branch that
returned `{ success: true }` instantly. An agent asked to pause 30 minutes
got "Wait completed" back in milliseconds and moved straight on. The
action documented no parameters at all, so the model had to guess the key,
and even a correct guess was silently capped at 30 seconds.
- Accept the spellings models emit: `duration_ms` / `ms` / `wait_ms` /
`sleep_ms`, plus `seconds` / `secs` variants, numeric strings included.
- Reject a `wait` carrying neither duration nor condition with
INVALID_PARAMS instead of reporting a success that never waited.
- Raise the cap to 60 minutes, in step with AgentWait's MAX_TIMEOUT_MS, and
report `ms` / `requested_ms` / `clamped` so a shortened wait says so.
- Race the sleep against the turn's cancellation token, and stop
`call_impl` from folding Cancelled into an `ok: false` envelope — a stop
during a long pause must not wait out the pause, nor look like a tool
error the model tries to recover from.
- Serve duration waits before session resolution: a pure pause touches no
page, and agents pace themselves long before they open a browser.
- Resolve `{ condition, timeout_ms }`: the condition always wins and any
duration bounds it, rather than sleeping and never looking at the page.
Condition waits keep their previous 15s default, now configurable.
- Document all of it in the tool description, and point repeating schedules
at the Cron tool, which ends the turn instead of pinning it open.1 parent 47c033b commit 5386473
2 files changed
Lines changed: 461 additions & 14 deletions
File tree
- src/crates/assembly/core/src/agentic/tools
- browser_control
- implementations
Lines changed: 64 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
| |||
1054 | 1064 | | |
1055 | 1065 | | |
1056 | 1066 | | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
1057 | 1074 | | |
1058 | 1075 | | |
1059 | 1076 | | |
1060 | 1077 | | |
| 1078 | + | |
1061 | 1079 | | |
1062 | 1080 | | |
1063 | | - | |
| 1081 | + | |
1064 | 1082 | | |
1065 | | - | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1066 | 1090 | | |
1067 | 1091 | | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1068 | 1096 | | |
1069 | 1097 | | |
1070 | 1098 | | |
| |||
1085 | 1113 | | |
1086 | 1114 | | |
1087 | 1115 | | |
1088 | | - | |
| 1116 | + | |
1089 | 1117 | | |
1090 | 1118 | | |
1091 | 1119 | | |
| |||
1097 | 1125 | | |
1098 | 1126 | | |
1099 | 1127 | | |
| 1128 | + | |
1100 | 1129 | | |
1101 | 1130 | | |
1102 | 1131 | | |
| 1132 | + | |
1103 | 1133 | | |
1104 | | - | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1105 | 1137 | | |
1106 | 1138 | | |
1107 | 1139 | | |
1108 | 1140 | | |
1109 | 1141 | | |
1110 | 1142 | | |
1111 | 1143 | | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1115 | 1150 | | |
1116 | | - | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1117 | 1161 | | |
1118 | 1162 | | |
1119 | 1163 | | |
| |||
1123 | 1167 | | |
1124 | 1168 | | |
1125 | 1169 | | |
1126 | | - | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1127 | 1182 | | |
1128 | 1183 | | |
1129 | 1184 | | |
| |||
0 commit comments