Skip to content

feat(execute): wire /execute into the substitution engine + pinned-param honesty (#39)#39

Merged
WayforthOfficial merged 1 commit into
mainfrom
feat/execute-substitution-failover
Jun 22, 2026
Merged

feat(execute): wire /execute into the substitution engine + pinned-param honesty (#39)#39
WayforthOfficial merged 1 commit into
mainfrom
feat/execute-substitution-failover

Conversation

@WayforthOfficial

Copy link
Copy Markdown
Owner

Wires POST /execute (managed path) into the same multi-hop run_with_failover engine as /proxy. Stays on 0.9.1 (0.9.2 reserved for A2A).

  • Managed calls → engine (retry-first → idempotency gate → chain → bill-served-only → log). BYOK calls are never substituted (user's own key) — refunded + surfaced.
  • Pinned-param honesty (your decision): a cross-provider substitute that can't honor a pinned provider-specific param (explicit LLM model) → surface a clean error (primary refunded). No strip, no silent default. Unpinned calls keep self-healing. In the shared engine, so /proxy gets it too.
  • Self-heal surface: X-Wayforth-Served-By + X-Wayforth-Fallback headers + served_by/fallback body. Exhaustion → clean 502.
  • Charges only the served provider; failed hops net to zero.

26 engine unit tests green (incl. pinned_model_surfaces_not_substituted, unpinned_llm_self_heals). Live failover check on /execute to follow post-deploy.

Curated model-equivalence map (tier-equivalent pinned-model self-heal + X-Wayforth-Substituted-Model) is the queued near-term follow-up.

🤖 Generated with Claude Code
EOF
)

…ram honesty (#39)

POST /execute (managed path) now uses the same multi-hop run_with_failover engine
as /proxy instead of its single-hop SERVICE_ALTERNATIVES fallback. Stays on 0.9.1.

- Managed-key calls: classify (settlement-aware _try_execute_managed_ex) -> engine
  (retry-first -> idempotency gate -> chain -> bill-served-only -> log). BYOK calls
  are NOT substituted (user's own key) — refunded + surfaced as before.
- Pinned-param honesty (decided policy): when a cross-provider substitute cannot
  honor a pinned provider-specific param (an explicit LLM model), the engine
  SURFACES a clean error (primary refunded) — it does NOT strip the param and does
  NOT silently fall back to the substitute's default model. Unpinned calls keep
  self-healing. Implemented in the shared engine, so /proxy gets it too. (A curated
  model-equivalence map for tier-equivalent substitution is a separate follow-up.)
- Self-heal surface: X-Wayforth-Served-By + X-Wayforth-Fallback headers + served_by/
  fallback in the response body. Group exhaustion -> clean 502 with providers tried.
- Charges only the served provider; failed hops net to zero in the ledger.

26 engine unit tests green (incl. pinned-model surfaces-not-substituted +
unpinned-self-heals). No version bump (0.9.2 reserved for A2A).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@WayforthOfficial WayforthOfficial merged commit d2d9750 into main Jun 22, 2026
1 check failed
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.

2 participants