Skip to content

fix(mcp,text): MCP activation hints and enable_thinking retry - #126

Open
hopelynd wants to merge 4 commits into
mainfrom
fix/web-search-and-thinking
Open

fix(mcp,text): MCP activation hints and enable_thinking retry#126
hopelynd wants to merge 4 commits into
mainfrom
fix/web-search-and-thinking

Conversation

@hopelynd

Copy link
Copy Markdown
Collaborator

Summary

  • Add actionable activation hints when Bailian MCP servers return 404 not-activated / invalid errors, with deep links to the MCP marketplace detail page (mcpMarketplaceDetailPage).
  • Generalize WebSearch-specific hint logic into shared activate-hint helpers and apply them to search web, mcp tools, and mcp call (skipped when --url overrides the endpoint).
  • Fix text chat enable_thinking handling: omit the field by default for streaming, set false for non-streaming, and retry once when the API returns a clear constraint error.
  • Preserve thinking_budget across enable_thinking retries via applyChatEnableThinkingWithBudget.
  • Reuse the same retry helpers in API key login validation.

Test plan

  • vp check (format, lint, type check)
  • Unit tests: packages/core/tests/thinking.test.ts
  • Unit tests: packages/commands/tests/mcp-activate-hint.test.ts
  • Unit tests: packages/commands/tests/search-web-activate-hint.test.ts
  • Manual: run bl search web --query "test" against an account without WebSearch MCP activated and verify the hint includes the marketplace URL
  • Manual: run bl mcp tools --server <code> / bl mcp call --target <code>.<tool> against an unactivated MCP and verify server-specific hint
  • Manual: run bl text chat --thinking-budget 2048 on a model that requires enable_thinking retry and confirm the retried request includes thinking_budget

hopelynd added 4 commits July 27, 2026 16:51
…s false

Non-streaming chat no longer forces enable_thinking=false, which breaks
thinking-only models. Retry once with false only when the server demands it.
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