Skip to content

feat(mcp): honor external lifecycle timeouts - #1992

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/external-mcp-timeouts
Aug 3, 2026
Merged

feat(mcp): honor external lifecycle timeouts#1992
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/external-mcp-timeouts

Conversation

@limityan

@limityan limityan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an ecosystem-neutral external MCP timeout contract for startup, Tool catalog, and execution phases, then map OpenCode, Codex, and Claude Code source semantics without persisting third-party runtime configuration
  • enforce explicit phase deadlines in the existing MCP services owner for local and remote transports, preserving timeout error classification and cleaning pending/startup state
  • disclose effective overrides in the shared external-source snapshot, Desktop settings, and TUI while keeping omitted values on existing BitFun behavior
  • keep runtime-only external MCP Tool-only: Resource/Prompt warmup and unsupported host capabilities are not expanded

Source semantics

Source Native field BitFun phases
OpenCode V1 timeout (ms) startup, Tool catalog, execution
Codex startup_timeout_sec / legacy startup_timeout_ms startup and initial Tool catalog
Codex tool_timeout_sec execution
Claude Code per-server timeout (ms) execution; values below 1000 ms retain Claude Code's ignored-value behavior

Timeout values that cannot cross Rust/JSON/JavaScript surfaces losslessly fail closed at the adapter, product-contract, and native-runtime boundaries.

Architecture and non-goals

  • product domains own stable disclosed facts; ecosystem adapters own native parsing; Assembly performs the single mapping into native MCP config; services-integrations owns process/transport deadline behavior; GUI/TUI only consume the shared projection
  • no Plugin Host Runtime, LSP, SSE/OAuth expansion, Agent-scoped MCP, marketplace/cache support, OpenCode V2 phased schema, retry, or replay is added
  • a deadline stops BitFun waiting; it does not claim the server-side operation was cancelled and it is not reset by progress notifications
  • the existing manager-wide external lifecycle lock can still let cross-server rapid re-enable contention consume the outer startup guard; correcting that requires a separate per-server fencing/atomic-publication refactor rather than a timeout workaround

Validation

  • cargo test -p bitfun-product-domains --features external-sources --test external_source_contracts (47 passed)
  • OpenCode/Codex/Claude Code MCP adapter suites (10 / 18 / 12 passed)
  • services MCP lib/contracts/streamable HTTP suites (18 / 43 / 2 passed)
  • cargo test -p bitfun-core --features product-full external_mcp (9 passed)
  • focused Web external-source API/settings suites (77 passed)
  • cargo check -p bitfun-core --features product-full
  • cargo check -p bitfun-cli
  • Web type-check and lint
  • i18n contract (37 passed) and audit (0 warnings)
  • Core boundary and repository hygiene checks

@limityan
limityan merged commit 2f5ef04 into GCWing:main Aug 3, 2026
7 checks passed
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.

1 participant