docs(rfd): HITL Editing — Interactive File Write Feedback#895
Open
Luminger wants to merge 1 commit intoagentclientprotocol:mainfrom
Open
docs(rfd): HITL Editing — Interactive File Write Feedback#895Luminger wants to merge 1 commit intoagentclientprotocol:mainfrom
Luminger wants to merge 1 commit intoagentclientprotocol:mainfrom
Conversation
Propose extending WriteTextFileResponse with interactive feedback fields (action, userModification, feedback) and a new ContentDiff type, gated by agentCapabilities.fs.hitlEditing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds an RFD proposing HITL (Human-in-the-Loop) editing for ACP's
fs/write_text_filepath.The proposal extends
WriteTextFileResponsewith optional fields that allow clients to report user modifications and feedback back to the agent when the user edits a proposed file change before accepting it. This closes the feedback loop that is currently missing: the agent proposes a change, the user tweaks it, and the agent learns what was changed — all within a single interaction.The proposal:
ContentDifftype — a reusable, format-discriminated diff primitive (unifiedorfull) that ACP currently lacksagentCapabilities.fs.hitlEditingcapability for agents to advertise supportWriteTextFileResponsewith a discriminatedactionfield (accept | reject | cancel) following the same pattern asElicitationActionandRequestPermissionOutcomeaccept, includes an optionaluserModificationobject (diffasContentDiff+finalContent) when the user edited the proposalfeedbackstring for user comments on both accept and reject pathsnullor{}Motivation
Agentic coding tools today are stuck in a binary accept/reject model for file writes. Even when the agent's proposal is close to the desired change, the user can only accept or reject, which can lead to frustrating multi-turn ping-pong before converging on the desired result. Worse, some editors already allow users to edit the proposed diff before accepting, but the agent is never informed about these edits, causing it to work from an outdated understanding of the file.
The proposed pattern was pioneered by the Cline family of harnesses (Cline and Roo Code) and has proven effective in practice. This RFD introduces this pattern to the ACP ecosystem.
Prior Art
This pattern is already implemented and battle-tested in the Cline family of harnesses:
Roo Code
DiffViewProvider.saveChanges()— Core HITL logic: compares the agent's proposed content to the user's (potentially modified) content in the diff editor, generates a unified diff viacreatePrettyPatch(), and returns{ userEdits, finalContent }.DiffViewProvider.pushToolWriteResult()— Formats the structured JSON response sent back to the agent, includinguser_edits(the diff) andproblems(new diagnostics). Also sends auser_feedback_diffmessage to the UI.Cline
DiffViewProvider.saveChanges()— Same core pattern: detects user modifications, generates a unified diff, returns{ userEdits, finalContent }.WriteToFileToolHandler— Consumes thesaveChanges()result and sendsuser_feedback_diffto the UI when the user made edits.formatResponse.fileEditWithUserChanges()— Formats the prose response sent to the model: includes the user's diff, the final file content, and instructions to use the updated content as the new baseline.Both implementations share the same core mechanism: diff view as a gate → user edit detection → unified diff generation → feedback to the agent. The key difference is that Roo Code returns structured JSON while Cline uses prose.
Related Discussions & PRs
Allow client to edit tool calls during permission requests #221 — @WhiskeyJack96 raised the exact same problem in Nov 2025: users wanting to edit tool call proposals before approving, with the agent being informed of the changes. That discussion received no replies and no RFD was filed. This proposal is the first formal solution.
docs(rfd): client-owned fs/apply_patch #808 — We are strongly in favor of
fs/apply_patchand see it as the other half of the same story:fs/apply_patchaddresses the input format (how agents send structured edits), while HITL editing addresses the output (how clients report user modifications back). We would like to see both proposals align and integrate — specifically,fs/apply_patchshould adopt the same outcome-basedactionfield anduserModificationfeedback in its response, so that agents get a consistent HITL experience regardless of whether they write files viafs/write_text_fileorfs/apply_patch.Extend Diff type #176 / docs(rfd): Indicate deletes in diffs #441 — The existing ACP
Difftype (used inToolCallContent) carriesoldText/newTextfull-content pairs for displaying agent-proposed changes in the client UI. Rather than reusing it or introducing a one-off string field, we designed a newContentDifftype with aformatdiscriminator (unifiedfor compact patches,fullfor before/after content). This addresses @benbrandt's comment on docs(rfd): Indicate deletes in diffs #441 — "let's turn this into the long-awaited new version of diff that supports more info" — by providing a general-purpose diff primitive that could also serve the existingToolCallContent.Diffand any future extensions. That said, if the maintainers prefer to address the general diff type separately,ContentDiffcan be dropped from this proposal anduserModification.diffcan remain a plain string.