Skip to content

Conversation

@tsmithsz
Copy link
Contributor

Problem

Need to add validate method to be used by the chatController

Solution

Add validate method to fsRead tool

Testing

 FsRead Tool
extensionHostProcess.js:178
    ✔ throws if path is empty
extensionHostProcess.js:178
    ✔ reads entire file
extensionHostProcess.js:178
    ✔ reads partial lines of a file
extensionHostProcess.js:178
    ✔ lists directory contents up to depth = 1
extensionHostProcess.js:178
    ✔ throws error if path does not exist
extensionHostProcess.js:178
    ✔ throws error if content exceeds 30KB
extensionHostProcess.js:178
    ✔ invalid line range
extensionHostProcess.js:178
    ✔ expands ~ path
extensionHostProcess.js:178
    ✔ resolves relative path
extensionHostProcess.js:178
  9 passing (64ms)

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tsmithsz tsmithsz requested review from a team as code owners March 24, 2025 22:03
@github-actions
Copy link

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@tsmithsz tsmithsz force-pushed the feature/agentic-chat branch from 14ddc50 to ffd9d7c Compare March 24, 2025 22:18
@mr-lee mr-lee merged commit 3fb3d0b into aws:feature/agentic-chat Mar 24, 2025
17 checks passed
}
}

export function sanitizePath(inputPath: string): string {
Copy link
Contributor

@justinmk3 justinmk3 Mar 28, 2025

Choose a reason for hiding this comment

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

DId you look at the existing fs utils here? normalize(), resolvePath():

export function normalize(p: string): string {

Copy link
Contributor

Choose a reason for hiding this comment

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

There is also sanitizeFilename.

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.

5 participants