GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Return the formatted file for file-output formatters by IzonIcy · Pull Request #765 · athasdev/athas

Conversation

@IzonIcy

@IzonIcy IzonIcy commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Formatters configured with outputMethod: "file" rewrite the file in place, but format_with_generic never read it back. It returned the original content while reporting success: true, so the user silently kept unformatted text with no error surfaced. This predates the agent-chat redesign: the branch came from commit 1e321ac0 ("Unify editor command execution"), which left the TODO unimplemented.

  • Return the file's contents when outputMethod is not stdout
  • Return an error when no file_path was supplied
  • Fall back to the original content when the file cannot be read, rather than failing the request
  • Added two regression tests for the file-output path and the missing-path error

How to test:

  1. cargo test -p athas --bin athas -- commands::editor::format
  2. Confirm returns_file_contents_for_file_output_method fails if the else branch is reverted to content.to_string(), since rustfmt rewrites the temp file while the response keeps returning the unformatted input.

Screenshots:

Not applicable.

Validation

  • cargo check --workspace --all-targets — pass
  • cargo clippy --workspace --all-targets -- -D warnings — pass
  • cargo test --workspace --no-fail-fast — pass, 0 failures
  • cargo fmt --check — this file is clean. Note the repo pins nightly in rust-toolchain.toml and CI runs nightly for fmt; on a stable toolchain the check reports unrelated pre-existing diffs in crates/ai, crates/runtime, crates/terminal, crates/tooling and crates/wsl. None are from this change.

Gap: the tests shell out to rustfmt as the file formatter. That keeps the test honest end to end, but it does assume rustfmt is on PATH in CI, which the existing cargo fmt --check gate already guarantees.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mehmetozguldev reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@IzonIcy
Return the formatted file for file-output formatters
66ba0b0
format_with_generic returned the original content for any formatter whose
outputMethod is not "stdout". Extensions that reformat a file in place
therefore reported success while handing back unformatted text.

Read the file back instead, which is what the file output method actually
means. A missing file path now fails loudly, and a file that cannot be read
falls back to the original content rather than failing the whole request.

The TODO this replaces came from 1e321ac, which unified editor command
execution but left the file branch unimplemented.
Copilot AI balanced review requested due to automatic review settings October 1, 2026 22:28
Copilot AI reviewed Oct 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mehmetozguldev
mehmetozguldev self-requested a review October 2, 2026 18:34
@mehmetozguldev
mehmetozguldev merged commit 003b057 into athasdev:main Oct 4, 2026
1 of 3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@mehmetozguldev mehmetozguldev Awaiting requested review from mehmetozguldev

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@IzonIcy @mehmetozguldev
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.