Skip to content

Pin api-simulator dependency and fix test-smoke-record task #688

@Trecek

Description

@Trecek

Summary

task test-smoke-record fails because the api-simulator package is not installed in the uv tool environment where autoskillit serve runs. The MCP server crashes during make_context() when it tries to import api_simulator.claude (triggered by RECORD_SCENARIO=1), so Claude Code sees zero MCP tools and the orchestrator can't find open_kitchen.

Root Cause

api-simulator is listed as a bare name in pyproject.toml dev dependencies (line 49) with no source URL. It resolves only when an editable install exists in the active Python environment. The autoskillit CLI is installed as a uv tool with its own isolated Python at ~/.local/share/uv/tools/autoskillit/bin/python3, which has no api-simulator.

Important: The api-simulator on PyPI is an unrelated package (FastAPI/websockets). Our api-simulator is a private Rust/PyO3 package at TalonT-Org/api-simulator (maturin build). It must be installed from the GitHub repo via the git+ssh dependency already declared in pyproject.toml.

The env var inheritance chain: Taskfile sets RECORD_SCENARIO=1autoskillit order passes full os.environ to the claude subprocess (app.py:441) → Claude spawns autoskillit serve (MCP server) → make_context() in _factory.py:136-157 sees RECORD_SCENARIO=1 with a valid directory → attempts from api_simulator.claude import make_scenario_recorderImportError → re-raised as RuntimeError → server crashes before mcp.run().

Changes Required

1. Pin api-simulator as a git+ssh dependency in pyproject.toml

Replace the bare "api-simulator" in dev dependencies with a git URL pinned to a commit, pointing at the subdirectory containing the Python package:

[project.optional-dependencies]
dev = [
    # ... existing deps ...
    "api-simulator @ git+ssh://git@github.com/TalonT-Org/api-simulator.git@11aecd04a1bc86d7da0ca9043b26e30a49e6bc20#subdirectory=crates/api-simulator-py",
]

Requires Rust toolchain + maturin on the dev machine (already present: rustc 1.96.0, maturin 1.12.6).

After updating, run uv lock to regenerate the lockfile.

2. Fix install-dev Taskfile task to include [dev] extras

The current install-dev task installs the bare package without extras:

# BEFORE
- uv tool install --force "git+https://github.com/TalonT-Org/AutoSkillit.git@integration"

Change to install with [dev] extras so api-simulator (and all other dev deps) are included in the uv tool environment:

# AFTER
- uv tool install --force "autoskillit[dev] @ git+https://github.com/TalonT-Org/AutoSkillit.git@integration"

3. Fix test-smoke-record Taskfile task

Replace the broken pytest-based task with one that runs autoskillit order smoke-test with recording env vars:

test-smoke-record:
  desc: Record smoke test scenario by running autoskillit order with recording enabled
  env:
    RECORD_SCENARIO: "1"
    RECORD_SCENARIO_DIR: '{{.RECORD_SCENARIO_DIR | default "tests/fixtures/scenarios/smoke-happy"}}'
    RECORD_SCENARIO_RECIPE: "smoke-test"
  cmds:
    - |
      mkdir -p "$RECORD_SCENARIO_DIR"
      echo "Recording smoke-test scenario"
      echo "  RECORD_SCENARIO_DIR=$RECORD_SCENARIO_DIR"
      echo ""
      autoskillit order smoke-test

Acceptance Criteria

  • api-simulator pinned as git+ssh dependency in pyproject.toml dev dependencies
  • uv lock succeeds with the new dependency
  • task install-dev installs with [dev] extras (includes api-simulator)
  • task test-smoke-record launches autoskillit order smoke-test with recording env vars
  • MCP server starts successfully when RECORD_SCENARIO=1 is set (no ImportError crash)

Investigation Report

Full root cause analysis at .autoskillit/temp/investigate/investigation_smoke-record-mcp-not-found_2026-04-09_120000.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    recipe:implementationRoute: proceed directly to implementationstagedImplementation staged and waiting for promotion to main

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions