aws / aws/amazon-q-developer-cli

Make Q aware of changes I make to files that Q has edited

Offen
#2,874 2 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
2k
Forks
439
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Here's a common scenario: Q will make changes to a file, I'll revise the file, then when I prompt Q to do something else with that file, it'll overwrite my changes.

I've gotten in the habit of explicitly saying "I've made some changes" at the start of my prompt to hint to Q that it should read the file again and treat the changes there as coming from me. (If it reads the file when I haven't said anything, it seems to assume that the changes were introduced by mistake.) I also include this paragraph in my global context:

> Any code changes I make during our session should be considered feedback. If you aren't sure why I made a change, please stop and ask. Avoid overwriting my changes without confirming with me first.

But even with that, Q still frequently ignores or overwrites my changes.

In theory one could use [hooks](https://github.com/aws/amazon-q-developer-cli/blob/main/docs/agent-format.md#hooks-field) to run `git diff` on every `userPromptSubmit`, but that would quickly flood the context with irrelevant changes. What I really want is:

1. A mechanism that informs Q of changes to files it's edited (perhaps with a tool to request a diff), and
2. Tweaks to the system prompt to make Q more inclined to respect those changes.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der Hook-Dokumentation in docs/agent-format.md, insbesondere mit dem userPromptSubmit hook, und prüfe, wie git diff Benutzeränderungen sichtbar machen könnte. Definiere, wie Q Dateien identifizieren sollte, die es zuvor bearbeitet hat, wann ein Diff angefordert wird und wie der system prompt mit diesen Änderungen umgehen sollte. Als abgeschlossen gilt die vorgeschlagene Lösung, wenn sie Benutzeränderungen berücksichtigt, ohne den Kontext mit irrelevanten Änderungen zu überfluten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git, rust
Bereich
ai, cli, developer-experience
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.