[PR #1] [MERGED] Upgrade to claude-agent-sdk and add max_buffer_size support #78

Closed
opened 2026-02-27 10:22:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/1
Author: @odinho
Created: 11/25/2025
Status: Merged
Merged: 12/13/2025
Merged by: @mikeyobrien

Base: mainHead: odin/fix_json_mini_size


📝 Commits (2)

  • 9752e26 Upgrade to claude-agent-sdk and add max_buffer_size support
  • 17dcd05 Add user settings inheritance for MCP servers and CLAUDE.md

📊 Changes

3 files changed (+77 additions, -16 deletions)

View changed files

📝 pyproject.toml (+1 -1)
📝 src/ralph_orchestrator/adapters/claude.py (+58 -9)
📝 uv.lock (+18 -6)

📄 Description

Summary

  • Update dependency from claude-code-sdk to claude-agent-sdk>=0.1.10 (package was renamed upstream)
  • Add configurable max_buffer_size (default 10MB) to handle large JSON responses from MCP tools like chrome-devtools-mcp screenshots
  • Add backwards compatibility fallback for old claude_code_sdk import
  • Restore user settings inheritance that the new SDK removed by default

Problem

  1. When using MCP tools that return large payloads (like screenshots from chrome-devtools-mcp), the SDK threw:

    JSON message exceeded maximum buffer size of 1048576 bytes
    
  2. The new claude-agent-sdk no longer reads filesystem settings by default (breaking change from the old claude-code-sdk). Without this fix, users would lose access to their configured MCP servers and CLAUDE.md files.

Solution

  1. Upgrades to claude-agent-sdk>=0.1.10 which includes configurable max_buffer_size
  2. Sets a 10MB default buffer size, configurable per-adapter or per-call
  3. Adds setting_sources=['user', 'project', 'local'] to restore the previous behavior of loading user's Claude Code configuration:
    • MCP servers from ~/.claude/settings.json
    • Project settings from .claude/settings.json
    • Local settings from .claude/settings.local.json
    • CLAUDE.md files
  4. Adds optional cli_path parameter to use user's installed Claude Code CLI instead of bundled

New Parameters

  • inherit_user_settings (default: True) - Load user's Claude Code settings including MCP servers
  • cli_path (optional) - Path to user's Claude Code CLI

https://github.com/anthropics/claude-agent-sdk-python/issues/98


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mikeyobrien/ralph-orchestrator/pull/1 **Author:** [@odinho](https://github.com/odinho) **Created:** 11/25/2025 **Status:** ✅ Merged **Merged:** 12/13/2025 **Merged by:** [@mikeyobrien](https://github.com/mikeyobrien) **Base:** `main` ← **Head:** `odin/fix_json_mini_size` --- ### 📝 Commits (2) - [`9752e26`](https://github.com/mikeyobrien/ralph-orchestrator/commit/9752e267d4e88206c6c4942f1480af6410a605b6) Upgrade to claude-agent-sdk and add max_buffer_size support - [`17dcd05`](https://github.com/mikeyobrien/ralph-orchestrator/commit/17dcd05923544c80ddfdbf077bdf3824e0cff5ef) Add user settings inheritance for MCP servers and CLAUDE.md ### 📊 Changes **3 files changed** (+77 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `pyproject.toml` (+1 -1) 📝 `src/ralph_orchestrator/adapters/claude.py` (+58 -9) 📝 `uv.lock` (+18 -6) </details> ### 📄 Description ## Summary - Update dependency from `claude-code-sdk` to `claude-agent-sdk>=0.1.10` (package was renamed upstream) - Add configurable `max_buffer_size` (default 10MB) to handle large JSON responses from MCP tools like chrome-devtools-mcp screenshots - Add backwards compatibility fallback for old `claude_code_sdk` import - Restore user settings inheritance that the new SDK removed by default ## Problem 1. When using MCP tools that return large payloads (like screenshots from chrome-devtools-mcp), the SDK threw: ``` JSON message exceeded maximum buffer size of 1048576 bytes ``` 2. The new `claude-agent-sdk` **no longer reads filesystem settings by default** (breaking change from the old `claude-code-sdk`). Without this fix, users would lose access to their configured MCP servers and CLAUDE.md files. ## Solution 1. Upgrades to `claude-agent-sdk>=0.1.10` which includes configurable `max_buffer_size` 2. Sets a 10MB default buffer size, configurable per-adapter or per-call 3. Adds `setting_sources=['user', 'project', 'local']` to restore the previous behavior of loading user's Claude Code configuration: - MCP servers from `~/.claude/settings.json` - Project settings from `.claude/settings.json` - Local settings from `.claude/settings.local.json` - CLAUDE.md files 4. Adds optional `cli_path` parameter to use user's installed Claude Code CLI instead of bundled ## New Parameters - `inherit_user_settings` (default: `True`) - Load user's Claude Code settings including MCP servers - `cli_path` (optional) - Path to user's Claude Code CLI https://github.com/anthropics/claude-agent-sdk-python/issues/98 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:22:08 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ralph-orchestrator#78
No description provided.