Repository navigation
Replies: 1 comment
|
Good question, and I went with a split answer. It's on main now and ships in v0.13.0 (#2082). Text that tuios types to an agent gets cleaned: One thing I found on the way: the existing Thanks for raising it right after the task sheet fix, it was the obvious next gap. |
Uh oh!
There was an error while loading. Please reload this page.
A design question left over from #1906, not a bug report.
ask-agenttypes its text into an agent's pane with no person and no composer in between. Its text goes throughpromptBody(internal/session/prompt_submit.go:227), which normalizes line ends and runsvt.SanitizePaste: control characters and ESC are dropped, so no paste bracket can be rebuilt. Invisible characters (a zero-width space, the tag block U+E0020 to U+E007F, bidi overrides) pass through.Elsewhere the same text is treated as worth cleaning: the composer removes such characters and asks the person to read the message again (
composer.Submit), the New agent sheet does since #1906, and what tuios prints from another program goes throughinvisible.Strip(plainTextincmd/tuios/agent_commands.go).Where it shows: the conductor recipe (
skills/tuios/recipes.md:355-356) reads a card's prompt withtask get --jsonand passes it toask-agent.--jsonreturns the prompt as stored, so a card that holds invisible characters (see #2035 for one way they get in) reaches the agent with them, while the board and plaintask getshow a clean line.Options I can see:
promptBodyalso callsinvisible.Strip. Simple, and it covers every caller ofsubmitPrompt:ask-agent,send-text, the replyrespondtypes, andrun's command. The cost: text that holds such a character on purpose loses it. Strip keeps a zero-width joiner between two emoji, but it drops the emoji variation selector (U+FE0F) and bidi marks in right-to-left text.ask-agentrefuses a text that holds them, with an error naming the count, and a flag to send it anyway. Nothing is changed silently, and a script sees the refusal.ask-agentas it is (it is a programmatic verb and sends what it is given) and fix the entry points instead, as fix(app): check the New agent sheet's task for invisible characters #1906 did for the New agent sheet and fix(app): check the New task sheet's draft for invisible characters #2075 does for the New task sheet.I lean to 2 or 3, since a verb that silently edits its argument is hard to script against, but it is your design. If you pick one I can send it as a PR with a test.
G&J
All reactions