Skip to content

docs(sparc-service): document SPARC_LOG_REQUESTS and SPARC_STRIP_TOOL_ARG_KEYS - #741

Open
vz-ibm wants to merge 1 commit into
rossoctl:mainfrom
vz-ibm:docs/sparc-service-env-vars-partial
Open

docs(sparc-service): document SPARC_LOG_REQUESTS and SPARC_STRIP_TOOL_ARG_KEYS#741
vz-ibm wants to merge 1 commit into
rossoctl:mainfrom
vz-ibm:docs/sparc-service-env-vars-partial

Conversation

@vz-ibm

@vz-ibm vz-ibm commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Documents two sparc-service env vars that were introduced by PR #738 (merged 2026-08-10) but never added to the README's Configuration table:

  • SPARC_LOG_REQUESTS
  • SPARC_STRIP_TOOL_ARG_KEYS

Addresses part of the "Undocumented env vars" item flagged in the PR #739 review (#739 (comment), section 7).

Scope

Deliberately partial — only vars present on main today. The remaining ones (SPARC_SKIP_TOOLS, SPARC_DEBUG_LLM, SPARC_SCHEMA_IN_PROMPT) are introduced by PR #739 and will be documented in a follow-up doc-only PR once that merges, to keep this PR narrow and mergeable independently.

Test plan

  • README renders — no other content touched
  • Sign-off included

Summary by CodeRabbit

  • New Features
    • Added an option to log incoming reflection requests at INFO level.
    • Added an option to remove specified tool-call argument keys before evaluation.

…_ARG_KEYS

These two env vars were introduced by PR rossoctl#738 (merged 2026-08-10) but never
added to the sparc-service README's Configuration table. Documenting them here
so operators discover them without having to read settings.py.

Not touched here (not on main yet): SPARC_SKIP_TOOLS, SPARC_DEBUG_LLM, and
SPARC_SCHEMA_IN_PROMPT — those arrive with PR rossoctl#739, and will be documented in
a follow-up PR once that merges.

Signed-off-by: Vitaly Zabershinsky <VITALYZ@il.ibm.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The README documents SPARC_LOG_REQUESTS for incoming request logging and SPARC_STRIP_TOOL_ARG_KEYS for removing selected tool-call argument keys before SPARC evaluation.

Changes

SPARC configuration documentation

Layer / File(s) Summary
Configuration option documentation
authbridge/sparc-service/README.md
Documents optional request logging, sensitive payload exposure, and configurable removal of selected tool-call argument keys before reflection.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • rossoctl/cortex#738: Documents the same SPARC_LOG_REQUESTS and SPARC_STRIP_TOOL_ARG_KEYS configuration changes.

Suggested reviewers: abigailgold

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the README documentation changes for both SPARC configuration options.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@authbridge/sparc-service/README.md`:
- Line 105: Update the SPARC_STRIP_TOOL_ARG_KEYS documentation to describe
tool_calls[].function.arguments as a JSON-encoded string; clarify that the
string is decoded and the configured keys are removed from the resulting
argument object before SPARC evaluates the call.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1eef62e9-2fc6-40ae-8d79-f98d45209797

📥 Commits

Reviewing files that changed from the base of the PR and between efc9e94 and f8e3b02.

📒 Files selected for processing (1)
  • authbridge/sparc-service/README.md

| `OPENAI_API_KEY` / `OPENAI_BASE_URL` | — | openai creds (LiteLLM also reads provider keys from env: `OPENAI_API_KEY`, `AZURE_API_KEY`, `ANTHROPIC_API_KEY`, …) |
| `HOST` / `PORT` | `0.0.0.0` / `8090` | bind address |
| `SPARC_LOG_REQUESTS` | `false` | When `true`, log every incoming `/reflect` request (including tool arguments) at INFO. Off by default because arguments can carry PII, payment ids, and other payload data. |
| `SPARC_STRIP_TOOL_ARG_KEYS` | — | Comma-separated argument keys to remove from every `tool_calls[].function.arguments` object before SPARC evaluates the call, e.g. `SPARC_STRIP_TOOL_ARG_KEYS=session_id,request_id`. Useful when an agent injects keys that aren't in the tool spec, which would otherwise make SPARC reject the call. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Describe tool_calls[].function.arguments as JSON-encoded arguments.

Lines 46-48 represent arguments as a JSON string, not an object. State that the configured keys are removed from the decoded argument object before evaluation. This keeps the configuration description consistent with the request schema.

Proposed wording
-| `SPARC_STRIP_TOOL_ARG_KEYS` | — | Comma-separated argument keys to remove from every `tool_calls[].function.arguments` object before SPARC evaluates the call, e.g. `SPARC_STRIP_TOOL_ARG_KEYS=session_id,request_id`. Useful when an agent injects keys that aren't in the tool spec, which would otherwise make SPARC reject the call. |
+| `SPARC_STRIP_TOOL_ARG_KEYS` | — | Comma-separated argument keys to remove from each decoded `tool_calls[].function.arguments` object before SPARC evaluates the call, e.g. `SPARC_STRIP_TOOL_ARG_KEYS=session_id,request_id`. Useful when an agent injects keys that aren't in the tool spec, which would otherwise make SPARC reject the call. |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `SPARC_STRIP_TOOL_ARG_KEYS` || Comma-separated argument keys to remove from every `tool_calls[].function.arguments` object before SPARC evaluates the call, e.g. `SPARC_STRIP_TOOL_ARG_KEYS=session_id,request_id`. Useful when an agent injects keys that aren't in the tool spec, which would otherwise make SPARC reject the call. |
| `SPARC_STRIP_TOOL_ARG_KEYS` || Comma-separated argument keys to remove from each decoded `tool_calls[].function.arguments` object before SPARC evaluates the call, e.g. `SPARC_STRIP_TOOL_ARG_KEYS=session_id,request_id`. Useful when an agent injects keys that aren't in the tool spec, which would otherwise make SPARC reject the call. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@authbridge/sparc-service/README.md` at line 105, Update the
SPARC_STRIP_TOOL_ARG_KEYS documentation to describe
tool_calls[].function.arguments as a JSON-encoded string; clarify that the
string is decoded and the configured keys are removed from the resulting
argument object before SPARC evaluates the call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New/ToDo

Development

Successfully merging this pull request may close these issues.

2 participants