Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Smarter context: tell the agent what changed in git and in files since its last turn

Đã đóng
#85 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
developer-experience

Hướng nghiên cứu

Start by tracing how the first user message is assembled and how later turns are prepared; the issue names pendingNotes as the natural place to queue change notices. Check how the app detects the current branch, HEAD, changed files, and files read or edited in the chat before estimating the work. Done means the proposed git context appears at chat start, later notes appear only for relevant external changes, and notices are capped and skipped outside repositories.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement priority: medium severity: low

Today

The system prompt shows the project's top-level listing and AGENTS.md, but nothing about git:

  • no branch;
  • no uncommitted changes;
  • no recent commits.

Between turns the user may also edit files, switch branches or pull. The agent only notices when an edit fails because a file changed since it was read (the read-before-edit check), or not at all, and may build on stale reads.

Proposal

  1. At chat start: add a short git block to the first user message, not the system prompt, so the cached prefix stays stable:
    • the branch;
    • ahead/behind counts;
    • up to 20 changed files with their status;
    • the last 5 commit subjects.
  2. Before each later turn: if files the agent read or edited in this chat changed outside it, or the branch or HEAD moved, prepend one note, e.g. "Changed since your last turn: src/a.ts (modified), branch main → feature/x". The mechanism Undo uses to queue notes (pendingNotes) is the natural place.
  3. Cap it and skip it when nothing changed or the project is not a repository.

Measure

Fewer failed edits from stale reads, and fewer "check git status" tool calls, on the benchmark (#49) and in real use (counts in the local log, numbers only).

Ngôn ngữ chính
TypeScript
Star
2
Fork
2
Merge trung bình
8 giờ 28 phút
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PierrunoYT/patch

Tất cả issue của PierrunoYT/patch

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.