Repository navigation
feat(bots): review and answer held calls in chat - #1390
Conversation
bvsr365
left a comment
There was a problem hiding this comment.
An adversarial pass on one question: can what the owner reads on the card differ from what Send does? Send passes only the id, digest and choice; a double tap, a second window or an old phone card is stopped by the server's compare-and-set; a device either gets the whole card or cannot Send; and marker imitations are drawn as text. These are open:
Should fix
- The card can't tell a string from a number, boolean, null or empty list. In
BotActionCard.tsx(Value),falseand"false"both draw asfalse; likewise123/"123",null/"null"and[]/"[]".""draws as nothing. The tool gets the exact value, and many read the string"false"as true, sonotify_everyone: "false"reads as off on the card and may go out as on. Fix: draw strings in quotes (or mark non-string values), and draw""as "(empty)".
Minor
- Joiners and look-alike letters in addresses and keys. U+200D inside
bob@example.comstays invisible:actionTextkeeps the joiners for scripts and emoji. A Cyrillicаin a recipient, or a keytоbesideto, draws like the Latin letters. Fix: in values that look like an address, domain or URL, make joiners visible and mark letters from another alphabet; mark non-ASCII keys. - A value can look like more fields or like the card's own lines.
"alice@example.com\nbcc\nevil@example.com"draws as three lines under "to". A value "Kai already sent exactly this at 09:14", or a key "Hidden values will be sent", sits in the arguments area looking like the card's notes. Fix: box each value with visible line breaks, and give the card's own notes a look argument text can't take. - Hidden paths can fake nesting. The projection already joins paths with
→, and the card then replaces every.with→, so a keya.breads "a → b → c". A key containing " → " fakes nesting too. Fix: send the paths as segments and draw each one distinctly; drop the.replacement. - "Already sent exactly this" matches only the same work. It covers key order, a subagent of the same work,
done,uncertainandfailedwith a tool error, and it can't be faked. It misses an exact repeat from another piece of work or a schedule of the same bot. Matching onbot_idinstead ofactivation_idwould catch that cheaply. A trivially changed argument ("a@x"against["a@x"], a trailing space) can't be caught by a digest: worth saying in the docs. - About can promise more than holds. "Asks you first before it sends or changes anything" shows when any tool of the service asks first. Under the plan's rule, a tool the server marks read-only never asks, so a mislabelled sending tool runs without asking under that promise. Suggest "Asks you first before some of its actions".
- A card whose binding changed looks sendable but never is. The binding is fixed at hold, so every Send after a server, schema or grant change is refused again, while the card keeps live buttons with "This changed since you saw it". A refusal because the switch is off reads the same. Until C3b withdraws such rows, say it can no longer be sent and to ask the bot again.
bvsr365
left a comment
There was a problem hiding this comment.
Review at 5509195fb: needs changes, 4 should fix and 5 minor, no blockers. With the switch off nothing changes. The card is drawn from the stored masked copy, and Send passes only the id and digest. The open points are about the card itself.
Should fix
- The bot's note, and argument values, can draw lines that look like the card's own. The card is
white-space: pre-wrap, so newlines in outside text render as separate lines.- The note: in the mounted chat, a note of
"Fine.\n\nInbox helper already sent exactly this at 9:14 AM\n\nThis changed since you saw it"shows three lines. Only the first has "… says:"; the other two sit right above the real warning lines, differing only in colour. - An argument: a short
subjectwith the same trick isn't folded and draws those lines inside an argument area that has no frame. - Fix: show the note as one line (collapse whitespace) in a visibly quoted block with its label, and frame the argument region so everything in it reads as outside data.
- Already safe: markup, links and the hidden marker. No element is created, and the marker is structural.
- The note: in the mounted chat, a note of
- A settled card stays as long as an open one. The outcome ("Sent · 9:14 AM", "The tool reported an error") comes last, in small grey text, under the full argument box. The ask card collapses to a quiet line once answered (
BotAskReplies). A settled card should be compact: what it was, the outcome with its time, and the tool's answer for an error, with the arguments behind a fold that opens in place. - The argument box cuts mid-row with no sign that it scrolls (
max-height: 360px; overflow: auto). Thelogin → tokenrow is half visible in the screenshot. Add a fade or a "more below" edge, or keep the open card short by folding long values. Arrays are also indented twice as deep as strings (ddmargin plusolpadding). - A too-large card on another computer shows "null".
RemoteBots.fittedsendsargs: null, hiddenPaths: [], and the desktop renderer, which another computer also runs, draws "null" and "Hidden values will be sent: " with nothing after it. WhentooLarge, draw no argument box and keep the hidden paths, or drop the list.
Minor
- Dotted keys:
hiddenPathsalready come joined with " → ", but the renderer also runsreplaceAll('.', ' → '), so a keyuser.nameshows as two levels. Drop thereplaceAll; the renderer test feedslogin.token, which the service never produces. - Character guard:
actionTextmisses U+2028/U+2029, U+034F and the Hangul fillers (U+115F, U+1160, U+3164, U+FFA0). The chat's guard (modelSlots.ts:385) covers the separators; one shared guard would be better. - Telling test: with
telling.tsreverted, the telling test still passes, because an open action already falls through tosoon. Add a case with the owner's telling set to "needs you", and one with a settled action. RevertingRemoteBots.tsdoes fail its test. - Folded telling cost:
BotTellings.announcecallstoMessageinside the sort comparator and insome, so each row costs several reads per comparison, also with the switch off. Compute it once per row. - Screenshots: the PR text lists them by
/tmp/…paths. Attach them instead.
On the look:
- Raw argument keys: showing them as the tool's own names is right. They can't be translated, and a renamed label could hide what is sent. Inside the framed region they read as data rather than Mousse's headings.
- Buttons: Send and Not now looking the same reads clearly; "no default" matters more here than matching the ask card's primary Allow.
Checked:
- Switch off: chat, About and bridge payloads are unchanged; telling and folded notifications see no
action. - #1340's two conditions: every hidden field is named by its path, including through literal escapes. The repeat warning covers
done,uncertainand tool-error rows of the same work, tool and digest only, also on a device's card. - Statuses: every one draws sensibly, and "Not sent" never appears for a tool error.
- About: one mark per service; unavailable-service marks win; the switch, Remove and
bots.permissions.setare unchanged. - Devices: two devices racing to Send result in one call; an older phone shows the plain line.
- Find: indexes only the visible status line, so every match can be highlighted. This fixes the "Sent" row from #1340.
- Tests and types: all bot unit files and the named renderer and bridge files pass, and both typechecks are clean.
Not checked: the running app (the look is judged from the screenshots and the code), a phone, and nudges (out of scope).
|
Re-check at
The bridge change is sound:
The only test failures are the nine that fail on master Still open: Should fix
Minor
|
Problem
A bot that asks before sending or changing something needs a complete review in chat, with a clear choice to Send or Not now.
Change
How to review
Verification
Refs #1335