fix(sparc-service): WatsonX reasoning-model support + Dockerfile fix + SPARC_SKIP_TOOLS - #739
fix(sparc-service): WatsonX reasoning-model support + Dockerfile fix + SPARC_SKIP_TOOLS#739vz-ibm wants to merge 2 commits into
Conversation
Cherry-picked from vz-ibm/kagenti-extensions branch fix/sparc-watsonx-reasoning-patch (a real GitHub fork of this repo, just carrying its pre-rename display name), isolated to providers.py and the Makefile only — that branch as a whole is 400+ files behind current main (missing tlsbridge, contextguru, cpex, and other subsystems merged since it diverged), so checking it out directly would have regressed main rather than just adding the fix. Three patches to providers.py: - _patch_watsonx_for_reasoning_models: WatsonX + IBM LiteLLM proxy return reasoning_content, not content; without this all semantic SPARC calls fail with decision=error - _patch_empty_response_retry: retries on ValueError from empty responses (ISSUE-019), which the IBM LiteLLM proxy returns intermittently under load - _patch_debug_logging: optional SPARC_DEBUG_LLM=true logging Makefile: kind-load target falls back to `podman save | kind load image-archive` when `kind load docker-image` fails (always fails on Linux with rootful Podman). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…IP_TOOLS, logging) Continuing the cherry-pick from vz-ibm/kagenti-extensions fix/sparc-watsonx-reasoning-patch — the first commit only covered providers.py and the deploy Makefile; this one picks up the rest of what that branch touched under authbridge/sparc-service/: - Dockerfile: chown -R sparc:sparc /app before USER sparc — without this, the container crashes on startup with PermissionError since files copied as root are unreadable by the non-root user - api.py: adds SPARC_SKIP_TOOLS (auto-approve named tools without evaluation — required by Step 24 of the VPC guide, which sets this env var directly and would silently no-op without this patch), SPARC_LOG_REQUESTS, and SPARC_STRIP_TOOL_ARG_KEYS - engine.py: reflect log line now includes tool name/args/timestamp for correlation; splits INFO (clean) vs DEBUG (verbose) detail - settings.py, __main__.py: litellm.watsonx provider alias, INFO/DEBUG log level split, SPARC_DEBUG_LLM flag Deliberately NOT ported: the Go-side strip_tool_args patch to authbridge/authlib/plugins/sparc/ (collect.go, plugin.go) — that requires a separate authbridge-proxy image rebuild and isn't needed for the retail/airline benchmarks; the VPC guide's Step 19 already notes it's unusable without a custom AuthBridge build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 58 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| tool_name = request.tool_calls[0].get("function", {}).get("name", "") | ||
| if tool_name in _SKIP_TOOLS: | ||
| # DEBUG: per-call skip entry — visible only at DEBUG level | ||
| log.debug("reflect tool=%s skipped (SPARC_SKIP_TOOLS)", tool_name) |
What this bundles
Three related sparc-service fixes ported from the old kagenti-sparc
codebase, needed to run SPARC on a rossoctl cluster:
1. WatsonX reasoning-model patches
_patch_watsonx_for_reasoning_models— injects the response schema viasystem prompt instead of
response_formatfor WatsonX reasoning modelsand the IBM LiteLLM proxy, which don't support
response_format._patch_empty_response_retry— retries onValueError: No content or tool calls found(an upstream ALTK bug not yet fixed there), withexponential backoff.
SPARC_DEBUG_LLM=true.2. Dockerfile chown fix
Without this the pod crashes on startup — found live while deploying to a
rossoctl cluster (non-root user can't access files owned by root in the
image layer).
3. SPARC_SKIP_TOOLS
SPARC_SKIP_TOOLS=<comma-separated tool names>— auto-approves the namedtools without SPARC evaluation. Needed for infrastructure tools
(
message,calculate,create_session, etc.) and READ-only domaintools that have no policy risk and would otherwise cause false-positive
rejects. Only WRITE tools should go through SPARC's actual reasoning.
Verification
All three were run live on a rossoctl Kind cluster: SPARC deployed and
serving
/reflectsuccessfully with a WatsonX-compatible LiteLLMbackend, pod stable across restarts, and
SPARC_SKIP_TOOLSconfirmed viastartup log (
the following tools will be auto-approved without evaluation: [...]) plus a full 50-task Tau2 airline benchmark runcompleting cleanly with the skip list active.