Commit 677bff5
authored
# why
Stricter validation on LLM responses for chosen elementId to interact
with
# what changed
V3 includes **only** elementIds in the shape `number-number` to account
for iframe ordinals. This PR ensures the LLMs have stricter validation
on the elementId generation by changing the observe and act schemas to
to enforce
```typescript
z.string().regex(/^\d+-\d+$/)
```
# test plan
- [x] act evals
- [x] observe evals
- [x] combination evals
- [x] regression evals
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Enforce 'number-number' format for elementId in observe and act via
regex (^\d+-\d+$) to prevent invalid IDs. Aligns with Linear STG-675
guardrail requirements for elementId formatting.
<sup>Written for commit 3b70cc1.
Summary will update on new commits. <a
href="https://cubic.dev/pr/browserbase/stagehand/pull/1614">Review in
cubic</a></sup>
<!-- End of auto-generated description by cubic. -->
1 parent bdd8b4e commit 677bff5
2 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
| 386 | + | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
| |||
0 commit comments