[Concept,6/9] pickman: Increase agent SDK buffer size to 10MB

Message ID 20260212211626.167191-7-sjg@u-boot.org
State New
Headers
Series pickman: Improve handling of large merges and add rewind |

Commit Message

Simon Glass Feb. 12, 2026, 9:16 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The default 1MB buffer size can be exceeded when the agent processes
large responses, causing a fatal error. Increase max_buffer_size to
10MB for both the cherry-pick and review agents.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 tools/pickman/agent.py | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/tools/pickman/agent.py b/tools/pickman/agent.py
index 129743bb329..85f8efee1df 100644
--- a/tools/pickman/agent.py
+++ b/tools/pickman/agent.py
@@ -24,6 +24,9 @@  SIGNAL_SUCCESS = 'success'
 SIGNAL_APPLIED = 'already_applied'
 SIGNAL_CONFLICT = 'conflict'
 
+# Maximum buffer size for agent responses
+MAX_BUFFER_SIZE = 10 * 1024 * 1024  # 10MB
+
 # Commits that need special handling (regenerate instead of cherry-pick)
 # These run savedefconfig on all boards and depend on target branch
 # Kconfig state
@@ -219,6 +222,7 @@  this means the series was already applied via a different path. In this case:
     options = ClaudeAgentOptions(
         allowed_tools=['Bash', 'Read', 'Grep'],
         cwd=repo_path,
+        max_buffer_size=MAX_BUFFER_SIZE,
     )
 
     tout.info(f'Starting Claude agent to cherry-pick {len(commits)} commits...')
@@ -482,6 +486,7 @@  async def run_review_agent(mr_iid, branch_name, comments, remote,
     options = ClaudeAgentOptions(
         allowed_tools=['Bash', 'Read', 'Grep', 'Edit', 'Write'],
         cwd=repo_path,
+        max_buffer_size=MAX_BUFFER_SIZE,
     )
 
     tout.info(f'Starting Claude agent to {task_desc}...')