Skip to content

Commit 9813bd8

Browse files
Fix duplicate bot responses, add S3 rclone flags, and increase transfer job resources
Fix triage model ID (claude-haiku-4-20250414 → claude-haiku-4-5-20251001) that was causing 404 errors and fail-open duplicate responses. Deduplicate @mention messages in the thread handler since handle_mention already processes them. Append S3-specific upload flags when destination is an S3 endpoint. Increase transfer job defaults to 4-day wall clock, 16 CPUs, and 100G memory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1fc7976 commit 9813bd8

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

src/xfer/slackbot/app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def handle_mention(event: dict[str, Any], say: Any) -> None:
197197
)
198198

199199
@app.event("message")
200-
def handle_message(event: dict[str, Any], say: Any) -> None:
200+
def handle_message(event: dict[str, Any], say: Any, context: dict[str, Any]) -> None:
201201
"""
202202
Handle direct messages and thread replies.
203203
@@ -254,6 +254,11 @@ def handle_message(event: dict[str, Any], say: Any) -> None:
254254
if not is_allowed_channel(channel):
255255
return
256256

257+
# Skip @mentions — handle_mention already processes those
258+
bot_user_id = context.get("bot_user_id", "")
259+
if bot_user_id and f"<@{bot_user_id}>" in text:
260+
return
261+
257262
# Check if we have history in this thread (meaning we've been mentioned)
258263
history = conversations.get(channel, thread_ts)
259264

src/xfer/slackbot/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class SlurmDefaults:
1515
"""Default Slurm job parameters."""
1616

1717
partition: str = "transfer"
18-
time_limit: str = "24:00:00"
19-
cpus_per_task: int = 4
20-
mem: str = "8G"
18+
time_limit: str = "4-00:00:00"
19+
cpus_per_task: int = 16
20+
mem: str = "100G"
2121
array_concurrency: int = 64
2222
num_shards: int = 256
2323
max_attempts: int = 5
@@ -60,7 +60,7 @@ class BotConfig:
6060
default_factory=lambda: os.environ.get("ANTHROPIC_API_KEY", "")
6161
)
6262
claude_model: str = "claude-sonnet-4-20250514"
63-
triage_model: str = "claude-haiku-4-20250414"
63+
triage_model: str = "claude-haiku-4-5-20251001"
6464

6565
# Paths
6666
runs_base_dir: Path = field(default_factory=lambda: Path.home() / "xfer-runs")

src/xfer/slackbot/slurm_tools.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ def _write_prepare_script(
195195
# User flags to append after analysis-suggested flags
196196
user_rclone_flags = rclone_flags or ""
197197

198+
# Extract remote name from dest for S3 detection
199+
dest_remote = dest.split(":")[0]
200+
198201
# Get xfer install directory for uv
199202
xfer_dir = config.xfer_install_dir or Path(__file__).parent.parent.parent.parent.resolve()
200203

@@ -363,6 +366,24 @@ def _write_prepare_script(
363366
else
364367
RCLONE_FLAGS="$SUGGESTED_FLAGS"
365368
fi
369+
370+
# Append S3-specific flags when destination is an S3 endpoint
371+
DEST_TYPE=$(python3 -c "
372+
import configparser
373+
remote = '{dest_remote}'
374+
if remote == 's3':
375+
print('s3')
376+
else:
377+
c = configparser.ConfigParser()
378+
c.read('{config.rclone.config_path}')
379+
print(c.get(remote, 'type', fallback=''))
380+
")
381+
if [ "$DEST_TYPE" = "s3" ]; then
382+
S3_FLAGS="--s3-upload-concurrency 8 --buffer-size=32M --multi-thread-stream=8 --multi-thread-cutoff=64M --s3-upload-cutoff 0 --s3-chunk-size 32M"
383+
RCLONE_FLAGS="$RCLONE_FLAGS $S3_FLAGS"
384+
echo "S3 destination detected, appended: $S3_FLAGS"
385+
fi
386+
366387
echo "Final rclone flags: $RCLONE_FLAGS"
367388
368389
echo "=== Analysis complete at $(date -Is) ==="

0 commit comments

Comments
 (0)