Skip to content

Conversation

@ellispinsky
Copy link

@ellispinsky ellispinsky commented Dec 14, 2025

  • Updated package.json to include new dependencies: @ai-sdk/anthropic and @ai-sdk/provider-utils.
  • Added "computer" to the list of tools exported from index.ts, along with its type definitions.

Note

Adds a new Anthropic-powered computerTool integrated with Onkernel, exports it from the SDK, and introduces a Next.js example app demonstrating computer use.

  • SDK / Computer Use:
    • Add src/computer.ts: Anthropic computer_20250124 tool wired to Onkernel browser API (click, type, scroll, drag, screenshot, wait) with result translation.
    • Export computerTool and ComputerToolOptions from src/index.ts.
  • Examples:
    • New Next.js app under examples/computer-use-nextjs with API routes, UI components, Tailwind v4 config, and assets to demo computer use.
  • Dependencies & Workspace:
    • Add Anthropic/provider utils and related deps; update lockfile.
    • Introduce pnpm-workspace.yaml to include root and examples/*.
    • Minor build tooling updates (PostCSS/Tailwind configs).

Written by Cursor Bugbot for commit 72eb460. This will update automatically on new commits. Configure here.

- Updated package.json to include new dependencies: @ai-sdk/anthropic and @ai-sdk/provider-utils.
- Added "computer" to the list of tools exported from index.ts, along with its type definitions.
@@ -0,0 +1,3 @@
{
"postman.settings.dotenv-detection-notification-visibility": false
} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

Bug: VSCode settings file committed despite being in gitignore

The .vscode/settings.json file is being committed to the repository in the same PR that adds .vscode/ to the .gitignore. This appears to be accidentally committed IDE configuration that contains personal Postman settings and contradicts the intent of adding the directory to .gitignore.

Additional Locations (1)

Fix in Cursor Fix in Web


return messages.map((message) => {
// check if last message part is a tool invocation in a call state, then append a part with the tool result
message.parts = message.parts.map((part) => {
Copy link

Choose a reason for hiding this comment

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

Bug: prunedMessages mutates input message objects directly

The prunedMessages function directly mutates the original message objects by assigning to message.parts. While .map() creates a new array, the line message.parts = message.parts.map(...) modifies the original message object's parts property in place. This can cause unexpected side effects since the function is exported and the caller's data is modified. The function needs to return new message objects by spreading the original (e.g., { ...message, parts: ... }) instead of mutating.

Fix in Cursor Fix in Web

},
],
},
]);
Copy link

Choose a reason for hiding this comment

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

Bug: Stale closure in stop function causes incorrect state updates

The stop function captures lastMessage and lastMessageLastPart from the messages closure before calling setMessages, then uses these stale values inside the setMessages callback. The callback receives prev (the latest state) but mixes it with the potentially stale lastMessage object. If messages are updated between when stop is called and when React processes the state update, this could result in incorrect message state where the wrong message object is modified or messages are duplicated. The values need to be derived from prev inside the callback instead.

Fix in Cursor Fix in Web

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.

2 participants