feat: structured telemetry metrics, strict MCP config mode, and PermissionDecision types#263
Open
raymondginger2018-sudo wants to merge 5 commits into
Conversation
added 5 commits
July 14, 2026 22:11
1. 自动错误修复循环 (Auto Error Fix Loop) - bash-handler.ts: 命令失败时自动提取关键错误行 - session.ts: 检测工具执行失败,自动注入修复提醒 2. Plan → Execute → Verify 内置循环 - prompt.ts: 新增 AGENTIC_BEHAVIOR_PROMPT 系统提示 - 告诉 LLM 先规划、再执行、每步验证、失败必修 3. 错误输出结构化增强 - 失败命令的输出自动包裹 <error_analysis> 标签 - LLM 放弃修复时自动注入 [Auto Error Fix] 提醒 - 最多重试 3 轮,仍失败则向用户解释
.agentic-snapshot/ 包含: - README.md: 恢复指南(Git / 脚本 / npm link 三种方式) - restore-agentic.bat: 一键恢复脚本 - .gitignore: 不跟踪构建产物 备份的 dist 文件存储在本地 .agentic-snapshot/*.js, 不会被 git 跟踪,需要手动保留或从 git 提交还原源码。
借鉴 OpenAI Codex CLI 架构精华,四大模块升级: 1. Permission Profile:结构化权限系统 - Managed / Unrestricted / Legacy 三模式 - 路径级 ACL(read/write/deny + glob 匹配) - 内置 STRICT_SANDBOX / DEFAULT_DEV 预置 Profile 2. SQLite 统一状态管理 - 4 张表:session_logs / token_budget / permission_audit / checkpoints - json_extract 结构化查询 - 自动持久化 + 7 天清理 3. Job 队列引擎 - SpawnRequest->SpawnReady->ExitPayload 三阶段协议 - 指数退避重试 + 并发控制 - 全局单例 getGlobalJobQueue() 4. Skill 标准化 - Codex 兼容 SKILL.md frontmatter 解析 - agent.dependencies / interface / policy 声明 - skillPolicyToProfile() 自动权限转换 测试:38/38 全部通过
从 Claude Code v2.1.216 移植: - deepcode-agent-sdk: Agent SDK (agentSdk.ts) - deepcode-sandbox: 安全沙箱 (sandbox-runtime) - deepcode-auth: OAuth2/OIDC/API Key 认证 - deepcode-streaming: SSE 流式 API - deepcode-hooks: Hook 系统 + Codex 决策模型 - deepcode-chrome: Chrome 浏览器集成 从 codex.exe 移植: - deepcode-agent: Agent 消息类型系统 (21 种消息类型) - deepcode-rust-re: Rust 二进制逆向分析引擎 附: SQLite 自动保存修复
…ermissionDecision types - feat(telemetry): Add PermissionDecisionMetrics and ToolUsageMetrics types - feat(telemetry): Implement in-memory metrics store (per-session, non-persistent) - feat(telemetry): Export recordPermissionDecision, recordToolUsage, getSessionMetrics - feat(mcp-manager): Add strict MCP config mode with command allowlist validation - feat(mcp-manager): Support setStrictMode() for upstream --strict-mcp-config - feat(session): Wire strictMcpConfig from settings to McpManager - feat(settings): Add strictMcpConfig option to DeepcodingSettings schema - refactor: Re-export new telemetry types from core/index.ts Upstream reference: Claude Code --strict-mcp-config flag
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.
Summary
Adds structured observability and security hardening features ported from Claude Code upstream.
Key Changes
Structured Telemetry Metrics
PermissionDecisionMetricstype (toolType + accept/reject decision tracking)ToolUsageMetricstype (totalCostUSD, totalAPIDuration, lines added/removed, tool calls)Strict MCP Config Mode
strictMcpConfigoption to settings schemaUpstream References
--strict-mcp-configflag