Skip to content

Commit 68d767a

Browse files
authored
Remove default from twoStep schema requirement (#2029)
# why `z.boolean().default(false)` on line 448 is incompatible with OpenAI's strict structured-output mode. OpenAI's error: > 'required' is required to be supplied and to be an array including every key in properties. Missing 'twoStep'. # what changed # test plan <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Made `twoStep` a required boolean in the `act` schema (no default). This removes the silent `false` default and forces callers to be explicit about two-step actions. - **Migration** - Always pass `twoStep: true | false` when calling `act`. - `tsconfig.json` change is formatting-only; no runtime impact. <sup>Written for commit ca56e78. Summary will update on new commits. <a href="https://cubic.dev/pr/browserbase/stagehand/pull/2029">Review in cubic</a></sup> <!-- End of auto-generated description by cubic. -->
1 parent a500de1 commit 68d767a

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

packages/core/lib/inference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ export async function act({
445445
.describe(
446446
"The element to act on. Return null if no element on the page matches the instruction — do NOT fabricate or guess an element, and never emit empty strings or placeholder values.",
447447
),
448-
twoStep: z.boolean().default(false),
448+
twoStep: z.boolean(),
449449
});
450450

451451
type ActResponse = z.infer<typeof actSchema>;

packages/core/tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
"@/*": ["./*"]
1313
}
1414
},
15-
"include": [
16-
"lib/**/*.ts",
17-
"tests/**/*.ts",
18-
"lib/v3/cli.js"
19-
],
15+
"include": ["lib/**/*.ts", "tests/**/*.ts", "lib/v3/cli.js"],
2016
"exclude": ["node_modules", "dist"]
2117
}

0 commit comments

Comments
 (0)