Skip to content

pkg/aflow/tool: add code-editing tool for agents #6470

@dvyukov

Description

@dvyukov

Patch generation and other code agents will need ability to edit files.
Some systems ask agent to output new contents of whole files, but it does not look like a good idea. An agent can also generate diffs in patch format, but it may be harder to get right. From I heard the following approach seems to work best: agent does series of edits (a hunk in patch diff format), for each edit it provides the existing code to replace, and the new code. Also need to handle insertions somehow.
Potentially we can use line numbers in codesearch output, and ask agent to refer to line numbers for edits.
This issue is about providing such complete code editing capability to agents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI patchingFeature requests and bugs related to AI-based kernel bug fix generation.enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions