Skip to content

Commit 2adaa0c

Browse files
sjarmakclaude
andcommitted
fix: scope artifact config auto-detection to filtered tasks only
Previous logic checked if the selection file contained any mcp_suite entries, which triggered artifact mode even when --benchmark filtered to SDLC tasks. Now applies the same --benchmark and --use-case-category filters before checking, so artifact mode only activates when ALL filtered tasks are MCP-unique. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0173ce9 commit 2adaa0c

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

configs/run_selected_tasks.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,32 @@ fi
138138

139139
# Auto-detect artifact config for MCP-unique selection files
140140
# MCP-unique tasks use mcp_suite (not benchmark) and REQUIRE artifact configs.
141+
# Only triggers when ALL filtered tasks are MCP-unique (have mcp_suite, not benchmark).
141142
if [ "$_FULL_CONFIG_EXPLICIT" = false ]; then
142143
if python3 -c "
143144
import json, sys
144145
data = json.load(open('$SELECTION_FILE'))
145-
has_mcp_suite = any('mcp_suite' in t for t in data.get('tasks', []))
146-
sys.exit(0 if has_mcp_suite else 1)
146+
bm_filter = '$BENCHMARK_FILTER'
147+
cat_filter = '$USE_CASE_CATEGORY_FILTER'
148+
tasks = data.get('tasks', [])
149+
# Apply same filters as extract_tasks()
150+
filtered = []
151+
for t in tasks:
152+
suite = t.get('benchmark') or t.get('mcp_suite', '')
153+
if not suite:
154+
continue
155+
if bm_filter and suite != bm_filter:
156+
continue
157+
if cat_filter and t.get('use_case_category', '') != cat_filter:
158+
continue
159+
filtered.append(t)
160+
if not filtered:
161+
sys.exit(1)
162+
all_mcp = all('mcp_suite' in t and 'benchmark' not in t for t in filtered)
163+
sys.exit(0 if all_mcp else 1)
147164
" 2>/dev/null; then
148165
FULL_CONFIG="mcp-remote-artifact"
149-
echo "Auto-detected MCP-unique selection file → using artifact configs ($FULL_CONFIG)"
166+
echo "Auto-detected MCP-unique tasks → using artifact configs ($FULL_CONFIG)"
150167
fi
151168
fi
152169

0 commit comments

Comments
 (0)