concierge: generalize runtime from hardcoded claude-code (P3b de-bake) #3248
Reference in New Issue
Block a user
Delete Branch "fix/concierge-runtime-generalization"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
De-bake phase P3b: make the platform-agent (concierge) runtime a parameter instead of hardcoded
claude-code, and flip the platform-managed default model to MiniMax (CTO decision). This unblocks codex / openclaw / hermes concierges.Changes (
workspace-server/internal/handlers/)Runtime is a parameter.
conciergeRuntimeconst →defaultConciergeRuntime(still"claude-code"). New per-runtime helpersconciergeModelForRuntime+conciergeTemplateForRuntime.ensureConciergeModel/ensureConciergeProvidertake aruntimearg;applyConciergeProvisionConfigreads the row'sruntimecolumn and threads it (model validation now gates against the chosen runtime's registry, not claude-code's).Default model →
minimax/MiniMax-M2.7(wasmoonshot/kimi-k2.6). MiniMax is cheaper and served via the proxy's Anthropic-compatible arm (providers.yamlminimax:base_url_anthropic https://api.minimax.io/anthropic/v1,auth_env MINIMAX_API_KEY). It is a registered platform model. No API key hardcoded — the credential is platform-proxy-side (Infisical/shared/minimax-token-plan). The model stays a parameter (conciergeModelForRuntime) so a per-runtime override is one line; the default for every runtime is this id.ensureConciergeProviderpin gate is now registry-derived (conciergeModelIsPlatformManaged→DeriveProvider().IsPlatform()), replacing the hardcodedmoonshot/string-prefix so the newminimax/default (and any registered platform model on any runtime) is recognized. Empty-model and BYOK-model behaviors preserved.installPlatformAgentruntime parameter + per-runtime template + no clobber. The INSERT seeds the requested runtime; the template maps per-runtime (platform-agentfor claude-code,<runtime>-platform-agentotherwise). TheON CONFLICT DO UPDATEclause no longer re-writesruntime— the pre-P3bruntime = 'claude-code'(core#2496) is removed, so re-installing a codex/openclaw concierge no longer reverts it.installPlatformAgentPayloadgains an optionalruntimefield (defaults to claude-code for existing CP callers).conciergeIdentityPresentnow checks the absence of the literal{{CONCIERGE_NAME}}placeholder (was the"Org Concierge"substring). Runtime/name-agnostic; fixes the boot-restart loop for a renamed or cross-runtime concierge whose prompt never says "Org Concierge".registry.gostrings generalized (no logic change): the misleading/opt/molecule-mcp-server missingmessages + the doc comments are reworded to "management MCP server (mcp_server_present=false)" so an openclaw/codex mcp-less failure isn't mis-diagnosed as a missing baked binary. The Go gate still trusts the*boolverbatim; themcp_server_missingreason code is unchanged.Prove-fail tests
TestIntegration_PlatformAgentInstall_RuntimeIsParameterAndNotClobbered): install withruntime="codex"seedsruntime='codex'+template='codex-platform-agent'; a re-install does NOT revert it to claude-code (fails against the oldON CONFLICT ... runtime='claude-code'); the default path still seeds claude-code/platform-agent.TestConciergeIdentityPresent_PlaceholderAbsenceCheck): returns true for a non-"Org Concierge" name once the placeholder is substituted; false while{{CONCIERGE_NAME}}is still literal; false on empty/probe-miss.TestConciergeRuntimeGeneralization_Defaults): the default declared model isminimax/MiniMax-M2.7, registered + platform-derived for claude-code, andconciergeTemplateForRuntimemaps per-runtime.Known registry gap (documented, not asserted-green)
codex's
platformarm inproviders.yamlcurrently serves OpenAI ids only (openai/gpt-5.4(-mini));minimax/MiniMax-M2.7derives to the BYOKbyok-minimaxarm for codex, notplatform. So a codex concierge on the shared minimax default would not get the platformLLM_PROVIDERpin and would need a tenantMINIMAX_API_KEY. The shared default is correct; cross-runtime platform routing for minimax on codex/openclaw needs aproviders.yamlchange (addminimax/MiniMax-M2.7to codex + openclaw platform arms) before a codex concierge can run it platform-billed. A guard subtest pins the current truth so a future registry fix flips it deliberately.Verification
go test ./workspace-server/internal/handlers/green (4 pre-existing env/network-dependent failures excluded: manifest ref-pinning needs Gitea auth → 404; MCP delivery contract needs the runtime checked out as a sibling + a python module).go build ./...clean.go vet ./internal/handlers/...clean, including-tags=integration.🤖 Generated with Claude Code
Make the platform-agent (concierge) runtime a parameter threaded through installPlatformAgent + ensureConciergeModel/ensureConciergeProvider, and flip the platform-managed default model to minimax/MiniMax-M2.7 (CTO). - platform_agent.go: defaultConciergeRuntime const (was hardcoded conciergeRuntime); conciergeModelForRuntime + conciergeTemplateForRuntime per-runtime helpers; ensureConciergeModel/ensureConciergeProvider take a runtime arg; applyConciergeProvisionConfig reads runtime from the row. - conciergeDeclaredModel: moonshot/kimi-k2.6 -> minimax/MiniMax-M2.7 (registered platform model; proxy Anthropic-compat arm; no key hardcoded). - ensureConciergeProvider pin gate is now registry-DERIVED (conciergeModelIsPlatformManaged -> DeriveProvider().IsPlatform()), replacing the hardcoded moonshot/ prefix so minimax/ is recognized. - installPlatformAgent: runtime is a parameter; template maps per-runtime; the ON CONFLICT clause no longer reverts runtime to claude-code (the pre-P3b core#2496 clobber is removed) so a codex/openclaw concierge survives re-install. installPlatformAgentPayload gains an optional runtime. - conciergeIdentityPresent: absence-of-{{CONCIERGE_NAME}} check (was the literal 'Org Concierge' substring) — runtime/name-agnostic, fixes the boot-restart loop for renamed/cross-runtime concierges. - registry.go: generalize the misleading /opt/molecule-mcp-server / platform_agent_mcp_server_missing strings (no logic change; the gate still trusts mcp_server_present verbatim). Prove-fail tests: codex install seeds runtime='codex' AND a re-install does NOT revert it (integration); conciergeIdentityPresent true for a renamed concierge once substituted, false while the placeholder is literal; the default declared model is minimax/MiniMax-M2.7. Codex minimax platform routing is a documented registry gap (codex's platform arm serves OpenAI ids only). go test ./internal/handlers/ green (4 pre-existing env/network-dependent failures excluded); go build ./...; go vet (incl -tags=integration) clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>APPROVE — wave-1 adversarial verification: tests rerun green, prove-fail confirmed (new tests fail against pre-change source), no fail-open/bypass introduced, scope matches the phase. code-review lens
APPROVE — wave-1 adversarial verification: tests rerun green, prove-fail confirmed (new tests fail against pre-change source), no fail-open/bypass introduced, scope matches the phase. security/fail-closed lens
qa-review 5-axis: APPROVED. Verified P3b concierge runtime/model generalization: default concierge model is minimax/MiniMax-M2.7, runtime is threaded from the workspace row/install parameter with claude-code fallback, template mapping is per-runtime, and existing concierge runtime is not clobbered on reinstall. Robustness/fail-closed: MODEL/LLM_PROVIDER read/decrypt errors return without seeding, so customer BYOK/self-host choices are not overwritten or mis-pinned; unknown registry/provider cases leave unset rather than silently routing. Security: org-admin MCP/env remains gated to kind=platform; ordinary workspaces do not receive admin token or concierge substitution. Performance/readability: narrow handler/registry changes with explicit tests. Prove-fail coverage includes runtime parameter/non-clobber integration test, default model/routability tests, platform-only MCP gating, identity placeholder behavior, and fail-closed MODEL/provider read-error tests.
REQUEST_CHANGES: independent 5-axis qa review on head
9e4e5d0849.Finding (correctness/robustness): workspace-server/internal/handlers/platform_agent.go:1063 updates template=$4 on every installPlatformAgent conflict while deliberately preserving the existing runtime. That creates a mixed row when a codex/openclaw concierge is reinstalled through a legacy/default-runtime path: runtime stays codex, but template is overwritten to platform-agent. The new integration test exercises exactly this path at platform_agent_integration_test.go:359-367, but it only rereads runtime and never asserts the template stayed codex-platform-agent, so the regression is uncovered. Because apply/provision now depends on runtime/template pairing for the per-runtime platform-agent identity, this can fetch the wrong identity after an idempotent reinstall/backfill.
Other axes: no security or performance issue beyond the wrong asset/template selection, and the code is readable, but the runtime/template invariant needs to be fixed and covered before qa approval.
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
APPROVE (code-review) on fixed head — RC 13985 resolved: ON CONFLICT now derives template from the PRESERVED runtime (CASE mirroring conciergeTemplateForRuntime), so (runtime,template) stays matched after default reinstall; prove-fail test extended to assert the template field (fails vs
9e4e5d08, passes now); verified against real pgvector Postgres + 95 migrations. Runtime-preservation untouched.APPROVE (security) on fixed head — RC 13985 resolved: ON CONFLICT now derives template from the PRESERVED runtime (CASE mirroring conciergeTemplateForRuntime), so (runtime,template) stays matched after default reinstall; prove-fail test extended to assert the template field (fails vs
9e4e5d08, passes now); verified against real pgvector Postgres + 95 migrations. Runtime-preservation untouched.APPROVED core#3248 @9ede3502.
5-axis qa review:
templatefrom the preserved runtime using the same mapping asconciergeTemplateForRuntime(claude-code -> platform-agent, otherwise -platform-agent), so default reinstalls keep runtime and template consistent instead of preserving one while rewriting the other.9e4e5d08and passes on9ede3502.Required contexts are green on this head: CI / Platform (Go), CI / all-required, security-review, reserved-path-review, and template-delivery-e2e. Non-BP gate-check-v3 remains failing and stale qa-review is expected to clear from this current-head approval.
APPROVED: independent qa re-review on head
9ede3502ac.Correctness: RC 13985 is resolved. installPlatformAgent still preserves the existing runtime on conflict, and the template is now derived from the preserved workspaces.runtime via a CASE matching conciergeTemplateForRuntime: empty/claude-code maps to platform-agent, otherwise TRIM(runtime)||'-platform-agent'. That keeps runtime/template matched after a default reinstall of a codex/openclaw concierge. Robustness: the integration test now asserts both runtimeAfterReinstall and templateAfterReinstall, so the old head's template=$4 mismatch would fail. Security: no fail-open auth or privilege change; the fix prevents wrong identity/template selection. Performance: constant-time SQL expression only on the install conflict path. Readability: the SQL comment documents the invariant and the CASE mirrors the helper clearly. Current non-success contexts were qa/gate checks awaiting this approval; other required CI blockers previously seen are clear.