Skip to content

fix(tools): skip credential pool inheritance when override_base_url differs - #11456

Closed
nsyring wants to merge 0 commit into
NousResearch:mainfrom
nsyring:fix/delegation-pool-fix
Closed

fix(tools): skip credential pool inheritance when override_base_url differs#11456
nsyring wants to merge 0 commit into
NousResearch:mainfrom
nsyring:fix/delegation-pool-fix

Conversation

@nsyring

@nsyring nsyring commented Apr 17, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes a bug where subagents using a different API endpoint (override_base_url) incorrectly inherited the parent agent's credential pool, causing 401 authentication failures.

When delegating to a provider with a different base URL (e.g., parent uses OpenRouter, subagent uses Mistral), the subagent should use its own credentials, not the parent's pool.

Related Issue

No existing issue.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Changes Made

  • tools/delegate_tool.py: Add URL comparison guard in _build_child_agent — skip pool inheritance when override_base_url differs from parent's base URL. Trailing-slash normalization prevents false mismatches.
  • tests/tools/test_delegation_pool.py: 4 tests covering same-URL inheritance, different-URL skip, trailing-slash normalization, and empty override.

How to Test

  1. Configure two providers with different base URLs (e.g., OpenRouter + Mistral)
  2. Delegate a task from one to the other
  3. The subagent should authenticate with its own credentials, not the parent's
  4. Run pytest tests/tools/test_delegation_pool.py -v — all 4 tests pass

Checklist

  • I have read the Contributing Guide
  • My commits follow the Conventional Commits format
  • I have searched for existing PRs to avoid duplicates
  • This PR contains only related changes
  • pytest tests/ -q passes
  • I have added tests for my changes
  • I have tested on: Debian 13 (LXC, amd64)
  • N/A — no new docs needed
  • N/A — no config key changes
  • N/A — no architecture changes
  • Cross-platform: no platform-specific code
  • N/A — no tool schema changes

@nsyring
nsyring force-pushed the fix/delegation-pool-fix branch 4 times, most recently from 6e0d1e5 to 9064531 Compare April 21, 2026 09:27
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/delegate Subagent delegation labels Apr 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #8797 and #13752 — all three fix credential pool inheritance overriding delegation base_url. Also addresses root cause from #7833.

@nsyring
nsyring force-pushed the fix/delegation-pool-fix branch from 9064531 to 3e5dd43 Compare April 25, 2026 05:55
@nsyring
nsyring force-pushed the fix/delegation-pool-fix branch 11 times, most recently from 45f4880 to 7898788 Compare May 5, 2026 13:52
@nsyring
nsyring force-pushed the fix/delegation-pool-fix branch 8 times, most recently from 5f2b878 to 1f7b129 Compare May 12, 2026 09:04
@nsyring
nsyring force-pushed the fix/delegation-pool-fix branch 10 times, most recently from 63c27b9 to 6136d06 Compare May 26, 2026 06:18
@nsyring
nsyring force-pushed the fix/delegation-pool-fix branch 11 times, most recently from 1facadd to 11650ba Compare June 2, 2026 06:20
@nsyring
nsyring force-pushed the fix/delegation-pool-fix branch 7 times, most recently from 5e9c19e to f8f5349 Compare June 6, 2026 21:20
@nsyring nsyring closed this Jun 11, 2026
@nsyring
nsyring force-pushed the fix/delegation-pool-fix branch from f8f5349 to 4829f8d Compare June 11, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants