fix(delegate): salvage delegate PRs #6933 #6881 - #7360
Merged
Conversation
… resolution When delegation.base_url routes subagents to a different endpoint, the correct URL was passed through _resolve_delegation_credentials() and _build_child_agent() into AIAgent.__init__(), but self.base_url could fall out of sync with client_kwargs["base_url"] — the value the OpenAI client actually uses. This caused billing_base_url in session records to show the parent's endpoint while actual API calls went to the correct delegation target. Keep self.base_url in sync with client_kwargs after the credential resolution block, matching the existing pattern for self.api_key. Fixes #6825
…xcess `delegate_task` silently truncated batch tasks to 3 — the model sends 5 tasks, gets results for 3, never told 2 were dropped. Now returns a clear tool_error explaining the limit and how to fix it. The limit is configurable via: - delegation.max_concurrent_children in config.yaml (priority 1) - DELEGATION_MAX_CONCURRENT_CHILDREN env var (priority 2) - default: 3 Uses the same _load_config() path as the rest of delegate_task for consistent config priority. Clamps to min 1, warns on non-integer config values. Also removes the hardcoded maxItems: 3 from the JSON schema — the schema was blocking the model from even attempting >3 tasks before the runtime check could fire. The runtime check gives a much more actionable error message. Backwards compatible: default remains 3, existing configs unchanged.
This was referenced Apr 10, 2026
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
Salvage of 2 delegate/subagent PRs. Contributor authorship preserved.
Cherry-picked:
fix(delegate): sync self.base_url with client_kwargs after credential resolution #6933 (Tranquil-Flow) — Sync
self.base_urlwithclient_kwargsafter credential resolution. One-line fix:self.api_keywas already synced butself.base_urlwas not, causing stale values in billing records and fallback snapshots.fix(delegate): make max_concurrent_children configurable + error on excess #6881 (malaiwah) — Make
max_concurrent_childrenconfigurable via config.yaml/env (default stays 3). Replaces silent task truncation with explicittool_error()so the model knows tasks were dropped. RemovesmaxItems: 3from schema.Follow-up: Updated pre-existing schema assertion test after maxItems removal.
Closed:
Test results
92 tests pass (delegate, agent_guardrails)