Skip to content

Run formatters only on session end instead of after tool call #2535

Closed

Description

@remorses

Now formatters confuse the LLM too much. Running formatting on session end would give most of the benefits without penalizing tool calls success rate in the same message

Activity

  1. github-actions commented on Sep 10, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. remorses commented on Sep 11, 2025

    @remorses
    ContributorAuthor

    Another way to mostly solve this: format files on read tool calls before returning them to the model.

  3. rekram1-node commented on Sep 11, 2025

    @rekram1-node
    Collaborator

    @remorses I think that is kinda existing behavior tho no?

    LLM reads file
    LLM edits file
    formatter runs
    LLM tries to edit file
    LLM must re-read file
    ...

  4. remorses commented on Sep 11, 2025

    @remorses
    ContributorAuthor

    I mean formatting the file on read operations. this way the LLM will probably use same conventions, there is less risk of big changes after formatting. code outside of the replaced snippet is guaranteed to be formatted

  5. thdxr commented on Sep 11, 2025

    @thdxr
    Member

    im thinking maybe at the end of a message (when agent is done) we go through all edit tool calls and format the file?

    if they try to edit again they are told the file is modified so they will reread it

  6. remorses commented on Sep 12, 2025

    @remorses
    ContributorAuthor

    That would be much better than now (I would prefer it disabled by default tho)

    I want to keep git diff as a way to see what the model changed and it it starts formatting files the diff gets crowded

  7. rekram1-node commented on Sep 12, 2025

    @rekram1-node
    Collaborator

    does your editor not format on save? For me the diffs arent ever crowded because a save runs prettier, gofmt, etc

  8. remorses commented on Sep 12, 2025

    @remorses
    ContributorAuthor

    No, I currently use mainly Claude Code and try sometimes Opencode. I use both at the same time, so I have a lot of unformatted files

    I have non formatted files for a lot of reasons. I just don't format on save. I think that's the majority of users. Now i disabled all LSP and formatters, that should be the default imo

  9. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Collaborator

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

  10. remorses commented on Dec 28, 2025

    @remorses
    ContributorAuthor

    I would like to keep this open but GithHub says I do not have the permission to do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions