contextguru plugin: set keepalive.Record.Identity; context-guru v0.7.11 removes Record.Agent

未关闭 适合新手
#2,160 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
api, backend

调研方向

阅读 core/plugins/contextguru/keepalive.go,尤其是 recordFor,并查看 rossoctl/context-guru#1506 所引用的 context-guru v0.7.11 变更。将已移除的 Record.Agent 字段替换为 Identity: agent.Identify(pctx.Headers)。完成的标准是 Cortex 能够使用 v0.7.11 编译,并且该变更能与 #2154 一起纳入同一个 PR。

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

描述

Summary

context-guru v0.7.11 removes keepalive.Record.Agent. The contextguru plugin sets that field, so Cortex no longer compiles once it embeds v0.7.11. The fix is one line. context-guru v0.7.10 is safe to embed with no change.

What breaks

  • core/plugins/contextguru/keepalive.go, recordFor, sets Agent: pctx.Headers.Get("User-Agent") in keepalive.Record.
  • rossoctl/context-guru#1506 moved client rules into the agent packages and removed Record.Agent. The keeper now reads the client from Record.Identity.

Fix

  • Set Identity: agent.Identify(pctx.Headers) in place of Agent: ....
  • Library code takes agent.Client and no longer reads User-Agent itself (context-guru CLAUDE.md, Client-specific code).
  • #2154 changes the same recordFor function (the open-task counts), so both fit in one PR.

Other changes when Cortex moves to v0.7.11

  • The accountant moves to v0.11.x. Cortex's accountant.Withhold(p.result, before) (core/accounting/host.go) and Observation.TokensBefore (core/accounting/metrics.go) still compile there. Both are deprecated: see #2159. They are removed only in a later accountant minor release (rossoctl/context-guru#1523), after #2159 merges.
  • No other Cortex code uses an API that v0.7.11 removes. waitcause.PromptOf and dash.AgentFor are also removed, and Cortex does not call them. tooldefer.Flow.Prices and the CanKeepAlive names still exist as deprecated aliases.

Refs #2154 #2159

主要语言
Go
星标
31
派生
49
平均合并
9 小时 43 分钟
30 天内合并 PR
367

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

rossoctl/cortex 的其他 Issue

查看 rossoctl/cortex 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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