Skip to content

Commit b8f4335

Browse files
Allow users to set lower array concurrency (max 64)
- Add array_concurrency parameter to submit_transfer tool - Cap maximum at 64 to prevent overloading storage systems - Users can request lower values (e.g., 32, 16) for gentler transfers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1c01ddb commit b8f4335

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/xfer/slackbot/claude_agent.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
"type": "string",
7070
"description": "Additional rclone flags to append to defaults (e.g., '--bwlimit 100M --checksum')",
7171
},
72+
"array_concurrency": {
73+
"type": "integer",
74+
"description": "Maximum concurrent Slurm array tasks (default: 64, max: 64). Lower this to reduce load on storage systems.",
75+
},
7276
},
7377
"required": ["source", "dest"],
7478
},
@@ -267,13 +271,21 @@ def execute_tool(
267271
) -> str:
268272
"""Execute a tool and return the result as a string."""
269273
if tool_name == "submit_transfer":
274+
# Cap array_concurrency at 64 (the default maximum)
275+
array_concurrency = tool_input.get("array_concurrency")
276+
if array_concurrency is not None:
277+
array_concurrency = min(int(array_concurrency), 64)
278+
if array_concurrency < 1:
279+
array_concurrency = 1
280+
270281
result = submit_transfer(
271282
source=tool_input["source"],
272283
dest=tool_input["dest"],
273284
config=self.config,
274285
channel_id=channel_id,
275286
thread_ts=thread_ts,
276287
num_shards=tool_input.get("num_shards"),
288+
array_concurrency=array_concurrency,
277289
time_limit=tool_input.get("time_limit"),
278290
job_name=tool_input.get("job_name"),
279291
rclone_flags=tool_input.get("rclone_flags"),

0 commit comments

Comments
 (0)