Skip to content

Conversation

@The-Best-Codes
Copy link
Collaborator

@The-Best-Codes The-Best-Codes commented Oct 23, 2025

Summary

Ensures all files created or modified by the text_editor tool end with a trailing newline character. This resolves compatibility issues with POSIX-compliant tools that expect newline-terminated files and eliminates "No newline at end of file" warnings in diffs.

Resolves #2825.

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

Testing

These changes were tested manually and with additional unit tests.

Related Issues

Relates to #2825

Signed-off-by: The-Best-Codes <[email protected]>
Signed-off-by: The-Best-Codes <[email protected]>
@The-Best-Codes
Copy link
Collaborator Author

Still working on this! Will update the PR description with more info once it's ready for review.

@The-Best-Codes The-Best-Codes marked this pull request as ready for review October 23, 2025 17:51
@taniandjerry taniandjerry added hacktoberfest Issues awarding points for Hacktoberfest 2025! large Weight label for Hacktoberfest 2025 issues labels Oct 23, 2025
@The-Best-Codes
Copy link
Collaborator Author

Working on those failing tests now!

@The-Best-Codes
Copy link
Collaborator Author

Looks like no API key is set for this test, so it fails (not related to my code changes):
https://github.com/block/goose/actions/runs/18754719687/job/53519227490?pr=5336

@The-Best-Codes
Copy link
Collaborator Author

All tests passing except this one:
https://github.com/block/goose/actions/runs/18761760342/job/53532313733?pr=5336

Which is failing due to missing API keys.
image

@taniandjerry
Copy link
Contributor

Rerunning the test for you! @blackgirlbytes explained to me before to rerun the test in my own open PR for a docs site update, so hopefully it works here too :)

@The-Best-Codes
Copy link
Collaborator Author

@taniandjerry thanks! The test was failing because some API keys were missing, do you know if that got fixed? Otherwise it will fail again!

@taniandjerry
Copy link
Contributor

This one is ready for review! @DOsinga @alexhancock @michaelneale @zanesq @jamadeo @angelahning (for the team's reference - I tag you all so that one of you can choose to work on this! We need a group tag for you maybe 💯 )

@zanesq
Copy link
Collaborator

zanesq commented Oct 28, 2025

Verified working locally and including newlines

@blackgirlbytes blackgirlbytes merged commit f1ad549 into block:main Oct 28, 2025
18 of 22 checks passed
michaelneale added a commit that referenced this pull request Oct 29, 2025
* main: (30 commits)
  feat: add goose powered ai culinary innovation studio prompt to library (#5423)
  removing golang/temporal building
  testing tetrate with sonnet (#5428)
  Add Recipes Test Script (#5420)
  Don't die on strange chars (#5415)
  fix: allow subagent to run in parent --no-session mode (#5384)
  docs: analyze tool (#5418)
  fix: gracefully close goosed listening port (#5321)
  move history txt to state dir (#5410)
  Dont exit silently when storing api key fails (#5260)
  Make reply use the API (#5389)
  Fix/icon ii (#5413)
  Enable runtime access to provider name (#5399)
  fix: ensure trailing newline in files created by `text_editor` tool (#5336)
  docs: September 2025 Community All-Stars (#5411)
  make supports_cache_control async to avoid block in place (#5362)
  Send all the logs we output (#5363)
  Recipe variables (#5365)
  Feat/add mermaid chart rendering (#5377)
  Set up Datadog metrics for prompt injection detection (#5385)
  ...
katzdave added a commit that referenced this pull request Nov 3, 2025
* 'main' of github.com:block/goose: (132 commits)
  Fix/icon ii (#5413)
  Enable runtime access to provider name (#5399)
  fix: ensure trailing newline in files created by `text_editor` tool (#5336)
  docs: September 2025 Community All-Stars (#5411)
  make supports_cache_control async to avoid block in place (#5362)
  Send all the logs we output (#5363)
  Recipe variables (#5365)
  Feat/add mermaid chart rendering (#5377)
  Set up Datadog metrics for prompt injection detection (#5385)
  fix: restore --resume functionality for most recent session (#5401)
  Gemini again (#5390)
  docs(prompt-library): add github-issue-labeler intermediate prompt (#5374)
  docs: add Linux and Windows paths to uninstall section (#5371)
  fix: --session-id shouldn't work without --resume, but --name should (#5360)
  Auto-compact Threshold UI improvements (#5354)
  Filter preserved user messages to be text only. (#5391)
  include sessionId in tool request (#5394)
  feat: add PR Impact Analyzer prompt (#5375)
  docs: add blog post on configuring goose for team environments (#5380)
  migrating back with new chatrecall non underscore name (#5223)
  ...
@The-Best-Codes The-Best-Codes deleted the best/editor-trailing-newline branch November 11, 2025 15:23
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest Issues awarding points for Hacktoberfest 2025! large Weight label for Hacktoberfest 2025 issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure Trailing Newline in Files Created by text_editor Tool

4 participants