Skip to content

Bundled agents: 'auto' model + surface silent model substitution#84

Merged
lezama merged 3 commits into
mainfrom
fix/bundled-agent-model
Jun 3, 2026
Merged

Bundled agents: 'auto' model + surface silent model substitution#84
lezama merged 3 commits into
mainfrom
fix/bundled-agent-model

Conversation

@lezama

@lezama lezama commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Problem

The bundled demo agents shipped model: 'claude-haiku-4-5'. No provider exposes that exact id (Anthropic's is claude-haiku-4-5-20251001), so wp-ai-client silently falls back to the provider's default — claude-opus-4-8 on Anthropic. The demos ran on the priciest model while the config implied Haiku, with zero signal. Confirmed live: a claude-haiku-4-5 agent reports model:claude-opus-4-8 in telemetry.

Changes

  • Bundled agents → model: 'auto' (example, loop-demo, site-introspection, workflow-drafter, coordinator). They now adopt whatever the active provider is configured for, rather than a misleading, unresolvable id.
  • Runner surfaces silent substitution. When an agent pins a model the provider doesn't honor, the turn telemetry records model_requested and the runner logs:
    [openclawp] model_substitution agent=… requested=claude-haiku-4-5 used=claude-opus-4-8 — … silently fell back. Pin a model id the provider exposes to control cost.
    
  • README documents the cloud-cost caveat, how to pin a model, and the substitution log line.

Honest scope

'auto' still defers to the provider's default (Opus on Anthropic) — this PR removes the misleading id and makes pinned-model substitution visible, but it doesn't force a cheap cloud default. Genuinely preventing the silent premium fallback is the provider / wp-ai-client's responsibility (filed upstream separately). Pair with the per-site budget caps.

Local PHPUnit/PHPCS emit zero bytes on PHP 8.4 here; verified via php -l + live Studio runs (substitution warning confirmed firing). CI runs the real gates.

🤖 Generated with Claude Code

lezama and others added 3 commits June 3, 2026 18:35
The bundled demo agents shipped `model: 'claude-haiku-4-5'`, but no provider
exposes that exact id — wp-ai-client silently falls back to the provider's
default (Opus on Anthropic), so the demos ran on an expensive model while the
config implied Haiku, with no signal.

- Switch the bundled agents (example, loop-demo, site-introspection,
  workflow-drafter, coordinator) to `model: 'auto'` so they adopt whatever the
  active provider is configured for, instead of a misleading, unresolvable id.
- Runner: when an agent pins a model id that the provider substitutes, record
  it on the turn telemetry and log `[openclawp] model_substitution agent=…
  requested=… used=…`, so silent fallback to a premium model is visible.
- README: document that cloud defaults pick the provider's (often priciest)
  model, how to pin a specific id, and the substitution log line.

Note: 'auto' still defers model choice to the provider (Opus by default on
Anthropic). Truly preventing the silent premium fallback is the provider /
wp-ai-client's job — filed separately upstream.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bundled agents now declare model 'auto' instead of the unresolvable
'claude-haiku-4-5'; regenerate the five payload snapshots to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
resolve_model_preference() returns null for model 'auto', so the payload's
model_preference is null (not an object). Correct the five snapshots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lezama lezama merged commit 97c41a7 into main Jun 3, 2026
6 checks passed
@lezama lezama deleted the fix/bundled-agent-model branch June 3, 2026 21:46
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