Skip to content

fix(plantask): normalize listed file paths#1135

Open
claneo wants to merge 1 commit into
cloudwego:mainfrom
claneo:fix-plantask-normalize-paths
Open

fix(plantask): normalize listed file paths#1135
claneo wants to merge 1 commit into
cloudwego:mainfrom
claneo:fix-plantask-normalize-paths

Conversation

@claneo

@claneo claneo commented Jul 7, 2026

Copy link
Copy Markdown

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

修复 plantask 读取列表文件路径时的归一化处理

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:

This PR normalizes paths returned by Backend.LsInfo before plantask calls Backend.Read.

filesystem.FileInfo.Path may be a filename, relative path, or absolute path. Some filesystem backends, including the in-memory backend and the local backend in eino-ext, return filenames from LsInfo. plantask previously passed those values directly to Read, which could read from the process working directory instead of the configured task BaseDir.

This change follows the existing pattern used by adk/middlewares/skill/filesystem_backend.go: if the listed path is not absolute, join it with the configured base directory before reading.

Added regression tests for TaskCreate and TaskList with a backend whose LsInfo returns basenames.

zh(optional):

本 PR 在 plantask 调用 Backend.Read 前,对 Backend.LsInfo 返回的路径进行归一化处理。

filesystem.FileInfo.Path 可以是文件名、相对路径或绝对路径。部分 backend(包括 in-memory backend 和 eino-ext 中的 local backend)会在 LsInfo 中返回文件名。此前 plantask 会直接把该值传给 Read,可能导致从进程当前工作目录读取,而不是从配置的任务 BaseDir 读取。

本改动对齐 adk/middlewares/skill/filesystem_backend.go 中的已有处理方式:如果列表返回路径不是绝对路径,则先与配置的 base directory 拼接后再读取。

同时补充了 TaskCreateTaskListLsInfo 返回 basename 时的回归测试。

(Optional) Which issue(s) this PR fixes:

Related to cloudwego/eino-ext#908

(optional) The PR that updates user documentation:

N/A

@CLAassistant

CLAassistant commented Jul 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants