Conversation
…rface expired MCP connections - Add DecryptionError class with phase tracking (DEK vs value decryption) - Auto-mark OAuth connections as expired when tokens can't be decrypted - Add getSafeModelParams to strip unsupported provider params (Anthropic, reasoning models) - Surface expired connection status in all 4 MCP status tools (GitHub, Google, Linear, Notion) - Fix MCP settings placement in character.settings for plugin-mcp discovery - Only load knowledge plugin when documents exist (not eagerly in ASSISTANT mode) - Remove roomId filter from document count query for agent-level counts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Code Review - PR #288SummaryThis PR adds robust error handling for OAuth token decryption failures, model parameter sanitization, and improved MCP connection status reporting. The changes are well-structured and address real operational concerns around key rotation and provider compatibility. ✅ Strengths1. Decryption Error Handling (
|
When buildMcpSettings returns {} for a cached runtime, stale
charSettings.mcp from a previous request was persisted. Now
explicitly deletes charSettings.mcp when no MCP config applies.
Ref: #288 (comment)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GitHub status was missing the email field that Google, Linear, and Notion all include. Re-add for consistency across all MCP status tools. Ref: #288 (comment) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Anthropic's Messages API supports stop_sequences. Removed stopSequences from getSafeModelParams strip list and stop from /responses route strip. Ref: #288 (comment) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use a shallow copy (safeRequest) instead of deleting properties from the original request object. Also rename provider2 to modelProvider. Ref: #288 (comment) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
name.includes("o1") could match unrelated models like "modelo1-custom".
Now uses startsWith for claude-opus and /^o[13](-|$)/ regex for OpenAI
reasoning models (o1, o3, o1-preview, o3-mini).
Ref: #288 (comment)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Guard against empty secretId, organizationId, or connectionId before calling secretsService.getDecryptedValue() to surface clear errors. Ref: #288 (comment) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude says: Addressed the following from this review: Fixed:
Acknowledged but deferring:
Claude |
PR Review: Decryption Errors, Model Params, and MCP ImprovementsOverall AssessmentThis is a well-structured PR that addresses several important issues around OAuth token handling, AI model parameter compatibility, and MCP integration. The changes are defensive and mostly additive, which aligns with the "Medium Risk" assessment. ✅ Strengths1. Decryption Error Handling (
|
|
Claude says: Re: the new review comment — 1. isReasoningModel pattern: The 2. Refactor /responses to use getSafeModelParams(): Good consistency observation, but the two routes use different parameter naming conventions — 3. Document count query: Already addressed in previous comment — intentionally agent-level, not per-room. 4. Missing tests: Agreed, tracked for follow-up. Claude |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
DecryptionErrorclass with phase tracking. OAuth connections auto-marked asexpiredwhen tokens can't be decrypted (key rotation/mismatch). User-facing error messages guide reconnection.getSafeModelParamsandisReasoningModelto strip unsupported params (frequencyPenalty/presencePenalty for Anthropic, temperature for reasoning models) before sending to AI gateway.{ connected: false, status: "expired" }so the frontend can prompt reconnection.character.settings.mcpinstead ofopts.settingssoplugin-mcpcan discover them viaruntime.character.settings.mcp.Test plan
runtime.character.settings.mcp🤖 Generated with Claude Code
Note
Medium Risk
Touches OAuth token retrieval/refresh and AI request parameter shaping; mistakes could break third-party integrations or cause some model requests to fail, but changes are localized and mostly additive/defensive.
Overview
Improves resilience and UX around OAuth-backed integrations by detecting token decryption failures, marking affected connections as
expired, and surfacing reconnection guidance. The MCP*_statustools for GitHub/Google/Linear/Notion now explicitly returnstatus: "expired"(with a message) when no active connection exists but an expired one does.Hardens AI gateway requests by introducing
isReasoningModel/getSafeModelParamsand using them inchat/completions(and analogous logic inresponses) to strip provider/model-unsupported parameters (e.g., Anthropic penalties; temperature for reasoning models), reducing gateway warnings and invalid requests.Adjusts Eliza runtime plumbing: MCP server config is injected into
runtime.character.settings.mcp(and refreshed for cached runtimes) soplugin-mcpcan discover it, knowledge plugin loading is now conditional on documents existing, and document counting is widened to be agent-level across rooms.Written by Cursor Bugbot for commit b3379ac. This will update automatically on new commits. Configure here.