]> git.giacomolli.uk - onechat/commit
Find WhatsApp contacts and groups
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Sun, 8 Nov 2026 15:09:02 +0000 (12:09 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Sun, 8 Nov 2026 15:09:02 +0000 (12:09 -0300)
commit38a9b0502a1ccefc6ccb3472c4a21805b222caa6
tree54256bf3e5bc38b0a15a2f53764881f89b5421ff
parent0da1ef837bbd190cc5787214187d1b29d62b9410
Find WhatsApp contacts and groups

The agent gets the tool whatsapp_find, which gives the contacts and
groups of the user whose name holds a text, with no regard to case and
accents, as lines "ID | name | contact or group", at most 20 and the
number of the others. The send tool of the next step takes these IDs.

The contacts come from the session database of the library, with the
full, first, business, and push names, and with no copy. The groups come
from WhatsApp and stay in memory for one hour; the batches use the same
names. When the groups cannot be read and none are known, the answer
says so. Before the names arrive from the phone, the tool says that they
are not ready, and without a link it tells the agent to ask the user to
run /whatsapp pair PHONE.

Only the root agent has the tool: the toolbox of a subagent has no
WhatsApp, so it is an unknown tool there. The new tool changes the tool
list, so the prompt cache misses once. The match uses golang.org/x/text,
which the library needs already, so the vendor hash changes only for its
packages.

Issue: 6f69ca1
13 files changed:
README.rst
daemon.go
daemon_start_helper_test.go
go.mod
nix/package.nix
prompt.go
prompt_test.go
subagent_run_test.go
tools.go
turn.go
turn_test.go
whatsapp.go
whatsapp_test.go