Bootstrap fit: residual cases of the plugin's fixed per-entry framing estimate

未关闭
#53 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript
领域
api, tooling

调研方向

Start from the server's GET /Memory/bootstrap response, where entryOverhead and sectionItemOverhead are added by PR #50, and from the plugin's fixed per-entry framing estimate (~308 chars) and its ordered-prefix render. Reproduce case 1 with a pin whose title + content is about 3,420–3,530 chars at the default 4,000 budget, then case 2 with a lastEditor or longer scopes. The fix needs a decision on whether the server counts provenance strings, so settle that with maintainers first. Done means every entry that fits the budget is injected or the omission is explained.

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

描述

Deferred from Claude Code plugin: inject all of bootstrap within budget, render section entries and summaryTree topics review.

That PR adds entryOverhead and sectionItemOverhead to GET /Memory/bootstrap. The Claude Code plugin sends a fixed per-entry framing estimate, computed from its own header format for an entry with:

  • a 64-char id
  • a 32-char author and no lastEditor
  • 64 chars of scopes
  • the longest built-in section

That estimate is ~308 chars per memory; typical entries frame in ~180–220. Because it is one constant per request, three cases remain:

  1. Boundary window. An entry whose title + content comes within about the estimate's slack (~100 chars) of the request budget is not packed, even though it would render within the injection budget. At the default 4,000 budget this is a pin with title + content of about 3,420–3,530 chars. The authoritative offline-cache save then leaves it out too.
  2. Metadata beyond the estimate. The server packs these entries, but the plugin's ordered-prefix render stops at the first one that does not fit, and the rest of the response is not injected. They stay in watchedIds. Examples:
    • a lastEditor
    • principal ids longer than 32 chars
    • more than ~64 chars of scopes (up to 16 × 128 are legal)
    • escaped characters, or bodies that sanitizing lengthens
  3. Offline cache render. The stale-cache path renders with skip-ahead rather than the ordered prefix. That is deliberate (the cache was packed for an earlier request), but it differs from the online path.

Possible fix for 1 and 2: the server also counts each entry's provenance strings (id, author, lastEditor, scopes, section), so the client's overhead covers only its fixed framing. That puts one client's header field list in the server contract, which is why the PR shipped the constant.

Review-Deferral: 3e7b1f54450ae2b7 severity=nit category=correctness
Review-Deferral: d4b1192533479e66 severity=nit category=correctness

主要语言
JavaScript
星标
0
派生
0
平均合并
20 小时 29 分钟
30 天内合并 PR
28

环境准备

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

从这里开始

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

HarperFast/agent-memory 的其他 Issue

查看 HarperFast/agent-memory 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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