From 0af1ebc91565bc01049a2fa880cd0d1c9bfeec1f Mon Sep 17 00:00:00 2001 From: weichen Date: Tue, 13 Oct 2026 04:45:12 +0000 Subject: [PATCH] Seed the mock startup option into the system settings scope Why: Since the system-managed settings change (#188), runtime.* writes at the user scope are rejected, so the mock startup flag failed with "system-managed settings require admin" and the serve process never became healthy - the Dev multi-instance integration regression. Evidence: go build ok; internal/app and internal/settings suites green (SELF); the Dev composite CI on the follow-up PR re-runs make test-multi-instance against this fix (GATE). Impact: The mock startup flag now seeds runtime.mock via MergeSystem (trusted operator input, effective for every tenant through the Effective merge chain); no HTTP surface changes. Refs: Dev PR #508; backend #188. --- internal/app/app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/app/app.go b/internal/app/app.go index 47d4311..1658497 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -437,7 +437,10 @@ func Run(opt Options) error { return fmt.Errorf("default profile: %w", err) } if opt.ForceMock { - if err := setSvc.MergeUser(store.OwnerDefault, map[string]any{"runtime": map[string]any{"mock": true}}); err != nil { + // runtime.* 自 #188 起为系统受管项:启动选项属受信操作员输入, + // 播种走系统层(对所有租户生效);用户层写入会被受管拦截拒绝, + // 导致 serve --mock 直接启动失败(multi-instance 集成回归)。 + if err := setSvc.MergeSystem(map[string]any{"runtime": map[string]any{"mock": true}}); err != nil { return err } }