Skip to content

[Feature] Support C# SDK spec-driven model generation workflow #347

@hittyt

Description

@hittyt

Why do you need it?

Is your feature request related to a problem? Please describe in details

The current C# SDKs (sdks/sandbox/csharp and sdks/code-interpreter/csharp) are manually maintained and do not have a spec-driven model generation workflow, unlike Python/JavaScript/Kotlin SDKs.

This creates several practical issues:

  • Spec drift risk: when specs/sandbox-lifecycle.yml or specs/execd-api.yaml changes (e.g. new fields like ossfs, subPath, or schema updates), C# models may lag behind.
  • Higher maintenance cost: developers must manually update multiple model/adaptor files and tests.
  • Inconsistent multi-language experience: the same API feature may appear quickly in some SDKs but later in C#.
  • No CI guardrail for generation freshness: there is currently no “generate + diff check” step for C# in CI, so stale models can slip into PRs.

How could it be?

A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.

Introduce a spec-based model generation pipeline for C# SDKs and integrate it into local workflows + CI.

Proposed scope (v1)

  1. Generator entrypoint

    • Add generation script/command for C# (e.g. under sdks/sandbox/csharp/scripts/ and sdks/code-interpreter/csharp/scripts/).
    • Inputs:
      • specs/sandbox-lifecycle.yml
      • specs/execd-api.yaml
    • Output:
      • generated API/model layer in deterministic paths (or generated intermediate + mapped domain models).
  2. Repository workflow integration

    • Add documented commands in C# SDK README/CONTRIBUTING:
      • generate-api
      • verify-generated
    • Ensure generated artifacts are reproducible and stable.
  3. CI enforcement

    • In .github/workflows/sdk-unit-tests.yml (or a dedicated workflow), add:
      • generation step
      • git diff --exit-code check for generated files
    • Fail PR when specs changed but C# generated outputs are not updated.
  4. Compatibility approach

    • Keep current public SDK ergonomics.
    • If needed, use a thin adapter/converter layer between generated types and current domain types to avoid breaking API ergonomics.

Acceptance criteria

  • Running the documented generation command updates C# generated artifacts from latest specs.
  • CI fails when generated outputs are stale.
  • C# SDK models include latest spec fields (including OSSFS-related fields where applicable).
  • Existing C# unit tests continue to pass.

Other related information

Add any other context or screenshots about the feature request here.

  • Current CI for C# mainly runs tests and packaging, but does not verify generated freshness.
  • Related workflows:
    • .github/workflows/sdk-unit-tests.yml
    • .github/workflows/publish-csharp-sdks.yml
  • Related specs:
    • specs/sandbox-lifecycle.yml
    • specs/execd-api.yaml
  • Goal of this issue is automation and consistency; no urgent runtime behavior change is required in this PR.

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions