Remove default from twoStep schema requirement#2029
Merged
Conversation
|
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant App as User Application
participant Core as Inference (act)
participant LLM as OpenAI API
Note over App,LLM: Action Inference Flow (Strict Structured Output)
App->>Core: act(instruction, ...)
Core->>Core: Define Zod schema
Note over Core: CHANGED: 'twoStep' boolean is now required<br/>(Removed .default(false) for OpenAI compatibility)
Core->>LLM: Request completion with JSON Schema
Note over Core,LLM: The 'required' array in the schema<br/>MUST now include 'twoStep'
alt Success
LLM-->>Core: NEW: Returns JSON including 'twoStep' key
Core->>Core: Validate response with Zod
Core-->>App: Return ActResponse
else OpenAI Schema Error (Old Behavior)
Note over LLM: OpenAI would reject schema if 'twoStep'<br/>had a default but was missing from 'required'
LLM-->>Core: 400 Bad Request
Core-->>App: Throw Error
end
tkattkat
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
why
z.boolean().default(false)on line 448 is incompatible with OpenAI's strict structured-output mode.OpenAI's error:
what changed
test plan
Summary by cubic
Made
twoStepa required boolean in theactschema (no default). This removes the silentfalsedefault and forces callers to be explicit about two-step actions.twoStep: true | falsewhen callingact.tsconfig.jsonchange is formatting-only; no runtime impact.Written for commit ca56e78. Summary will update on new commits. Review in cubic