TAP-1988: opt into Tool Search BETA in build_claude_command#23
Merged
Conversation
Without the `advanced-tool-use-2025-11-20` beta header, the Anthropic API hides every tool annotated `defer_loading: true` from the catalog entirely — the agent has no way to discover or fetch them via Tool Search. Adding the header turns deferral into "lazy load on demand," which is the recovery path the deferred-loading work in the parent TAP-1983 epic depends on. build_claude_command now exports ANTHROPIC_BETA before every Claude CLI invocation (read by the Anthropic SDK, forwarded as the `anthropic-beta` HTTP header). Multi-value betas are comma-separated, so any operator-set ANTHROPIC_BETA is preserved and the tool-search token is appended; if the token is already present, the env var is left untouched. RALPH_BETA_TOOL_SEARCH=false skips the export entirely (operator rollback). templates/ralphrc.template gains an ANTHROPIC BETA FEATURES section documenting RALPH_BETA_TOOL_SEARCH=true as the default and the escape-hatch value. Coverage: 6 new BATS cases in tests/unit/test_build_claude_command.bats following the same `awk + eval` function-extraction pattern as test_plan_mode_high_risk.bats — default-on export, RALPH_BETA_TOOL_SEARCH=false skip, operator-set value preserved, no-duplication across repeated calls, already-present-token noop, ralphrc.template documents the override. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
wtthornton
added a commit
that referenced
this pull request
May 17, 2026
… BETA, branch hygiene) Bumps RALPH_VERSION + package.json to 2.15.2. CHANGELOG entry covers the seven tickets shipped via PRs #22, #23, #24: * TAP-1881 / TAP-1882 / TAP-1883 — .gitignore allowlist + idempotent upgrade backfill, single source-of-truth helper, 14-pattern leak fix originating from TAP-1682 (Fixed) * TAP-1988 — Tool Search BETA opt-in via ANTHROPIC_BETA header (Added) * TAP-1878 / TAP-1879 / TAP-1880 — branch hygiene epic (prompt-side delete + harness-side janitor with git cherry detection) (Added) Unit suite: 1751 → 1778 cases (+27) across 4 new BATS files. All green; full suite still 100% pass. Real-world post-merge validation of the new janitor (TAP-1880): deleted 2 stale tap-1838-* branches in this repo on first run with no manual intervention. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TAP-1988 — Without the
advanced-tool-use-2025-11-20Anthropic beta header, the API hides every tool annotateddefer_loading: truefrom the catalog entirely — the agent has no way to discover or fetch them via Tool Search. Adding the header turns deferral into "lazy load on demand," which is the recovery path the deferred-loading work in the parent TAP-1983 epic depends on.build_claude_commandnow exportsANTHROPIC_BETAbefore every Claude CLI invocation (read by the Anthropic SDK, forwarded as theanthropic-betaHTTP header). Behavior is operator-friendly:RALPH_BETA_TOOL_SEARCH=true(unset = true) → header exported.RALPH_BETA_TOOL_SEARCH=false→ no export.ANTHROPIC_BETA="some-other-beta"is preserved; the tool-search token is appended with a comma. If the token is already present, the env var is left untouched (no duplication across repeatedbuild_claude_commandcalls).templates/ralphrc.templategains an "ANTHROPIC BETA FEATURES" section documenting the override.Test plan
bats tests/unit/test_build_claude_command.bats— 6 cases pass: default-on export, RALPH_BETA_TOOL_SEARCH=false skip, operator-set value preserved + appended, no-duplication across repeated calls, already-present-token noop, ralphrc.template documents the overridebats tests/unit/test_plan_mode_high_risk.bats— 13 cases pass (no regression in the other build_claude_command surface area)bats tests/unit/test_hooks.bats— 94 cases pass (HOOKS-6 build_claude_command --agent assertions still green)🤖 Generated with Claude Code