Skip to content

police sweep 2026-06-02: docs sync — MCP lifecycle async behavior - #5

Closed
onebit0fme wants to merge 1 commit into
mainfrom
police/sweep-2026-06-02
Closed

police sweep 2026-06-02: docs sync — MCP lifecycle async behavior#5
onebit0fme wants to merge 1 commit into
mainfrom
police/sweep-2026-06-02

Conversation

@onebit0fme

Copy link
Copy Markdown
Contributor

Docs-sync PR from the 2026-06-02 police sweep (monorepo range: initial HEAD through e64bc77).

Change

api-reference/mcp.mdx — MCP lifecycle tool async-behavior description was incorrect.

The page stated that train, discover_traits, and synthesize_samples all "return once the run is enqueued" and instructed callers to "poll get_model for the state rather than waiting on the call."

Actual behavior (from api/mcp.py):

  • train — fire-and-forget: enqueues the run and returns immediately. Poll get_model for completion. ✓ (doc was correct for this one)
  • discover_traitsblocks until the run finishes, streaming notifications/progress on the same MCP request stream. May take several minutes.
  • synthesize_samples — same blocking behavior as discover_traits.

For discover_traits and synthesize_samples, telling callers to "poll rather than waiting on the call" is actively wrong — the call already awaits completion.

Fix

Updated the tool-table rows to distinguish the behaviors and rewrote the explanatory prose below the table. No other pages affected (the /v1 REST equivalents correctly say "202 Accepted" / async; MCP's blocking behavior is an MCP-layer concern documented only on this page).

https://claude.ai/code/session_015z6Nsyx37deuN4o7kAEQWZ


Generated by Claude Code

discover_traits and synthesize_samples block-and-poll for up to 5 minutes
and stream progress notifications on the same request — they do NOT return
once enqueued. Only train is fire-and-forget.

Updated:
- tool table rows to say "Blocks until the run completes, streaming progress"
  for discover_traits and synthesize_samples vs "Enqueues the run and returns
  immediately" for train
- explanatory prose below the table to distinguish the two behaviors and note
  that poll/get_model is only needed on timeout/disconnect for the blocking tools

Evidence: api/mcp.py discover_traits (lines 1413-1500) and synthesize_samples
(1510-1600) block-and-poll up to 300s; train returns after enqueue.

https://claude.ai/code/session_015z6Nsyx37deuN4o7kAEQWZ
@mintlify

mintlify Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
u22a8 🟢 Ready View Preview Jun 2, 2026, 7:42 AM

@onebit0fme onebit0fme closed this Jun 6, 2026
@onebit0fme
onebit0fme deleted the police/sweep-2026-06-02 branch June 6, 2026 18:24
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