Repository navigation
✨ feat: Per-provider endpoints for cross-provider ladder rungs - #32
Merged
Merged
Conversation
Ladder rungs on a provider other than the worker's were always built with an empty api_base, so e.g. an ollama rung under a claude worker could only hit the provider default (localhost:11434). Add a [providers.<name>] TOML section supplying per-provider endpoints, consulted at rung construction whenever a more specific api_base does not apply. It also serves as the worker's own endpoint when worker.api_base is unset. String-form ladders parse unchanged. Also backfills tests for four pre-existing coverage gaps (agent.New warning branches, NewEscalation clamp, ResolveStrategy retry hint, AnalyzeModels error/sort paths) that blocked the pre-commit hook. Closes #27
- Warn when a [providers.<name>] section matches no registered provider (typically a typo like [providers.olama]) instead of silently routing rungs to the provider default endpoint. - Drop the "providers.*.api_base" wildcard from TOMLConfigKeySet: the set is exact-match and a starred literal can never match a real key; the comment now documents the dynamic section instead. - Extract registerCapturingProvider test helper to dedupe the two ladder endpoint tests.
…der-rung-endpoint # Conflicts: # example.config.toml # pkg/agent/agent_test.go # pkg/loop/escalation_test.go # pkg/observer/observer_test.go
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.
Closes #27
Problem
A ladder rung on a provider other than the worker's was always constructed with
provider.Config{APIBase: ""}— there was no way to point e.g. anollama/qwen2.5-coder:32brung under a claude worker at anything but the provider default (localhost:11434).Solution
The per-provider endpoint section shape from the issue (the one noted to compose better if more per-provider settings appear later):
At rung construction, a rung on the worker's own provider still inherits
worker.api_base; when that doesn't apply (cross-provider rung, or own-provider with noapi_baseset), the endpoint comes from[providers.<name>], falling back to the provider default when no section exists.FromTOMLalso lets[providers.<worker.name>]serve as the worker's own endpoint whenworker.api_baseis unset, so the section behaves as one consistent endpoint directory.Acceptance criteria
[providers.<name>]endpoint).ParseRungor the ladder entry format; all pre-existing ladder tests pass untouched).example.config.tomllimitation notes replaced with the new syntax.Also in this PR
Backfilled tests for four pre-existing per-function coverage gaps that blocked the pre-commit hook on any commit: the two warning branches in
agent.New(unknown advisor/rung provider), the negative-top clamp inloop.NewEscalation, the retry-with-history hint inadvisor.ResolveStrategy, and the read-error/sort-tiebreak paths inobserver.AnalyzeModels.Scoping note: no
SWEEPER_PROVIDERS_*env override was added — map-valued keys don't fit the static env-var pattern, and the acceptance criteria only called for TOML.