Skip to content

feat: accept model in task payload, forward to --model#13

Merged
askalf merged 1 commit into
mainfrom
feat/model-in-dispatch-payload
May 11, 2026
Merged

feat: accept model in task payload, forward to --model#13
askalf merged 1 commit into
mainfrom
feat/model-in-dispatch-payload

Conversation

@askalf
Copy link
Copy Markdown
Owner

@askalf askalf commented May 11, 2026

Summary

  • Dispatcher can now control the model claude runs on each device by sending a model field in the task payload.
  • Without this, claude falls back to the device's local default — which is whatever tier the device's OAuth account is on. One device defaulting to Opus caused a 7-10x cost cliff on routine healthchecks.
  • Bumps minor (3.1.x → 3.2.0) since this adds a new field old platform releases ignore.

Test plan

  • tsc build clean
  • No model field in payload → behavior unchanged (falls through to local default)
  • Valid model string → --model <value> appended to argv
  • Malformed model string → logged warning, falls through to local default (no arg injection)

When the platform dispatcher sends a `model` field in the task payload,
pass it through to claude as `--model <value>`. Validated against a
narrow allowlist before reaching the CLI to avoid arg-injection through
attacker-controlled OAuth payloads.

This closes a real cost cliff: previously claude defaulted to whatever
the device's local CC was configured to (which can be any tier the
device's OAuth account happens to be on). One device defaulting to Opus
caused 7-10x cost concentration on routine healthchecks. With this
change the dispatcher controls model selection regardless of local
defaults.

Bumps minor (3.1.x -> 3.2.0) since this adds a new field that older
platform releases will simply ignore — backward compatible.
@askalf askalf merged commit 2422bab into main May 11, 2026
2 of 4 checks passed
@askalf askalf deleted the feat/model-in-dispatch-payload branch May 11, 2026 14:14
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