Skip to content

feat: add anthropic_base_url setting for custom API endpoints - #143

Closed
fdkgenie wants to merge 4 commits into
overwirehq:mainfrom
fdkgenie:main
Closed

fdkgenie wants to merge 4 commits into
overwirehq:mainfrom
fdkgenie:main

Conversation

@fdkgenie

Copy link
Copy Markdown
  • Add anthropic_base_url field to Settings class with corresponding property
  • Update ClaudeSDKManager to set ANTHROPIC_BASE_URL environment variable
  • Add documentation to .env.example, README.md, and docs/configuration.md
  • Enables flexible configuration of proxy/enterprise endpoints for Anthropic API

fdkgenie and others added 4 commits March 10, 2026 16:09
- Add anthropic_base_url field to Settings class with corresponding property
- Update ClaudeSDKManager to set ANTHROPIC_BASE_URL environment variable
- Add documentation to .env.example, README.md, and docs/configuration.md
- Enables flexible configuration of proxy/enterprise endpoints for Anthropic API
- Add ANTHROPIC_MODELS environment variable support (comma-separated list)
- Implement /model slash command with inline keyboard UI similar to /repo
- Add comprehensive model name mapping system for enterprise/proxy endpoints
- Support aliases like cc-opus, cc-sonnet, cc-haiku resolving to full names
- Fix tool state conflicts when switching models mid-session by clearing session
- Add friendly display names (Opus 4.6, Sonnet 4.6, Haiku 4.5) in UI
- Implement proper validation and error handling for model selection
- Create complete test suite with 28 passing tests for model mapping
- Update SDK integration to resolve aliases before API calls
- Fix callback handler audit logging for both cd: and model: prefixes
Add support for multiple approved base directories, allowing projects
to be located in different filesystem locations while maintaining
security boundaries.

Changes:
- Add APPROVED_DIRECTORIES config (comma-separated paths)
- Update SecurityValidator to check against multiple directories
- Update ProjectRegistry to support absolute paths in projects.yaml
- Add effective_approved_directories property to Settings
- Maintain full backward compatibility with single APPROVED_DIRECTORY

Features:
- Projects can now use absolute paths in projects.yaml
- All paths validated against any approved directory
- Security guarantees maintained (path traversal, boundary checks)
- All existing tests pass (67/67)

Configuration example:
  APPROVED_DIRECTORY=/path/to/main
  APPROVED_DIRECTORIES=/path/to/main,/path/to/other,/path/to/more

Projects example:
  - slug: project1
    path: relative/path  # Relative to APPROVED_DIRECTORY
  - slug: project2
    path: /absolute/path  # Must be in an approved directory

Documentation:
- MULTIPLE_DIRECTORIES.md - Comprehensive guide
- MULTIPLE_DIRECTORIES_IMPLEMENTATION.md - Technical details
- MULTIPLE_DIRECTORIES_SUMMARY_VI.md - Vietnamese summary
- MULTIPLE_DIRECTORIES_QUICK_REFERENCE.md - Quick reference
- PROJECT_THREADS_MODE_GUIDE.md - Project threads explanation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RichardAtCT

Copy link
Copy Markdown
Collaborator

The base_url feature is useful for proxy/enterprise setups, but this PR has some scope issues:

  1. Scope creep: It bundles three separate features — ANTHROPIC_BASE_URL, ANTHROPIC_MODELS, and APPROVED_DIRECTORIES. Please split into separate PRs (base_url alone would be a quick merge).
  2. CLAUDE.md deletion: The diff appears to delete CLAUDE.md — please clarify why, or revert this change.
  3. Tests needed: No test coverage for the new settings.
  4. Conflicts: The branch conflicts with main. Please rebase.

The base_url feature itself is straightforward and welcome — splitting it out would fast-track the merge.

@RichardAtCT

Copy link
Copy Markdown
Collaborator

Thanks for this. I cannot take it as one change.

The title says one setting, but the diff is three features across 15 files: the base URL, a 193-line model mapper, and multi-directory access. It also deletes CLAUDE.md entirely, which I think was an accident from working in a fork.

It is also 31 commits behind main and conflicts now.

The base URL is the piece I want, and it is the answer to #171, #208 and #210. If you open that on its own against current main I will review it quickly. The model mapper overlaps #160, which I am taking instead.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants