Skip to content

remove streaming from experimental in agent#1659

Open
tkattkat wants to merge 3 commits intomainfrom
remove-streaming-from-experimental-in-agent
Open

remove streaming from experimental in agent#1659
tkattkat wants to merge 3 commits intomainfrom
remove-streaming-from-experimental-in-agent

Conversation

@tkattkat
Copy link
Collaborator

@tkattkat tkattkat commented Feb 4, 2026

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

@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: f654ac4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

Removed the experimental flag requirement for streaming in non-CUA mode by deleting the validation check that enforced it.

  • Streaming is still correctly blocked for CUA mode (lines 47-49)
  • The change allows stream: true to be used without experimental: true in non-CUA mode
  • Critical: The test in agent-experimental-validation.spec.ts (lines 132-144) expects streaming to throw ExperimentalNotConfiguredError when experimental: false, but this PR removes that check - the test will now fail
  • Documentation in packages/docs/v3/basics/agent.mdx (line 535) still mentions experimental: true is required for streaming
  • JSDoc comment on line 27 still lists streaming as an experimental feature for non-CUA mode

Confidence Score: 2/5

  • This PR will break existing tests and has outdated documentation
  • The code change itself is clean and simple, but it introduces a breaking test failure and leaves documentation inconsistent with the new behavior
  • Test file agent-experimental-validation.spec.ts and documentation agent.mdx need updates to align with this change

Important Files Changed

Filename Overview
packages/core/lib/v3/agent/utils/validateExperimentalFeatures.ts Removed experimental flag requirement for streaming in non-CUA mode, but breaking test needs update

Sequence Diagram

sequenceDiagram
    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
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Additional Comments (2)

packages/core/lib/v3/agent/utils/validateExperimentalFeatures.ts
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

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 AI
This 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.

packages/core/lib/v3/agent/utils/validateExperimentalFeatures.ts
update the JSDoc comment to remove the mention of streaming as an experimental feature for non-CUA mode (line 27)

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 AI
This 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant