Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Port easier properties from AI SDK Agent class to DurableAgent class

Plan:

  • Explore repository structure and understand DurableAgent implementation
  • Analyze AI SDK Agent class (AgentSettings + CallSettings)
  • Build the workspace successfully
  • Identify and categorize properties by difficulty
  • Port easy CallSettings properties (temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed)
  • Add comprehensive tests for new properties
  • Strengthen test assertions to verify actual property values
  • Remove private modifiers for better testability
  • Run linting and type checking
  • Update documentation with examples
  • Request code review
  • Run security checks

Summary

Successfully ported 8 CallSettings properties from the AI SDK's Agent class to the DurableAgent class:

Properties Added:

  • temperature - Temperature setting for model output randomness
  • maxOutputTokens - Maximum number of tokens to generate
  • topP - Nucleus sampling parameter
  • topK - Top-K sampling parameter
  • presencePenalty - Penalty for repeating information from prompt
  • frequencyPenalty - Penalty for repeating words/phrases
  • stopSequences - Sequences that stop generation
  • seed - Seed for deterministic generation

Implementation:
These properties are properly threaded through the call chain from DurableAgent → streamTextIterator → doStreamStep → model.doStream()

Testing:

  • ✅ 24/24 tests passing (14 new tests added)
  • ✅ Tests verify actual property values directly (no type assertions needed)
  • ✅ Build successful
  • ✅ Type checking passed
  • ✅ Linting passed (only pre-existing warnings)
  • ✅ Code review completed with no issues
  • ✅ Security scan completed with no vulnerabilities

Documentation:

  • ✅ Updated with usage examples
  • ✅ Added "Advanced Configuration" example
  • ✅ JSDoc comments on all new properties

Security Summary

No security vulnerabilities were discovered during the security scan.

Future Enhancements

This PR focused on the simpler properties (primitives that pass through directly). Additional properties from AgentSettings that could be added in future PRs:

  • maxRetries - retry configuration
  • toolChoice - tool selection strategy
  • activeTools - subset of tools to enable
  • Experimental properties and callbacks (if workflow integration is needed)
Original prompt

the DurableAgent class in workflow/ai package is meant to be very similar in interface to the ToolLoopAgent class in AI sdk 6. Identify and port some of the easier properties that exist in the ToolLoopAgent class constructor over to the DurableAgent class to bring it closer to functional parity


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 7, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

⚠️ No Changeset found

Latest commit: 528f3ed

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

@vercel
Copy link
Contributor

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Nov 8, 2025 10:11pm
example-nextjs-workflow-webpack Ready Ready Preview Comment Nov 8, 2025 10:11pm
example-workflow Ready Ready Preview Comment Nov 8, 2025 10:11pm
workbench-nitro-workflow Ready Ready Preview Comment Nov 8, 2025 10:11pm
workbench-nuxt-workflow Ready Ready Preview Comment Nov 8, 2025 10:11pm
workbench-sveltekit-workflow Ready Ready Preview Comment Nov 8, 2025 10:11pm
workbench-vite-workflow Ready Ready Preview Comment Nov 8, 2025 10:11pm
workflow-docs Ready Ready Preview Comment Nov 8, 2025 10:11pm

Port easier properties from AI SDK Agent class (temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed) to bring DurableAgent closer to functional parity with ToolLoopAgent/Agent class.

Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Add examples showing the new CallSettings properties (temperature, maxOutputTokens, topP, etc.) in the DurableAgent documentation.

Co-authored-by: pranaygp <1797812+pranaygp@users.noreply.github.com>
Copilot finished work on behalf of pranaygp November 7, 2025 08:13
Copilot AI requested a review from pranaygp November 7, 2025 08:13
tools: {},
});

expect(agent).toBeDefined();
Copy link
Member

Choose a reason for hiding this comment

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

@copilot This (and all similar ones in the rest of the tests) is a weak assertion. Can we test that the relevant property actually exists on the class instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in cb5acbd. Tests now verify that each property value is correctly stored on the class instance using type assertions (as any) to access the private properties.

Copy link
Member

Choose a reason for hiding this comment

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

@copilot Instead of casting to any, how about we just drop the private statements on the class definition itself. private in TS is kind of dumb anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 528f3ed. Removed private modifiers from all DurableAgent properties and updated tests to access properties directly without type assertions.

Instead of just checking that the agent is defined, tests now verify that each property value is correctly stored on the class instance using type assertions to access private properties.

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 8, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/workflow/workflow/node_modules/.pnpm/next@15.5.4_@opentelemetry&#43;api@1.9.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/compiled/jest-worker/processChild.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from TooTallNate November 8, 2025 07:55
Copilot finished work on behalf of TooTallNate November 8, 2025 07:55
Remove private modifiers from class properties and update tests to access properties directly without type assertions, per code review feedback.

Co-authored-by: TooTallNate <71256+TooTallNate@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 8, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/workflow/workflow/node_modules/.pnpm/next@15.5.4_@opentelemetry&#43;api@1.9.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/dist/compiled/jest-worker/processChild.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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.

3 participants