Skip to content

fix(claude): stop forcing tool search on Foundry#2477

Open
rodboev wants to merge 2 commits into
headroomlabs-ai:mainfrom
rodboev:pr/2464-foundry-tool-search-default
Open

fix(claude): stop forcing tool search on Foundry#2477
rodboev wants to merge 2 commits into
headroomlabs-ai:mainfrom
rodboev:pr/2464-foundry-tool-search-default

Conversation

@rodboev

@rodboev rodboev commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

Foundry sessions launched through headroom wrap claude currently receive Headroom's generic ENABLE_TOOL_SEARCH=true default when the user did not choose a tool-search mode. That can push Claude Code into a deferred-tool request shape that Azure Foundry rejects with API Error: 400 ... Some tools are not available. This narrows the default-only path so Foundry sessions stop forcing deferred-tool mode when the user did not ask for it, while explicit overrides and the existing non-Foundry custom-host behavior stay unchanged.

Closes #2464

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Performance improvement
  • Code refactoring (no functional changes)

Changes Made

  • add a Foundry-specific default for the no-override tool-search branch
  • preserve explicit --tool-search values and pre-set ENABLE_TOOL_SEARCH values exactly
  • keep the generic non-Foundry default as true
  • add focused helper-level regression coverage for Foundry defaulting and adjacent negative space

Testing

  • Focused unit tests pass (uv run pytest tests/test_cli/test_wrap_claude.py tests/test_cli/test_wrap_claude_vertex_proxy_env.py tests/test_issue_746_tool_search.py -q)
  • Edited-file linting passes (uv run ruff check headroom/cli/wrap.py headroom/providers/claude/runtime.py tests/test_cli/test_wrap_claude.py)
  • Type checking passes (uv run mypy headroom)
  • New tests added for new functionality when applicable
  • Manual testing performed

Test Output

Command: uv run pytest tests/test_cli/test_wrap_claude.py tests/test_cli/test_wrap_claude_vertex_proxy_env.py tests/test_issue_746_tool_search.py -q
61 passed

Command: uv run ruff check headroom/cli/wrap.py headroom/providers/claude/runtime.py tests/test_cli/test_wrap_claude.py
All checks passed!

Real Behavior Proof

  • Environment: Windows, Python via uv, Foundry mode modeled through the wrap helper inputs
  • Exact command / steps: run the focused helper regression and edited-file lint commands above
  • Observed result: 61 passed; All checks passed!; Foundry mode without an override writes ENABLE_TOOL_SEARCH=false, while explicit overrides, existing values, blank handling, and the non-Foundry default remain covered
  • Not tested: live Azure Foundry tenant run

Review Readiness

  • I have performed a self-review
  • This PR is ready for human review

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the CHANGELOG.md if applicable

Additional Notes

CHANGELOG.md stays untouched because Headroom generates release notes from conventional commits. Live Foundry proof is intentionally left to a real tenant run; the code and focused tests only claim the launch-mode change inside Headroom.

@github-actions

Copy link
Copy Markdown
Contributor

PR governance

This PR follows the template and is marked ready for human review.

@github-actions github-actions Bot added the status: ready for review Pull request body is complete and the author marked it ready for human review label Jul 22, 2026
@codecov-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rodboev
rodboev force-pushed the pr/2464-foundry-tool-search-default branch from 5873f96 to 5c31657 Compare July 22, 2026 01:19

@JerrettDavis JerrettDavis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the latest diff against upstream main. The Foundry-specific default is scoped to the no-override path, preserves explicit/pre-existing ENABLE_TOOL_SEARCH values, and keeps the non-Foundry default unchanged. I also checked the adjacent Remote Control sibling-note path; it is only reached on the non-Foundry branch, so the new Foundry default does not make that banner inaccurate.

Local verification: uv run pytest tests/test_cli/test_wrap_claude.py tests/test_cli/test_wrap_claude_vertex_proxy_env.py tests/test_issue_746_tool_search.py -q -> 61 passed.

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

Labels

status: ready for review Pull request body is complete and the author marked it ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] wrap claude + Foundry: forced ENABLE_TOOL_SEARCH=true (#746) → upstream 400 "Some tools are not available"

3 participants