Conversation
|
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Client
participant Agent as Stagehand Agent (v3)
participant Validator as validateExperimentalFeatures
participant LLM as LLM Provider
Note over Client,LLM: Agent Request Flow with Streaming
Client->>Agent: Call act/extract with { stream: true }
Agent->>Validator: validateExperimentalFeatures(agentConfig)
Note over Validator: CHANGED: Streaming is no longer added<br/>to the experimental features list.
Validator-->>Agent: Continue (No experimental error thrown)
Agent->>LLM: Request completion with streaming enabled
loop Stream Response
LLM-->>Agent: Partial data chunk
Agent-->>Client: Stream event / callback
end
LLM-->>Agent: Stream complete
Agent-->>Client: Final result / Metadata
Greptile OverviewGreptile SummaryRemoved the experimental flag requirement for streaming in non-CUA mode by deleting the validation check that enforced it.
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Agent
participant Validator as validateExperimentalFeatures
participant ErrorHandler
User->>Agent: agent({ stream: true })
Agent->>Validator: validateExperimentalFeatures(options)
alt CUA mode enabled
Validator->>Validator: Check if agentConfig.stream is true
Validator->>ErrorHandler: throw StagehandInvalidArgumentError
ErrorHandler-->>User: "streaming is not supported with CUA"
else Non-CUA mode (BEFORE this PR)
Validator->>Validator: Check if stream is enabled
alt experimental: false
Validator->>ErrorHandler: throw ExperimentalNotConfiguredError
ErrorHandler-->>User: "Agent streaming"
else experimental: true
Validator-->>Agent: Validation passed
Agent-->>User: Agent with streaming
end
else Non-CUA mode (AFTER this PR)
Note over Validator: Streaming check removed
Validator-->>Agent: Validation passed (no experimental check)
Agent-->>User: Agent with streaming
end
|
Additional Comments (2)
test("throws ExperimentalNotConfiguredError for streaming mode", async () => {
try {
const agent = v3.agent({
stream: true,
model: "anthropic/claude-sonnet-4-20250514",
});
await agent.execute("test instruction");
throw new Error("Expected error to be thrown");
} catch (error) {
expect(error).toBeInstanceOf(ExperimentalNotConfiguredError);
expect((error as Error).message).toContain("streaming");
}
});Prompt To Fix With AIThis is a comment left during a code review.
Path: packages/core/lib/v3/agent/utils/validateExperimentalFeatures.ts
Line: 87:103
Comment:
test on line 132-144 in `agent-experimental-validation.spec.ts` expects streaming to throw `ExperimentalNotConfiguredError` when `experimental: false`, but this change removes that check
```typescript
test("throws ExperimentalNotConfiguredError for streaming mode", async () => {
try {
const agent = v3.agent({
stream: true,
model: "anthropic/claude-sonnet-4-20250514",
});
await agent.execute("test instruction");
throw new Error("Expected error to be thrown");
} catch (error) {
expect(error).toBeInstanceOf(ExperimentalNotConfiguredError);
expect((error as Error).message).toContain("streaming");
}
});
```
How can I resolve this? If you propose a fix, please make it concise.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: packages/core/lib/v3/agent/utils/validateExperimentalFeatures.ts
Line: 20:31
Comment:
update the JSDoc comment to remove the mention of streaming as an experimental feature for non-CUA mode (line 27)
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise. |
why
streaming no longer needs to be behind experimental
what changed
removed experimental error when stream is used
test plan
Summary by cubic
Allow streaming in agents without the experimental gate. Removed the streaming check in validateExperimentalFeatures so enabling stream (via agentConfig.stream or inferred) no longer triggers an experimental error.
Written for commit f654ac4. Summary will update on new commits. Review in cubic