Bound repository context size in load_repo_context

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

维护者通常 1 天内回复

@kpj2006 已经在做这个了。

开始于 2026年7月30日。

  • #45 来自 @rishiiicreates —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
python
领域
ai

调研方向

从 repo_router.py 中的 load_repo_context() 开始,检查 baseline、与 intent 匹配的 .agent/**/*.md 文件以及 README 内容是如何读取并追加的。在设置共享的单文件和总限制之前,跟踪现有的 README 截断和错误日志记录。完成的标准是:截断的部分会被标记,两个预算都得到遵守,并且 intent 选择和路由行为保持不变。

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

描述

Summary

Add bounded Markdown context loading to repo_router.py so repository context passed to the LLM has predictable size.

Rationale

load_repo_context() currently reads baseline and intent-matched .agent/**/*.md files in full. Categorizing the query reduces the number of selected files, but a single large selected file can still consume the prompt budget, increase latency, and cause the user query or relevant context to be truncated.

Affected area

  • repo_router.py
  • load_repo_context()

Required changes

  • Introduce a shared capped-read helper for Markdown context files.
  • Apply a per-file content limit to operational data, architecture, core context, and instruction files.
  • Enforce an overall context-size budget while appending sections.
  • Preserve the existing intent-based selection and error logging behavior.
  • Mark truncated content clearly in the assembled context.

Acceptance criteria

  • No individual Markdown context file can exceed the configured per-file cap in the LLM context.
  • The assembled repository context cannot exceed a configured total budget.
  • Existing README truncation remains consistent with the shared limit strategy.
  • The existing routing and intent-selection behavior remains unchanged.

Backlinks

Requested by @kpj2006.

主要语言
Python
星标
10
派生
11
平均合并
6 分钟
30 天内合并 PR
4

环境准备

从这里开始

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

AOSSIE-Org/SkillBot 的其他 Issue

查看 AOSSIE-Org/SkillBot 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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