mirror of
https://github.com/wavetermdev/waveterm
synced 2026-04-21 14:37:16 +00:00
`pkg/aiusechat/tools_readdir_test.go` was still asserting the old
`entries` payload shape after `read_dir` moved to returning typed
directory entries. This caused the `pkg/aiusechat` test failures even
though the tool behavior itself was already correct.
- **Align test expectations with current callback output**
- Update `TestReadDirCallback` to treat `entries` as
`[]fileutil.DirEntryOut`
- Assert directory/file classification via the `Dir` field instead of
map lookups
- **Fix truncation/sorting coverage**
- Update `TestReadDirSortBeforeTruncate` to validate the typed slice
returned by `readDirCallback`
- Preserve the existing intent of the test: directories should still be
sorted ahead of files before truncation
- **Keep scope limited to stale tests**
- No changes to `read_dir` implementation or output contract
- Only the broken test assumptions were corrected
```go
entries, ok := resultMap["entries"].([]fileutil.DirEntryOut)
if !ok {
t.Fatalf("entries is not a slice of DirEntryOut")
}
for _, entry := range entries {
if entry.Dir {
// directory assertions
}
}
```
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/wavetermdev/waveterm/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| aiutil | ||
| anthropic | ||
| chatstore | ||
| gemini | ||
| openai | ||
| openaichat | ||
| uctypes | ||
| toolapproval.go | ||
| tools.go | ||
| tools_builder.go | ||
| tools_readdir.go | ||
| tools_readdir_test.go | ||
| tools_readfile.go | ||
| tools_screenshot.go | ||
| tools_term.go | ||
| tools_tsunami.go | ||
| tools_web.go | ||
| tools_writefile.go | ||
| usechat-backend.go | ||
| usechat-mode.go | ||
| usechat-prompts.go | ||
| usechat-utils.go | ||
| usechat.go | ||
| usechat_mode_test.go | ||