The 59c44e9 fallback replied every coalesced delta (~0.8s) as a separate
proactive message once the callback req_id went stale - a wall of
repeating snapshots. Now: intermediate deltas are dropped after a single
'long reply, result will follow' notice; only the final text goes out.
Turns that outlive the WeCom callback req_id window (e.g. approval
round-trips >5min) had their delta/finish frames silently rejected by
the gateway, so the user saw 'clicked approve, nothing happened' while
the agent kept working. Track req_id recv time; past a 240s TTL, stream
updates fall back to proactive aibot_send_msg. Also log non-zero
errcode ack frames so future gateway rejections are visible.
test_channels_e2e / test_relay_no_stack / test_session_manager drive prompt()
with agents that lack cwd_whitelist, so the ~/agenthub-media fallback created
directories in the real home directory on every run.
cwd_whitelist entries are fnmatch patterns (`~/workspace/*`), but
_agent_cwd() only ran expanduser() on the first entry, so media_in/ and the
outbound media sentinel used a literal `*` directory
(`~/workspace/*/media_in`). _glob_root() now strips the glob segment.
Also covers sending files prematurely: sentinel scan of the literal dir
never saw agent output.
- inbound: wecom file/video frames download+decrypt into InboundMessage.files
- session: store non-image attachments under media_in/, reference path in prompt
- outbound: workspace sentinel diffs agent cwd after each turn; new files emit
media events; wecom uploads via 3-step aibot upload protocol (init/chunk/finish)
- >20MB or unsupported channels fall back to text with the server path
_attach_update_relay ran on every prompt but notification handlers
APPEND on the shared ACPClient, so the Nth turn registered N handlers
and every agent_message_chunk was appended N times into _deltas —
the final text came out interleaved and N-times repeated. Guard
registration by _relay_session tag; regression test included.
- single dispatch-all event sink (per-channel sinks previously overwrote each other)
- channels.wecom.approval_chat config: interaction events are additionally
delivered to that wecom chat with routed_from stamp; SessionManager.set_route
stamps the pending permission route_key so the approval chat can answer with
numbered/name/re r replies (pending_interaction + permission_reply accept
either the originating key or the route key)
- origin == approval chat is not duplicated; no config = previous behavior
- tests: tests/test_approval_route.py (7 cases)
- config doc moves to agenthub.db table 'config' (single JSON doc, id=1);
config.json is first-run seed only; same db as bindings/records
- AdminStore: sqlite doc store (thread-locked, persists across restarts)
- full CRUD per entity: list/get/upsert/delete for channels + agents,
bind/unbind for bindings; upsert merges blank secret fields (edit form
can leave them empty); last-agent delete guard; unknown-field 400s
- secrets masked at list/get time (yb…[REDACTED]); plaintext never
crosses the API
- Ops tab rebuilt: list tables w/ per-row edit+delete buttons, +新增
forms, delete confirm() dialogs, live binding table w/ unbind
Static HTML served by StatusHTTP (stdlib only, no build step): service
health pills, channel connection states, agent processes, live bindings
table; fetches existing /status + /sessions JSON, 10s auto-refresh.
AgentSpec.default_model was declared but never consumed; the agent's
built-in default rotated (fledge-alpha-free -> exo-free) and several
free upstreams go dark ('Endpoint is unavailable'). After session/new,
set the configured model via session/set_config_option; failure is
non-fatal (warn + continue with agent default). Adds 4 tests (75 total).
Keepalive (fixes 19h silent WS death on 2026-10-07):
- recv() raises on dead reader / stale inbound (no pong) instead of
returning None forever -> outer loop reconnects
- heartbeat closes socket after 2 missed pongs
- reconnect default unlimited (0), backoff cap 60s; auth still terminal
- connection_state surfaced (idle/connecting/connected/failed)
Approval hardening:
- unpresented approval can never be answered (race guard)
- timeout notifies the user ("已自动拒绝")
- stale pending permissions reaped; created_at tracked
Tests: 69 passed (9 new regressions in test_keepalive_approvals.py)
- recv(): connection EOF now raises instead of returning None — the channel
outer loop treats it as disconnect and runs backoff reconnect
- close(): best-effort with timeouts, no hang when loop already dead
- tests: fake aibot gateway (subscribe/reply/heartbeat), auth-failure path
45 passed