Skip to content

feat: configure the composer prediction model through deployment settings - #414

Merged
devSejung merged 1 commit into
mainfrom
feature/composer-predictions-model-env
Oct 28, 2026
Merged

devSejung merged 1 commit into
mainfrom
feature/composer-predictions-model-env

Conversation

@iililiiilili

@iililiiilili iililiiilili commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #412 (Composer Predictions); follow-up to #413, which introduced the Web composer suggestions.

What Problem This Solves

Operators currently need a code change when the company prediction model alias changes. This lets deployment configuration choose a dedicated prediction model while preserving the current default.

Why This Change Was Made

Read PLATFORMCLAW_COMPOSER_PREDICTIONS_MODEL as a full provider/model reference once per plugin lifecycle, using the existing SDK parser and normalized provider lookup. Missing or blank values keep codemate/codellm-fast; invalid, unavailable, or unsupported selections skip prediction without selecting a conversation model or fallback.

The selected provider still must be configured, OpenAI-compatible (openai-completions), and resolve only to private/loopback addresses. Existing DNS pinning, cancellation/preemption, one-slot admission, context/token caps, and no-redirect/no-retry behavior remain intact.

Runtime Compose forwards the setting only to Gateway. The deployment wrapper preserves deployment.env precedence over ambient shell values. Local/deployment examples, plugin help, and setup instructions use the same variable. No dependency, schema, protocol, or browser changes.

User Impact

Set the prediction route independently of the normal conversation model:

PLATFORMCLAW_COMPOSER_PREDICTIONS_MODEL=codemate/codellm-fast

Replace the value with another configured provider/model, including model IDs containing /. For runtime Docker deployments, edit deployment.env and run ./platformclaw-compose up -d openclaw-gateway to recreate Gateway with the new environment. Directly launched Gateways require restarting with the variable set. The existing server flag and account opt-in remain OFF by default.

Evidence

  • Focused repository wrapper: node scripts/run-vitest.mjs extensions/admin-http-rpc/src/composer-predictions.test.ts extensions/admin-http-rpc/index.test.ts — 16/16 tests passed. Covers unset/blank default, custom provider and slash-containing model ID, lifecycle pinning, invalid/unavailable references, unsupported API, private-destination enforcement, no fallback, cancellation, and actual HTTP hook wiring.
  • Actual Compose configuration, without starting containers: four cases (missing, blank, example default, custom selection) passed through the production wrapper. Each ignored an ambient override and exposed the variable only to Gateway. Compose forwards blank values so the plugin owns the single runtime default.
  • Focused syntax lint, formatting, git diff --check, and Bash syntax check passed. Windows trusted focused proof used the existing dependency installation; no local dependency reconciliation.
  • Fresh final autoreview: python -X utf8 <autoreview> --mode uncommitted --engine codex exited 0 with no accepted/actionable findings, patch is correct (default P0 threshold; gpt-5.6-sol, high). TruffleHog scanned the full change. Codex isolation flags were personally checked in sibling codex-rs/exec/src/cli.rs:36-45.
  • The 9-file final patch is byte-identical to the reviewed snapshot, including after moving to merged main d46f20ff0a70e8e76f1060082168731783181ac9. Patch SHA256: c1a21cbdcc03b08ce7d98772c0211a9f5238c80d3fe75406f92eb644a0aae338; source aggregate SHA256: 3be3018190bb628d2f27d7a4932eee7c71105a3c83541dec154724b0ff9eb4a5.
  • Exact-head hosted Linux checks for 3ca7e75d560e54ab549c315f2dbb3d6b6a98a658: CI run 40630971858 and PlatformClaw CI run 40630971893 passed, including production/test types and full lint. No live company LLM endpoint or credential is available, so actual model availability/quality and GPU cancellation/load effects remain unverified.

Review measurements: one added environment setting; existing model default and both enablement defaults preserved. Production/config +29/-5, tests +51/-8, docs +15/-3. Production growth implements the requested deployment-owned model selection and environment forwarding; no migration or new operator requirement for existing configurations.

AI-assisted with Codex. No credentials, internal endpoint, runtime database, execution log, or transcript included.

@iililiiilili
iililiiilili marked this pull request as ready for review October 28, 2026 04:12
@devSejung
devSejung merged commit e6b44a4 into main Oct 28, 2026
107 of 108 checks passed
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