Files
tai/taicpp
retoorandClaude Sonnet 5.5 1611f3baeb whatsapp: fix link/login 401, add image send, contact sync and search; harden failover
Root causes, each reproduced against the live server or endpoint:
- Server-only JIDs decoded as "@s.whatsapp.net" and pairing replies copied them
  into `to`, so the device was never registered and every login returned 401.
  Decoder/encoder fixed, replies use s.whatsapp.net, ADV hosted prefixes follow
  whatsmeow. The link wizard now waits for the restart, logs in, uploads prekeys
  and retries once with a fresh device on 401/403.
- Closed sockets made every receive loop spin until its deadline (the 7 minute
  CPU burn). Loops stop on a closed stream.
- whatsapp_send had no image argument and send_image was a stub. Added WaMedia
  (byte-exact against 8 wa-go golden vectors), media_conn upload, image send and
  the DeviceSentMessage copy for the user's other devices.
- Phone contacts never reached the client: added app-state sync (WaAppState,
  WaReceiver, LTHash and MAC checks verified against a whatsmeow-built oracle)
  and the historySyncConfig declaration at registration.
- Contact lookup: FTS5 trigram plus fuzzy ranking, ambiguity is reported and
  never guessed, global search lists contacts. Send caps (10/min, 200/day) are
  enforced and survive unlink.

Failover and agent:
- Every failed backend candidate is printed the moment it fails.
- muse runs with low reasoning effort, an empty preset and one stable workspace
  (36.5s down to 2.8s on the real prompt); Ctrl-C no longer counts as a backend
  failure; CLI backends use the circuit breaker; opencode runs are capped at 30s.
- Orphan tool results are dropped before sending (devplace HTTP 400, reproduced);
  compaction no longer starts its window on a tool result.
- Terminal art pasted as a prompt is refused before any model call.

Tests: whatsapp_test, muse_flags_test, llm_history_test; full suite 40 steps
(agent.e2e reads live tmux panes and is flaky, green on re-run).
Research archived under research/whatsapp-automation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 21:32:38 +01:00
..
2026-10-24 06:40:09 +02:00
2026-10-24 07:27:06 +02:00
2026-10-24 06:43:45 +02:00
2026-10-25 19:25:54 +01:00

detz: C++23 port of tai.py

Future molo detz subcommand. See plan.md, SPEC.md, docs/. Build: make && make test. Binary: build/detz. Rules for working here: AGENTS.md.

What taicpp adds on top of the port

The port is behavior-compatible with ../tai.py and checked against it (PARITY.md, docs/parity.md). These parts exist only here; each has a specification and tests:

Feature Spec Code Tests
Fuzzy matching of identifiers (letter order, word boundaries, typos, trigrams) docs/fuzzy.md src/util/fuzzy.* build/fuzzy_test
CAP agents and their models: discovery, probes, @agent, @agent:model, @model docs/cap-agents.md src/cap/cap_model_catalog.*, src/cap/cap_mention.* build/capmcp/cap_model_catalog_test
Sub agents in live panels on the multiplexer screen, with supervision docs/orchestration.md src/orch/, src/mplex/mplex_vpane.* build/orch_test, tests/orch_mplex_e2e.py

Reading order for a new contributor: docs/cap.md (the protocol), docs/cap-agents.md (agents and models), docs/fuzzy.md (how a mention is matched), docs/mplex.md and docs/orchestration.md (the screen).

Using it

@claude refactor the parser           run one turn on a CAP agent (typos are fine: @clde)
@claude:opus review the diff          on a specific model of that agent
@opus review the diff                 a model name alone works when one agent offers it
@claude                               pin the agent for following messages;  @auto clears all pins

Sub agents (fork workers and agent turns) appear in panels on the right of the multiplexer screen while they work; closing a panel cancels its agent. TAI_ORCH_PANELS=0 turns the panels off.

Tests

make test builds every test binary and runs tests/run_all.py (36 steps, logs in build/test-logs/). Single steps: python3 tests/run_all.py --only orch, --only mplex, --only capmcp, --only fuzzy. The research behind the decisions is in ../research/ (index: ../research/INDEX.md).