Skip to content

fix: inherit subagent provider and model overrides#8497

Open
AiRC-ai wants to merge 1 commit intoaaif-goose:mainfrom
AiRC-ai:codex/subagent-inherit-fix
Open

fix: inherit subagent provider and model overrides#8497
AiRC-ai wants to merge 1 commit intoaaif-goose:mainfrom
AiRC-ai:codex/subagent-inherit-fix

Conversation

@AiRC-ai
Copy link
Copy Markdown

@AiRC-ai AiRC-ai commented Apr 12, 2026

Summary

This change ensures that subagents correctly inherit provider and model configurations when explicit overrides are not provided.

It introduces a consistent normalization and resolution flow that:

  • Treats "inherit" (including whitespace variations) as no override
  • Applies a clear precedence order for provider and model resolution:
    1. Delegate parameters
    2. Recipe settings
    3. Environment variables (GOOSE_SUBAGENT_PROVIDER, GOOSE_SUBAGENT_MODEL)
    4. Parent session defaults (provider only)

Key Changes

  • Added helper functions:
    • normalize_delegate_override to sanitize override values
    • resolve_delegate_provider_name for provider resolution
    • resolve_delegate_model_override for model resolution
  • Updated agent parsing to exclude "inherit" from metadata-derived labels
  • Refactored provider/model resolution logic in SummonClient to use centralized helpers
  • Ensured "inherit" does not propagate into runtime configuration

Behavior Improvements

  • Prevents "inherit" from being treated as a literal provider/model
  • Ensures predictable fallback behavior
  • Aligns subagent configuration with parent session defaults when appropriate

Testing

Added tests to validate:

  • "inherit" is ignored in agent frontmatter
  • "inherit" does not produce recipe settings
  • Model override resolution correctly ignores "inherit"
  • Provider resolution falls back to session when all overrides are "inherit"

Notes

This change improves consistency and reduces edge cases where invalid or unintended configuration values could be applied during subagent execution.

Signed-off-by: Ryan Cox <ryancox@GoDSyNcs-MBP.godsync.com>
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.

1 participant