Skip to content

feat(mcpx): Python binding for script-side generate (#1925 slice 2) - #16942

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
lane/1222f-1925-generate-py
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
lane/1222f-1925-generate-py

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1925 — slice 2: the Python binding for the script-side generate surface (contract §2's named follow-on to PR #16941).

What lands

  • generate() in the generated Python client (internal/codegen/py.go): POSTs the options to the daemon's /v1/generate (landed in feat(mcpx): script-side generate — daemon route, TS global, op declaration (#1925 slice) #16941) and returns its discriminated result untouched. A non-dict options argument raises TypeError (there is no request to describe); a transport failure returns {ok: false, errorKind: "provider"} — a model-side outcome is a value, never an exception, per contract §6. Synchronous, like the rest of the Python client (call/batch are), which is the language-appropriate shape of the same JSON contract for this client.
  • mcpx_globals.pyi stub now imports generate from mcpx_client.
  • docs/script-generate.md: §2 and the status note record the Python binding as landed; Roc remains deferred on the contract's terms.
  • New TestPythonGenerateRoundTrip: drives the generated client against a fixture daemon — result pass-through, options on the wire as given, TypeError for a non-dict argument, provider-kind result for a dead endpoint.

Verification

Authoring worktree on the laptop, based on main including #16941: new round-trip test passes; full internal/codegen suite shows only the pre-existing TestRocModulePassesCompiler failure (Roc stdlib drift, reproduced on pristine origin/main, unrelated); gofmt clean. Diff: 3 files, +124/−4.

Lane 1222-F (delta PRESS author lane, 2026-11-29). Claim: #1925 comment 7260848430.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T18:58:54Z",
    "session_id": null,
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code-wt-1222f-1925",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code-wt-1222f-1925",
      "repo": "developing-today/code",
      "branch": "lane/1222f-1925-generate-py",
      "sha": "d6a1a2e0775553b96f908986d9d209ca547a0f4c"
    },
    "auth_subject": "oc-code-06",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The Python half of contract section 2's deferred bindings
(docs/script-generate.md): generate() in the generated Python client
plus the mcpx_globals.pyi stub import. Same JSON request/result
contract as the TypeScript binding (PR #16941): a non-dict options
argument raises TypeError; a daemon transport failure returns an
ok:false / errorKind:provider result value; the daemon's
discriminated result passes through untouched. Synchronous, like the
rest of the Python client (call/batch are) -- the
language-appropriate shape of the contract for this client. The Roc
binding stays deferred on the contract's terms.

Verification (authoring worktree on the laptop, on main incl.
PR #16941): new TestPythonGenerateRoundTrip passes -- it drives the
generated client against a fixture daemon (result pass-through,
options on the wire as given, TypeError for a non-dict argument,
provider result for a dead endpoint). Full internal/codegen suite:
only the pre-existing TestRocModulePassesCompiler failure, which
reproduces on pristine origin/main and is unrelated (Roc stdlib
drift). gofmt clean.

Refs #1925. Lane 1222-F (delta PRESS author lane, 2026-11-29).
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f2cb0cd9-f7ca-4162-85e6-fe0d83d14b4d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet
developing-today-fleet Bot merged commit 3af2bec into main Nov 29, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the lane/1222f-1925-generate-py branch November 29, 2026 19:00
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.

0 participants