Repository navigation
feat: configure the composer prediction model through deployment settings - #414
Merged
Merged
Conversation
iililiiilili
marked this pull request as ready for review
October 28, 2026 04:12
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.
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_MODELas a fullprovider/modelreference once per plugin lifecycle, using the existing SDK parser and normalized provider lookup. Missing or blank values keepcodemate/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.envprecedence 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:
Replace the value with another configured
provider/model, including model IDs containing/. For runtime Docker deployments, editdeployment.envand run./platformclaw-compose up -d openclaw-gatewayto 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
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.git diff --check, and Bash syntax check passed. Windows trusted focused proof used the existing dependency installation; no local dependency reconciliation.python -X utf8 <autoreview> --mode uncommitted --engine codexexited 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 siblingcodex-rs/exec/src/cli.rs:36-45.d46f20ff0a70e8e76f1060082168731783181ac9. Patch SHA256:c1a21cbdcc03b08ce7d98772c0211a9f5238c80d3fe75406f92eb644a0aae338; source aggregate SHA256:3be3018190bb628d2f27d7a4932eee7c71105a3c83541dec154724b0ff9eb4a5.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.