Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Fix SDK input handling - objects spread at root level, primitives/arrays wrapped in {input: value}
  • Separate input parameter from options to match curl/API behavior
  • Remove unused RateLimitStatus class and dead code from Python SDK
  • Bump version to 0.1.2 for both TypeScript and Python SDKs

Type of Change

  • Bug fix

Testing

  • 29 TypeScript tests passing
  • 28 Python tests passing
  • Tested manually with live API

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 25, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 25, 2026 7:34am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 25, 2026

Greptile Overview

Greptile Summary

This PR refactors SDK input handling to align both TypeScript and Python SDKs with the curl/API behavior. The key changes:

  • API Signature Change: Separated input parameter from options parameter in executeWorkflow(), executeWorkflowSync(), and executeWithRetry() methods
  • Input Handling Logic: Objects/dicts are spread at root level, while primitives and arrays are wrapped in an {input: value} field
  • Code Cleanup: Removed unused RateLimitStatus class and dead io import from Python SDK
  • Version Bump: Both SDKs updated to version 0.1.2
  • Test Coverage: Added comprehensive tests for primitive, array, null, and object inputs

The refactoring improves API ergonomics by making the calling pattern more intuitive - executeWorkflow(workflowId, inputData, {options}) instead of executeWorkflow(workflowId, {input: inputData, ...options}).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-tested with comprehensive test coverage for all input types (objects, primitives, arrays, null). Both TypeScript (29 tests) and Python (28 tests) test suites are passing. The refactoring is a straightforward API improvement that separates concerns between input data and execution options. The implementation correctly handles edge cases and maintains backward compatibility in behavior while improving the API ergonomics.
  • No files require special attention

Important Files Changed

Filename Overview
packages/python-sdk/simstudio/init.py Refactored input handling to separate input param from options, removed unused RateLimitStatus class and io import
packages/ts-sdk/src/index.ts Refactored input handling to separate input param from options, removed input field from ExecutionOptions interface
packages/python-sdk/tests/test_client.py Updated tests to use new API signature and added comprehensive tests for primitive/array input handling
packages/ts-sdk/src/index.test.ts Updated tests to use new API signature and added comprehensive tests for primitive/array input handling including null

Sequence Diagram

sequenceDiagram
    participant Client as SDK Client
    participant API as Sim API
    
    Note over Client: Input Handling Logic
    
    alt Dict/Object Input
        Client->>Client: Spread at root level<br/>{ticker: "NVDA"} → {ticker: "NVDA"}
    else Primitive/Array Input
        Client->>Client: Wrap in input field<br/>"NVDA" → {input: "NVDA"}
    end
    
    Client->>Client: Convert files to base64
    Client->>Client: Add options (stream, selectedOutputs)
    
    alt Async Execution
        Client->>API: POST /api/workflows/:id/execute<br/>Header: X-Execution-Mode: async
        API-->>Client: 202 {taskId, status: "queued"}
    else Sync Execution
        Client->>API: POST /api/workflows/:id/execute
        API-->>Client: 200 {success, output}
    end
    
    Note over Client: Retry Logic
    
    alt Rate Limited (429)
        API-->>Client: 429 Rate Limit Exceeded
        Client->>Client: Wait with exponential backoff
        Client->>API: Retry request
        API-->>Client: 200 Success
    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.

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@waleedlatif1 waleedlatif1 merged commit dc0ed84 into staging Jan 25, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/sdk branch January 25, 2026 08:50
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