Code mode: Prisma schema (code_runs, McpServerConfig.codeMode, Role.capabilities, KgSkillSuggestion.kind)

已关闭
#1,362 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
backend, databases

调研方向

Read AGENTS.md and resolve the dependency on #1361 before editing schema.prisma. Add the four listed schema changes and a migration; clarify the code_runs retention story, and verify that existing installs retain current behavior after migration.

由索引模型根据 Issue 内容生成。

描述

enhancement

Summary

Schema changes required for code mode. Per AGENTS.md, opening this before touching schema.prisma; each ships with a migration. Depends on #1361.

Changes

  1. code_runs table — audit of every code run: id, organizationId, userId, mcpServerId, source (inline | code-tool id), status, durationMs, tool-call count, error, createdAt. Nested tool calls keep going through tool_invocations, correlated by a codeRunId carried in clientInfo. Needs a retention story (per-plan: 7/30/90 days / 1y+).
  2. McpServerConfig.codeMode — enum/string column off (default) | tools | inline. Governs whether a server exposes saved code tools and/or the inline code_execute tool.
  3. Role.capabilities — JSON column for per-role capability flags, first use inlineCode (may the role run inline code). Keeps capabilities off the tool-allowlist model, which stays per-tool.
  4. KgSkillSuggestion.kind — add a code kind so an agent-proposed code tool becomes a pending suggestion an ADMIN approves, reusing the existing skill approval flow.

Notes

  • McpTool needs no column: a saved code tool is endpointMapping.method = 'code' (JSON field), like static. Tracked in the execution-path issue.
  • Every org-scoped query stays filtered by organizationId.
  • All four default to the current behaviour so the migration is a no-op for existing installs.
主要语言
TypeScript
星标
856
派生
82
平均合并
6 小时 10 分钟
30 天内合并 PR
448

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

HelpCode-ai/anythingmcp 的其他 Issue

查看 HelpCode-ai/anythingmcp 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。