Skip to content

Conversation

@tlgimenes
Copy link
Contributor

@tlgimenes tlgimenes commented Dec 26, 2025

What is this contribution about?

Describe your changes and why they're needed.

Screenshots/Demonstration

Add screenshots or a Loom video if your changes affect the UI.

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by cubic

Add sandboxed JavaScript execution via QuickJS and enable the code_execution gateway strategy with a new GATEWAY_RUN_CODE tool for running code that calls other tools. Includes a hardened runtime with timeouts, console capture, and structured JSON results.

  • New Features

    • QuickJS sandbox: memory/stack limits, interrupt-based timeouts, console.log/warn/error capture, error inspection, and a host-bridge to call tools. Code runs as an ES module that export default async (tools) => { … }.
    • Gateway strategy: implements code_execution exposing GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, and GATEWAY_RUN_CODE with Zod-validated inputs and consistent JSON result/error helpers.
    • Dependencies: add quickjs-emscripten-core and @jitl/quickjs-wasmfile-release-sync. Minor UI polish for integration icons and single-line gateway descriptions.
  • Bug Fixes

    • models:stream now assigns the MCP client before use and closes the correct client in onError/onFinish.
    • LLM provider logs now include the raw chunk on stream parse failures for easier debugging.

Written for commit f7ec0f0. Summary will update automatically on new commits.

@tlgimenes tlgimenes changed the title chore: add code execution chore: add code execution as gateway mode Dec 26, 2025
@github-actions
Copy link
Contributor

Release Options

Should a new version be published when this PR is merged?

React with an emoji to vote on the release type:

Reaction Type Next Version
👍 Prerelease 1.0.0-alpha.36
🎉 Patch 1.0.1
❤️ Minor 1.1.0
🚀 Major 2.0.0

Current version: 1.0.0-alpha.35

Deployment

  • Deploy to production (triggers ArgoCD sync after Docker image is published)

Copy link

@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 13 files

- Added support for running JavaScript code in a sandbox environment with QuickJS, enabling dynamic tool execution.
- Introduced new tools for searching and describing available tools, enhancing the tool selection strategy.
- Improved error handling and logging within the sandbox for better debugging.
- Updated the IntegrationIcon component to improve icon loading behavior and fallback handling.
- Refactored GatewaySelector and ToolCallPart components for better user experience and visual feedback during tool calls.
@tlgimenes tlgimenes merged commit 1019de1 into main Dec 26, 2025
1 check passed
@tlgimenes tlgimenes deleted the feat/code-execution branch December 26, 2025 22:12
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