Commit Graph
4 Commits
Author SHA1 Message Date
gabby fc0beb5798 simplex: mark the reported message read so next_message advances
The bridge only read the daemon's unread state (/_get chats, /_get chat);
nothing wrote the read state, so a persistent-unread message was re-reported
on every call and simplex.next_message never advanced.

v7.0.3 does expose /_read chat @<id> and /_read chat items @<id> <ids>
(the earlier "v7 has no mark-read command" note was wrong). Added:

- SimplexDaemon.mark_read / request_mark_read plus read_command /
  parse_read_response; parse_direct_text_item now carries item_id.
- SimpleX bridge POST /read {"contact","item_ids"} marks exactly the listed
  items read on the bridge's own daemon, reporting ok/error honestly.
- The live inbox entry keeps item_id so /inbox/next hands back the
  consumable id.
- simplex.next_message consumes exactly the item it reported (a failed
  consume is surfaced as an honest note, never a fabricated read failure).

Precise per-item reading leaves the rest of the chat unread.
2026-10-09 11:16:21 +00:00
gabby dff4849947 simplex: honest forwarding — verify sends, disambiguate contacts, read persistent unread
The SimpleX forwarding path could report a failed send as success and could
route to the wrong peer:

- contact_entry dropped the daemon's unique localDisplayName, so two peers
  sharing a profile name ("pepper" / "pepper_1") were indistinguishable; the
  agent's SemIf choice then picked the stale one.
- The bridge's POST /send enqueued the message fire-and-forget and returned
  ok:true; the daemon later marked it sndError (auth), yet the agent reported
  "sent" and assessed success.
- next_message read only the live buffer, missing messages that arrived before
  the bridge started.

Fixes:
- simplex_ws: contact_entry exposes local_name + connected/auth_errors;
  parse_chat_item surfaces the agentError; parse_send_response normalizes a
  /_send reply; add correlated send()/request_send().
- bridges/simplex: resolve disambiguates by id -> local_name/display_name and
  prefers the healthiest peer; send() confirms the real terminal status
  (sndSent/sndRcvd ok, sndError with reason) instead of a false ok; /unread
  carries cached connection health; catalog documents the new fields/status.
- bridges/inbox: carry local_name/connected/auth_errors through the cache.
- seeds/simplex/next_message: fall back to /unread + /history and prefer the
  healthy conversation.
- tests: updated shapes + new coverage for resolution and send verification.
2026-10-07 09:47:26 +00:00
Denton Social 4a4fe850e0 bridges: refresh SimpleX contact list from the daemon
The bridge only learned contacts from observed inbound senders, so /send
could not address a contact it had never received from. Query /_contacts
<userId> (active user from /user, cached) over the existing corrId->Future
path, merge into the inbox on (re)connect via an on_connected hook and on
demand (GET /contacts, send-resolution miss). Best-effort: a disconnected
daemon keeps the cached set.
2026-09-30 11:39:28 -05:00
Denton Social ddc5cb66c8 bridges: standalone third-party API bridges; isolate the command gateway
Split messaging UX (invite links, read, send) out of the command gateway into a
new `semif_agent.bridges` layer. Each bridge is its own process (`cli bridge`)
against its own service daemon/profile; the SimpleX bridge owns a second
simplex-chat daemon and buffers every inbound DM, so a message sent to the
connect-link address shows up in `simplex.next_message`.

- new: bridges/{base,inbox,registry,simplex}.py + neutral semif_agent/simplex_ws.py
- gateway: delete bridge.py; drop address/observer/pull-mode from the command path
- codegen: inject the bridge catalog (describe_bridges) into body + elicitation prompts
- seeds: repoint simplex.next_message/connect_link to top-level `simplex_bridge_url`
- config/bootstrap: new top-level `bridges` block + `simplex_bridge_url`; render
  semif-simplex-forward + semif-bridge units; gateway config loses bridge/inbox
- docs: AGENTS.md gateway isolation is non-negotiable
2026-09-28 15:24:44 -05:00