zot/internal/agent
patriceckhart 625c2382b7 feat(telegram): mirror tui prompts into telegram thread
When the telegram bridge is connected, messages you type in the
zot tui now also appear in the paired chat so the telegram
transcript stays a complete record of the session. Format:

  you: <what you typed>         <- from tui editor, grey bubble
  zot: <assistant reply>        <- reply to a tui prompt
  <your telegram dm>            <- your own blue bubble
  <assistant reply, bare>       <- reply to a telegram dm, no prefix

The "zot: " prefix is only attached when the turn was initiated
from the tui side. Telegram-initiated turns reply bare so the
thread reads as a normal back-and-forth with the bot; the "you: "
bubble from the tui side would otherwise pair awkwardly with a
DM-initiated bare reply.

Implementation is small:

  bridge.go
    - OnUserTyped(text): sends with "you: " prefix. Called from
      the interactive submit path when the bridge is active.
    - OnAssistantText(text): sends with "zot: " prefix by
      default, or bare when nextReplyFromTelegram is set.
    - nextReplyFromTelegram is flipped to true inside
      handleUpdate right before calling Host.SubmitOrQueue, and
      back to false when the reply is flushed. One-slot flag,
      safe against the actual serial turn drain the agent uses.
    - On Start(), if Config.AllowedUserID is already known from
      a previous session, prepopulate chatID so the bridge can
      send immediately without waiting for a handshake DM
      (private-chat id == user id on telegram).
    - sendToPaired consolidates the chunk-and-send plumbing so
      OnUserTyped, OnAssistantText, and future tap points share
      one path.

  interactive.go
    - The editor submit path now calls telegramBridge.OnUserTyped
      on a goroutine (network write off the event loop) before
      queuing or starting the turn. No-op when the bridge is
      stopped or no chat is paired.

No user-visible setup change: /telegram connect / disconnect /
status work the same; the two-way mirror is automatic once
connected.
2026-04-20 09:33:03 +02:00
..
extensions feat(ext): phase 4 - full-event interception, arg rewrites, /reload-ext 2026-04-19 17:02:04 +02:00
modes feat(telegram): mirror tui prompts into telegram thread 2026-04-20 09:33:03 +02:00
tools feat(tui,bash): shell-log style bash results 2026-04-20 09:03:24 +02:00
args.go fix(no-yolo): don't auto-refuse tool calls in non-interactive modes 2026-04-19 19:17:05 +02:00
botcmd.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_unix.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_windows.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
build.go rename: /lock -> /jail, /unlock -> /unjail 2026-04-20 08:57:40 +02:00
changelog.go feat(tui): show github release notes once after upgrading 2026-04-19 16:12:13 +02:00
cli.go fix(cli): load extensions in print and json modes too 2026-04-19 20:00:36 +02:00
config.go feat(tui): show github release notes once after upgrading 2026-04-19 16:12:13 +02:00
extcmd.go feat: extension system (subprocess + json-rpc, any language) 2026-04-19 14:09:43 +02:00
modelsync.go initial commit 2026-04-17 20:36:38 +02:00
rpc.go fix(no-yolo): don't auto-refuse tool calls in non-interactive modes 2026-04-19 19:17:05 +02:00
systemprompt.go feat(auth,tui): dark login pages + /logout picker 2026-04-19 20:14:22 +02:00
update.go tui: show 'update available' banner at top of chat 2026-04-18 11:49:22 +02:00