Skip to content

[Feat] Support local decision models in MCP decide - #18

Merged
Yunaik merged 1 commit into
ThinkFlowLab:mainfrom
alexwong10:feat/mcp-decision-model-selection
Sep 27, 2026
Merged

Yunaik merged 1 commit into
ThinkFlowLab:mainfrom
alexwong10:feat/mcp-decision-model-selection

Conversation

@alexwong10

Copy link
Copy Markdown
Contributor

Why

The CLI can use Jev, Laya, or Cua-S1 for a single decision, but the MCP decide tool always constructs Jev. MCP callers cannot choose a local decision model.

How

Add an optional model parameter with an enumerated MCP schema (jev, laya, cua) and preserve jev as the default. Reuse the existing model factory, answer validation, optional-dependency errors, and model cleanup. Load models on a worker thread, serialize calls with the existing run lock, and route SDK stdout to stderr to protect the stdio protocol.

What

MCP clients can pass model="laya" or model="cua" after installing the matching extra. Existing calls and the result shape remain unchanged. Update the tool instructions, MCP documentation, and changelog. Each call creates its own model; reported decision latency excludes loading time.

Verification

  • The new schema and local-model selection checks fail against unchanged a0ae3e1 (missing model property and build_model("jev") despite a local selection) and pass with this change.
  • Added MCP tests cover the default, both local selections, rejected names, cleanup on success/failure, missing-extra errors, and clean stdout. They use fake model backends; real checkpoint downloads and GPU inference were not exercised.
  • Passed on Windows / Python 3.11.16: ruff format --check ., ruff check ., ty check, uv lock --check --offline, and uv build --offline.
  • Full pytest -q: 486 passed, 41 skipped, 2 failed. Both failures are the existing TestBrowserHandsLifecycle.test_serving_shuts_the_static_server_down_when_the_session_ends / ..._fails_to_open checks: the closed-port probe raises TimeoutError on this Windows host. Both reproduce on unchanged a0ae3e1 with the same environment.
  • scripts/smoke.sh stops at the list comparison because Windows CLI output contains CRLF. This also reproduces on unchanged a0ae3e1; the script itself was read with LF line endings for the check.

@Yunaik Yunaik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thank you!

@Yunaik
Yunaik merged commit b32d553 into ThinkFlowLab:main Sep 27, 2026
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