Skip to content

refactor(skills/fork): multi-provider via CredentialBundle + CHANGELOG addendum#202

Merged
CocoRoF merged 1 commit into
mainfrom
feat/llm-backend/d4-fork-multi-provider
May 17, 2026
Merged

refactor(skills/fork): multi-provider via CredentialBundle + CHANGELOG addendum#202
CocoRoF merged 1 commit into
mainfrom
feat/llm-backend/d4-fork-multi-provider

Conversation

@CocoRoF
Copy link
Copy Markdown
Owner

@CocoRoF CocoRoF commented May 17, 2026

Summary

Phase D4 of the LLM backend upgrade cycle — closes the executor side. Introduces a credential-bundle-aware fork-mode runner so fork skills can route through any of the 6 providers (four API + two CLI). The legacy `make_default_fork_runner` (Anthropic-only) stays around for hosts that haven't migrated to bundles.

What's new

  • `SkillMetadata.provider: Optional[str]` — fork skills declare their preferred provider.
  • `make_credential_bundle_fork_runner(credentials, ...)` — new runner. Always returns a runner; credential failures surface as `ForkResult(is_error=True)`. Provider routing: `skill.metadata.provider` → `fallback_provider`. Client construction via `ClientRegistry` + shared `_creds_to_client_kwargs`. Records provider / model / tokens / cost in result metadata.
  • CHANGELOG: 2.0.0 entry gains the "Multi-provider sub-agent system" section + fork runner + state slots + attach_runtime kwarg.

Test plan

  • `tests/unit/test_fork_multi_provider.py` (NEW) — 6 cases
  • Full repo: 3235 passed, 8 skipped, 0 failed

Phase D done. Executor is feature-complete for the LLM backend upgrade cycle. Next: PyPI release of v2.0.0.

Plan reference: `docs/llm-backend-upgrade-plan/07_rollout_phases.md` (Phase D4).

…G addendum

Phase D4 of the LLM backend upgrade. Closes the executor side of the
multi-provider sub-agent / fork-mode plan by introducing a credential-
bundle-aware fork runner that routes through any of the 6 providers
(four API + two CLI) — the existing Anthropic-only ``make_default_fork_runner``
stays around for hosts that don't yet wire a bundle.

skills/types.py
- ``SkillMetadata.provider: Optional[str]`` — fork skills can declare
  their preferred provider; the runner picks the right client class.

skills/fork.py
- New ``make_credential_bundle_fork_runner(credentials, *, fallback_provider,
  fallback_model, max_tokens)``. Always returns a runner; credential
  failures surface as ``ForkResult(is_error=True)`` so the parent loop
  keeps running.
- Provider routing: ``skill.metadata.provider`` → fallback_provider.
- Client construction via ClientRegistry + ``_creds_to_client_kwargs``
  shared with the pipeline path.
- Records provider + model + token usage + cost_usd (when populated)
  in ``ForkResult.metadata``.

tests/unit/test_fork_multi_provider.py (NEW)
- 6 cases: runner returns unconditionally, skill provider routing,
  fallback_provider routing, missing-credentials structured error,
  unknown-provider structured error, model_override propagation.

CHANGELOG.md — 2.0.0 entry gains a "Multi-provider sub-agent system"
section + the fork runner / state slots / attach_runtime kwarg
documented.

Full suite: 3235 passed, 8 skipped, 0 failed.

Phase D done. The executor is feature-complete for the LLM backend
upgrade cycle: 6 providers in the registry, multi-provider sub-agent
dispatch with parallel fan-out, credential propagation end-to-end,
and a fork-mode runner that doesn't care about provider count. Next
step: PyPI release.

Plan reference: docs/llm-backend-upgrade-plan/07_rollout_phases.md (Phase D4).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CocoRoF CocoRoF merged commit 1aa13d8 into main May 17, 2026
1 check passed
@CocoRoF CocoRoF deleted the feat/llm-backend/d4-fork-multi-provider branch May 17, 2026 13:34
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