fix: support empty string literals in textfx #63

Merged
Passthem merged 3 commits from pi-agent/konabot:fix/textfx-empty-string into master 2026-03-18 19:41:35 +08:00
3 changed files with 24 additions and 6 deletions
Showing only changes of commit 717b7a95e8 - Show all commits

View File

@ -13,10 +13,9 @@ class THEcho(TextHandler):
async def handle(
self, env: TextHandlerEnvironment, istream: str | None, args: list[str]
) -> TextHandleResult:
if len(args) == 0 and istream is None:
# echo 不读 stdin只输出参数Unix 语义)
if len(args) == 0:
return TextHandleResult(1, "请在 echo 后面添加需要输出的文本")
if istream is not None:
return TextHandleResult(0, "\n".join([istream] + args))
return TextHandleResult(0, "\n".join(args))