Skip to content

Conversation

@xiaoju111a
Copy link
Contributor

Related Issue

Fixes #621

Description

Auto-resolve relative paths in WriteFile tool to improve user experience.

Problem: When LLM passes a relative path like test.py to WriteFile, it returns "Invalid path" error, requiring LLM to retry with absolute path. This creates unnecessary friction in the user experience.

Solution: Instead of returning an error, automatically resolve relative paths to the working directory.

Changes:

  • src/kimi_cli/tools/file/write.py: Replace error with auto-resolution
  • tests/test_write_file.py: Update test to verify new behavior

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

- Remove error for relative paths, auto-resolve to working directory
- Update test to verify new behavior
- Improves UX by avoiding 'Invalid path' errors on first attempt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant