Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 24, 2025

Local directories passed via -d flag were being unnecessarily downloaded to temp directories and deleted afterward, even when they were already on the local filesystem.

Changes

  • Path detection: Added isLocalPath() to identify local paths (file://, absolute, relative) vs remote protocols (git::, https://, s3::)
  • Download logic: Modified downloadRemoteDirectories() to use local paths in-place without downloading
  • Cleanup logic: Modified cleanupDownloadedDirectories() to skip deletion of local paths

Behavior

Before:

$ coding-context -d file:///path/to/rules test-task
# Downloads /path/to/rules to /tmp/..., uses it, then deletes it

After:

$ coding-context -d file:///path/to/rules test-task
# Uses /path/to/rules directly in-place

All three local path formats now skip download/cleanup:

  • file:///absolute/path
  • /absolute/path
  • ./relative/path

Remote protocols continue to download and cleanup as before.

Original prompt

When a search path is a local folder, do not download it or delete it. Just use it in place.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 24, 2025
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI changed the title [WIP] Update behavior for local folder search paths Skip download/cleanup for local search paths Dec 24, 2025
Copilot AI requested a review from alexec December 24, 2025 00:33
@alexec alexec marked this pull request as ready for review December 24, 2025 00:34
Copilot AI review requested due to automatic review settings December 24, 2025 00:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the handling of local directories by preventing unnecessary download and cleanup operations. Instead of copying local directories to temporary locations and deleting them afterward, the tool now uses them directly in-place.

Key Changes

  • Added path detection logic to distinguish between local paths (file://, absolute, relative) and remote protocols (git::, https://, s3::)
  • Modified download and cleanup operations to skip local paths while maintaining existing behavior for remote resources
  • Added comprehensive unit and integration tests for the new path handling logic

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/codingcontext/context.go Implements isLocalPath() and normalizeLocalPath() helper functions; updates downloadRemoteDirectories() and cleanupDownloadedDirectories() to handle local paths in-place
pkg/codingcontext/context_test.go Adds table-driven unit tests for isLocalPath() and normalizeLocalPath() covering various path formats
integration_test.go Adds end-to-end tests verifying local directories are not deleted after command execution for both file:// protocol and absolute path formats

@alexec alexec merged commit 34747c0 into main Dec 24, 2025
7 checks passed
@alexec alexec deleted the copilot/do-not-download-local-folder branch December 24, 2025 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants