Keep Telegram streaming overflow messages tied to the primary live message, reuse them across edits, and delete stale overflow replies when streamed content shrinks.
Mirrors Claude Code's /btw: ask the agent a quick question without
interrupting the in-flight main task.
- frontends/btw_cmd.py: snapshot backend.history under lock + deepcopy →
background-thread backend.raw_ask single-turn answer; never writes
backend.history; never touches task_queue. Reuses backend.raw_ask +
make_messages, no new LLM instance.
- frontends/chatapp_common.py: register /btw in HELP_COMMANDS; handle
/btw in AgentChatMixin (sync via asyncio.to_thread); install() at
module bottom so the slash hook is wired for any frontend that
imports chatapp_common.
- frontends/stapp.py: persist display_queue + partial_response in
st.session_state so the streaming bubble survives Streamlit reruns;
new render_main_stream() helper covers both new tasks and resume;
/btw branch uses plain st.rerun() (preserves dq) so the main task's
remaining output renders in a follow-up bubble; non-/btw prompts
explicitly call agent.abort() to keep the original "submit cancels"
UX. Strip <summary> meta tags from text segments and drop dangling
"LLM Running (Turn N) ..." markers in resumed partials to clean up
the rendered chat.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous implementation called send_typing once with an empty
typing_ticket, which had no effect. The iLink API requires a valid
typing_ticket obtained from getconfig first.
Changes:
- Add get_typing_ticket() method to fetch ticket via getconfig API
- Replace single send_typing call with continuous typing loop
- Typing refreshes every 2 seconds until agent finishes processing
- Stops cleanly via threading.Event when message handling completes
Co-authored-by: succ985 <succ985@users.noreply.github.com>
Replace fixed 5s sleep with the same backoff pattern already used in
dcapp.py: 5 -> 10 -> 20 -> ... -> 300s, resetting to 5s when a session
survived >=60s. Uses time.monotonic() to avoid clock-jump skew.
Switch to inc_out=True mode so queue items are incremental deltas
instead of cumulative text. The old cumulative approach broke when
agentmain's post-processing (</summary>\n\n insertion) shifted offsets,
causing the bridge's delta calculation to produce overlapping or
truncated content.
Now "next" items are forwarded directly, and "done" is only used as
content when no streaming occurred (error fallback).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(wecom): upgrade wecom bot from text-only to full media + progress streaming
- Add image/file message handling with encrypted media download
- Add media upload & send (auto image/file type detection, fallback to text on failure)
- Add real-time per-turn progress streaming via _turn_end_hooks
- Add send_done with automatic file attachment extraction from agent replies
- Add terminal CLI: help/status/stop/exit for runtime control
- Add run stats tracking (received/completed counts)
- Refactor message parsing into shared _accept() method (dedup + auth + register)
- Harden None-safety on body.get(from) and dedup ID fallback
- Move state from module globals to instance attributes
* refactor(wecomapp): parameterize agent & client, remove dead code
- Remove module-level agent creation; inject via constructor
- Make WSClient injectable in start() for testability
- Clean up stale comments and version tag
- Add inline doc for split_limit