Skip to content

test(sdk/python): remove obsolete enable_mcp test arguments - #1113

Closed
remote-controlled-man wants to merge 1 commit into
Agent-Field:mainfrom
remote-controlled-man:codex/enable-mcp-test-compatibility
Closed

remote-controlled-man wants to merge 1 commit into
Agent-Field:mainfrom
remote-controlled-man:codex/enable-mcp-test-compatibility

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Summary

Six shutdown/DID test constructors still pass enable_mcp=False, which the current Agent constructor forwards to FastAPI through **kwargs. FastAPI 0.145 removed its unused extra keyword arguments, so these constructors raise TypeError before their assertions execute when SDK CI installs a recent FastAPI release.

Remove those six stale arguments from the two test files. Production code, test assertions, and dependency requirements are unchanged.

Type of change

  • Tests only

Test plan

Verified on macOS arm64 with Python 3.12.14, FastAPI 0.148.0, and Ruff 0.15.22, reusing the same installed environment:

  • ./scripts/run_pytest.sh tests/test_agent_graceful_shutdown.py tests/test_did_manager_error_paths.py --no-cov: 26 passed.
  • ruff check .: passed.
  • mypy --config-file mypy.ini agentfield/: passed.
  • ./scripts/run_pytest.sh with the configured coverage collection and JSON/XML reports: 2558 passed, 4 skipped, 38 deselected by the repository's default markers; measured coverage 94.72% (2244/2369 statements).

ruff format --check . remains failing for the same 102 files on the unchanged base and this head. The graceful-shutdown file has the same two existing line-wrap differences on both sides; the DID file is already formatted on both sides. No autoformat was applied. The SDK CI formatting step is nonblocking, and this is not reported as a formatting pass.

The Linux/alternate Python and websockets matrices, repository-wide ./scripts/test-all.sh, make fmt tidy, Docker checks, hosted CI, and all-surface coverage aggregation/gate were not run locally. Go is unavailable and the Docker daemon is not running on this host.

Test coverage

  • I ran tests for the surface(s) I changed locally.
  • No production code paths or assertions are added or removed; the existing tests cover the six constructors after their stale arguments are removed.
  • The coverage gate check is green in CI before requesting review.

Checklist

  • I have read docs/CONTRIBUTING.md and docs/DEVELOPMENT.md.
  • Commits are signed and follow conventional-commits style.

Related issues / PRs

Related to #1109's Python SDK CI failure. This test compatibility repair is independent of its callback retry changes and does not close #1088.

Agent never accepted enable_mcp, so the flag fell through **kwargs into
FastAPI. FastAPI 0.145 removed **extra, and unpinned CI installs 0.146,
which raises TypeError. Removing the argument restores the previous
no-op without pinning FastAPI.

Co-authored-by: Steven Huang <remote-controlled-man@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 15:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
Python 9.1 KB - 0.29 µs -17% ✓ ✓

✓ No regressions detected

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage gate

Thresholds from .coverage-gate.toml: per-surface ≥ 84%, aggregate ≥ 85%, max per-surface regression ≤ 1.0 pp, max aggregate regression ≤ 0.50 pp.

Surface Current Baseline Δ
control-plane 88.00% 87.40% ↑ +0.60 pp 🟡
sdk-go 93.30% 92.00% ↑ +1.30 pp 🟢
sdk-python 94.72% 93.73% ↑ +0.99 pp 🟢
sdk-typescript 91.77% 90.42% ↑ +1.35 pp 🟢
web-ui 84.76% 84.79% ↓ -0.03 pp 🟡
aggregate 85.95% 85.75% ↑ +0.20 pp 🟡

✅ Gate passed

No surface regressed past the allowed threshold and the aggregate stayed above the floor.

@github-actions

Copy link
Copy Markdown
Contributor

📐 Patch coverage gate

Threshold: 80% on lines this PR touches vs origin/main (from .coverage-gate.toml:thresholds.min_patch).

Surface Touched lines Patch coverage Status
control-plane 0 — ➖ no changes
sdk-go 0 — ➖ no changes
sdk-python 0 — ➖ no changes
sdk-typescript 0 — ➖ no changes
web-ui 0 — ➖ no changes

✅ Patch gate passed

Every surface whose lines were touched by this PR has patch coverage at or above the threshold.

@AbirAbbas

Copy link
Copy Markdown
Contributor

Thanks for catching this. We ran into the same FastAPI change in parallel and #1120 landed the identical six-line removal on main a couple of hours after you opened this, so this PR is now a no-op against main. Closing it as superseded, but you spotted it first.

@AbirAbbas AbirAbbas closed this Oct 19, 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.

Python/TS SDKs: align status-callback retry policy with the Go SDK (#1081)

4 participants