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 — fix(core): normalize file paths in read tool output by scarf005 · Pull Request #7015 · anomalyco/opencode

Conversation

@scarf005

@scarf005 scarf005 commented Jan 6, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Closes #12394

Summary

  • Show clean relative paths for files inside the worktree
  • Show absolute paths for files outside the worktree instead of ugly ../../../../../../ paths

Changes

Modified the read tool to check if a file is within the worktree before deciding how to display the path:

  • Inside worktree: Show relative path (e.g., src/tool/read.ts)
  • Outside worktree: Show absolute path (e.g., /home/user/other/file.ts)

This improves UX by avoiding confusing paths like read ../../../../../../home/scarf/foo/bar/baz.ts.

Testing

Verified that lsp_diagnostics passes on the modified file.

Sorry, something went wrong.

Uh oh!

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

aspiers reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@github-actions

github-actions Bot commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Duplicate PR Search Results

Good news! I found no duplicate PRs addressing the same issue.

The searches returned several related PRs dealing with file paths and permissions, but these are addressing different concerns:

  • PR fix(windows): better support MSYS/Git Bash path handling #6082 - fix(windows): better support MSYS/Git Bash path handling - Focuses on Windows-specific path handling, not the same issue
  • PR Improve permission request messages; add external directory check for write tool #6714 - Improve permission request messages; add external directory check for write tool - Related to permissions and external directories, not path normalization
  • PR feat: add granular external_directory permission configuration #5905, feat: glob pattern-based external_directory permission #5841, feat: allow writes to /tmp by default without permission prompt #5388 - These focus on external directory permissions, not output formatting

PR #7015 appears to be unique in addressing the specific issue of normalizing file paths in read tool output to show clean relative paths for files inside the worktree and absolute paths for files outside it.

All reactions

Sorry, something went wrong.

Uh oh!

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

@aspiers

aspiers commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Great idea, this is a big improvement! 👍🏼

All reactions

Sorry, something went wrong.

Uh oh!

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

@scarf005
scarf005 force-pushed the fix/normalize-read-tool-path branch from d716ddc to 650077c Compare January 20, 2026 00:13
@github-actions github-actions Bot added the needs:issue label Jan 20, 2026
@github-actions

github-actions Bot commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot mentioned this pull request Jan 22, 2026
fix(tui): preserve agent state after compaction #10101
Closed
@thdxr
thdxr force-pushed the dev branch from cbab81f to 2d3c7a0 Compare January 30, 2026 04:50
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 00637c0 to 71e0ba2 Compare January 30, 2026 14:32
@thdxr
thdxr force-pushed the dev branch 3 times, most recently from f1ae801 to 08fa7f7 Compare January 30, 2026 14:37
@scarf005
scarf005 force-pushed the fix/normalize-read-tool-path branch from 650077c to 0543b56 Compare February 6, 2026 01:59
@github-actions github-actions Bot removed the needs:issue label Feb 6, 2026
scarf005 added 2 commits February 16, 2026 02:15
@scarf005
fix(core): normalize file paths in read tool output
f2b067a
@scarf005
fix: add missing Filesystem import
88ba7ab
@scarf005
scarf005 force-pushed the fix/normalize-read-tool-path branch from d12eb21 to 88ba7ab Compare February 15, 2026 17:19
@github-actions github-actions Bot mentioned this pull request Mar 24, 2026
fix(write): only include written-file diagnostics in tool output #18894
Closed
3 of 6 tasks
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 2f2ed11 to 9f201d6 Compare April 16, 2026 21:55
@github-actions

github-actions Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

fix: normalize file paths in read tool output

Uh oh!

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

2 participants

@scarf005 @aspiers
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.