feature: opt-in plugin config to reuse the proxied agent's LLM credentials
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 8/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- devtools, go
调研方向
The payload points at core/plugins/contextguru/plugin.go (incomingModel) as the closest existing in-process version of reusing the agent's credentials. The open questions are design decisions: out-of-process key handling, OAuth token policy, dialects and cost caps. Nothing here is settled, so a newcomer should not start coding; the first step is to comment and ask a maintainer to agree on the design. Done would be a maintainer-approved design, not a patch.
由索引模型根据 Issue 内容生成。
描述
Summary
Add an opt-in plugin config option that lets a plugin reuse the LLM credentials of the agent Cortex is proxying (endpoint, model, API key), so users don't have to enter separate credentials for plugins that make their own LLM calls. Explicit credentials in the plugin config stay supported and take precedence.
Requested by @vinodmut for the altk-evolve integration; agreed by @huang195 in Slack.
Motivation
Plugins backed by a companion service that makes its own LLM calls (e.g. altk-evolve) currently need their own credentials: an API key, a base URL, and a model, set through env vars, a .env file, or plugin parameters. That's extra setup when the user usually wants the same model the agent already uses.
Today, consent is given by the user explicitly passing credentials as a plugin parameter (e.g. ibac's inference server). Reusing the agent's credentials silently would let a plugin run up token costs without the user knowing, so this must stay opt-in. A config flag keeps the consent explicit and removes the copy-paste.
Proposal
- A per-plugin config option, e.g.
llm.credentials: passthrough(the name is a placeholder), that is off by default. - When enabled, the plugin gets the agent's endpoint, model, and
Authorizationfrom the live request. - Explicit
api_key/base_url/modelin the plugin config still work, and override passthrough when set. - Calls made with reused credentials should carry the existing per-process sentinel header so the pipeline doesn't intercept them again. They should also be attributable (stats/telemetry) so the user can see the token spend a plugin drives.
Prior art
context-guru already does an in-process version of this: model.source: incoming rebuilds the agent's model client from the live request (base URL + token-exchanged Authorization + the request's model). See incomingModel in core/plugins/contextguru/plugin.go. It only supports the OpenAI dialect for now.
Open questions
- Out-of-process consumers. Evolve's learning step runs later ("once idle") in a separate process, after the request that carried the key has ended. Passthrough there means handing the key to another process, or holding it past the request, which in-process plugins don't do today. Options: Cortex hands the key over at registration time, or Cortex exposes a local relay endpoint the service calls and Cortex injects the agent's credentials there. The relay keeps the key inside Cortex and gives one place to meter spend.
- Subscription / OAuth tokens. When the agent runs on a Claude subscription, the "key" is an OAuth token, and using it for another service's calls may not be allowed under the provider's terms. Passthrough may need to be refused, or carry a warning, for OAuth-style credentials.
- Dialects. Anthropic as well as OpenAI (context-guru's
incomingis OpenAI-only). - Cost guardrails. Possibly an optional per-plugin token/spend cap when passthrough is enabled.
Related
Separate but adjacent: plugins backed by a long-running service (sparc, aiac, sentry, context-guru, Evolve) each need that service started outside Cortex. Hai noted that this pattern keeps coming up and may be worth revisiting, perhaps via a companion-process hook on the laptop supervisor (cortex --supervise).
- 主要语言
- Go
- 星标
- 31
- 派生
- 49
- 平均合并
- 9 小时 43 分钟
- 30 天内合并 PR
- 367
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rossoctl/cortex 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug laptop
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behind可能已有人在做 @arshil42 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 80/100
ether/etherpad-go#571 ·
维护者通常 1 天内回复
-
labeler: read a limit above math.MaxInt as math.MaxInt in nonNegative (CodeQL alerts #20 and #21)未关闭cost:approved factory:queued factory:tracking priority:p2 rank:12 ready-for-doing task:approved tokens:50k
难度 2/5 1-3 小时 新手友好度 88/100
sisaku-security/sisakulint#860 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100