feat: enable GrowthBook local gate defaults for P0/P1 features

Add LOCAL_GATE_DEFAULTS mapping in growthbook.ts with 27 feature gate
defaults (25 boolean + 2 object config). Insert local defaults into the
fallback chain of all getter functions so they work regardless of whether
GrowthBook is enabled or disabled:

  env overrides → config overrides → in-memory cache → disk cache
  → LOCAL_GATE_DEFAULTS → caller defaultValue

P0 (local): keybindings, streaming tool exec, cron, JSON tools,
ultrathink, explore/plan agents, deep link, immediate model switch
P1 (API): session memory, auto memory, prompt suggestions, brief mode,
verification agent, away summary, auto dream, idle return prompt
Kill switches: 10 gates kept true to prevent remote disable

New compile flags: AGENT_TRIGGERS, ULTRATHINK, BUILTIN_EXPLORE_PLAN_AGENTS,
LODESTONE, EXTRACT_MEMORIES, VERIFICATION_AGENT, KAIROS_BRIEF, AWAY_SUMMARY

Bypass all local defaults: CLAUDE_CODE_DISABLE_LOCAL_GATES=1
This commit is contained in:
unraid
2026-04-06 17:00:30 +08:00
parent ca630488c6
commit 1b47333d72
7 changed files with 675 additions and 18 deletions

View File

@@ -38,18 +38,24 @@ Claude Code 使用三层门控系统:
---
## 当前启用状态 (2026-04-05)
## 当前启用状态 (2026-04-06)
> 经 Codex CLI 独立复核验证,详见 `feature-flags-codex-review.md`
> GrowthBook gate 启用详见 `growthbook-enablement-plan.md`
| 标志 | build.ts | dev.ts | 实际验证状态 | 备注 |
|------|:--------:|:------:|:----------:|------|
| AGENT_TRIGGERS_REMOTE | **ON** | **ON** | compile-only | 环境标记,原始即启用 |
| CHICAGO_MCP | **ON** | **ON** | compile-only | Computer Use原始即启用 |
| VOICE_MODE | **ON** | **ON** | compile-only | 语音模式,原始即启用 |
| SHOT_STATS | **ON** | **ON** | compile-only, 已验证 | 本轮新增,纯本地统计 |
| PROMPT_CACHE_BREAK_DETECTION | **ON** | **ON** | compile-only, 已验证 | 本轮新增,内部诊断 |
| TOKEN_BUDGET | **ON** | **ON** | compile-only, 已验证 | 本轮新增,支持 `+500k` 语法 |
| SHOT_STATS | **ON** | **ON** | compile-only, 已验证 | 纯本地统计 |
| PROMPT_CACHE_BREAK_DETECTION | **ON** | **ON** | compile-only, 已验证 | 内部诊断 |
| TOKEN_BUDGET | **ON** | **ON** | compile-only, 已验证 | 支持 `+500k` 语法 |
| AGENT_TRIGGERS | **ON** | **ON** | compile+GB gate, 已验证 | 本轮新增,定时任务系统 |
| EXTRACT_MEMORIES | **ON** | **ON** | compile+GB gate, 已验证 | 本轮新增,自动记忆提取 |
| VERIFICATION_AGENT | **ON** | **ON** | compile+GB gate, 已验证 | 本轮新增,对抗性验证代理 |
| KAIROS_BRIEF | **ON** | **ON** | compile+GB gate, 已验证 | 本轮新增Brief 精简模式 |
| AWAY_SUMMARY | **ON** | **ON** | compile+GB gate, 已验证 | 本轮新增,离开摘要 |
| BUDDY | off | **ON** | compile+GrowthBook | 仅 dev 模式 |
| TRANSCRIPT_CLASSIFIER | off | **ON** | compile+GrowthBook | 仅 dev 模式 |
| BRIDGE_MODE | off | **ON** | compile+remote | 仅 dev 模式,需 claude.ai 订阅 |