openbot
1a25790d4a
fix: route IM replies during pending permission to permission_reply (was leaking to agent queue)
2026-10-06 20:40:51 +08:00
openbot
0e4bcc5a1f
fix: server requests must not block reader thread; drop stale bindings on startup
2026-10-06 19:09:12 +08:00
openbot
e36f596255
feat: IM commands (/new /model /agents /switch /status), inbound ack, structured permission interactions
2026-10-06 17:46:53 +08:00
openbot
c16b643ed8
chore(scripts): add nginx /agents patch script (idempotent)
2026-10-06 16:17:21 +08:00
openbot
e22dc9c1ee
fix(wecom-ws): EOF raises ConnectionError to trigger reconnect; close() hardened
...
- 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
2026-10-06 16:15:54 +08:00
openbot
2bcdf946f7
feat(http): status http surface for nginx /agents reverse proxy
...
- http_admin.py: ThreadingHTTPServer on 127.0.0.1:30990
GET /agents/ /status /healthz /sessions; POST /agents/prompt (ops)
- runtime starts it from config.http
- verified locally: healthz + status return JSON
2026-10-06 16:12:52 +08:00
openbot
436efc3b09
feat(runtime): use real aibot WS transport by default (mock_transport=true opts out)
2026-10-06 16:07:05 +08:00
openbot
bbe36be192
feat(wecom): official aibot long-connection protocol + real WS transport
...
- wecom_ws.py: AibotWSAdapter (asyncio websockets bridged to channel threads):
connect wss://openws.work.weixin.qq.com, aibot_subscribe auth, 30s ping
heartbeat, reader->queue, graceful shutdown
- wecom.py switched to official frames:
* inbound aibot_msg_callback / aibot_event_callback (enter_chat -> welcome)
* reply: aibot_respond_msg stream {id, finish, content} reusing the
callback's req_id; after finish, proactive aibot_send_msg markdown
* image inbound: {url, aeskey} fetch + AES-256-CBC (IV=key[:16], PKCS7)
* mixed (text+image) and voice (transcribed) message types
- tests updated to official frame shapes; 43 passed
2026-10-06 16:06:49 +08:00
openbot
62773ab2e5
feat(runtime): wire channels + session manager into a runnable service
...
- runtime.py: config load (JSONC tolerated) -> SessionManager + channels,
inbound prompts run in worker threads (receive loop never stalls),
prompt errors surfaced to the chat via final event, SIGTERM/SIGINT stop
- __main__/entry point forward to runtime.main
- tests: 43 passed
2026-10-06 16:00:54 +08:00
openbot
39368ecf65
chore(scripts): publish.sh — test/pypi upload flow via uv (token file, tests-then-build)
2026-10-06 15:48:29 +08:00
openbot
0e585c1d5a
chore: uv packaging + README refresh, prep for TestPyPI
...
- pyproject: metadata (license/classifiers/urls), cryptography runtime dep,
optional [nats] extra, PEP 735 dependency-groups dev (pytest/pyright),
hatch wheel target src/agenthub
- regenerate uv.lock; uv sync/build verified (sdist+wheel, no node_modules)
- README: real repo structure, channel matrix, uv workflows, TestPyPI flow
- dist/ ignored
2026-10-06 15:47:20 +08:00
openbot
86642e07c9
test(channels): IM three-channel e2e wiring tests + final-text accumulation
...
- test_channels_e2e.py: full loop per channel
(inbound -> SessionManager.prompt -> mock ACP agent -> events -> outbound):
* wecom aibot: text dispatch -> delta frames -> replyStream final;
image base64 inbound
* wecom-app: real local HTTP callback server + real WXBizMsgCrypt
(GET echo verify + POST encrypted XML) -> stubbed qyapi send
* weixin: QR login -> long-poll inbound -> sendmessage outbound
- session.py fix: accumulate delta text per turn; 'final' event now carries
full text so no-edit-API channels (wecom-app/weixin) deliver whole message
- wecom.py: buffer outbound frames when not connected (testability)
- tests: 43 passed
2026-10-06 11:51:04 +08:00
openbot
3598358293
feat(session): M1 session manager — binding table, /switch, reaper, sqlite
...
- (channel, chat_id) -> {agent, acp_session_id} binding table
- prompt(): auto-create binding, per-chat turn serialization, image blocks
- switch(): /switch semantics; --continue migrates hub-side text ONLY
(tool state does not migrate, documented)
- update relay: ACP session/update -> delta/thinking/tool_start/tool_end/
plan/final events via per-binding event sink
- cwd whitelist per agent (fnmatch, ~ expanded, realpath)
- idle reaper: expire bindings after idle_ttl_s, close unbound processes;
max_sessions cap with LRU eviction
- sqlite persistence (bindings + session_records) — DB is fact source,
config.json only bootstrap
- process death: client+binding dropped, SessionError surfaced
- tests: 39 passed (mock ACP agent subprocess)
2026-10-06 11:45:19 +08:00
openbot
d698ae8a60
feat(channels): add wecom / wecom-app / weixin IM channels (M1.5)
...
- base.py: IMChannel protocol + InboundMessage + shared helpers
(split_message_text utf-8 byte-safe, clean_control_chars ZWSP hygiene)
- editable_stream.py: create-edit-flush streaming fallback pattern
- wecom.py: aibot WebSocket long-connection (replyStream streaming,
allowlist, reconnect backoff, auth-failure terminal)
- wecom_app.py: self-built app HTTP callback (stdlib server, WXBizMsgCrypt
AES-CBC round-trip, access_token cache, media download; works in both
WeCom client and WeChat via WeChat-plugin, no streaming on this path)
- weixin.py: WeChat bot QR login + getupdates long-poll + sendmessage
- tests: 28 passed (mock transports, crypt roundtrip, stream coalesce)
Ported from dsh-im (xmanrui) protocol facts and resilience patterns.
2026-10-06 11:33:07 +08:00
openbot
bf8748b21b
design v0.5: IM channels - WeCom aibot long-connection + WeChat customer service
2026-10-06 11:10:46 +08:00
openbot
8a84f96250
design: record M0 findings (ndjson transport, M0 done)
2026-10-06 11:07:21 +08:00
openbot
33d8ac3046
test: fix ndjson partial-tail truncation point
2026-10-06 11:07:14 +08:00
openbot
82c3763e5c
M0: framing (ndjson + lsp-frame), ACPClient, mock agent fixture, probe script; real claude-code-acp handshake verified
2026-10-06 11:05:40 +08:00
openbot
d96d4f73bb
design v0.4: IM/NATS as peer channels (NATS only handles message transport), all examples JSON
2026-10-06 10:41:52 +08:00
openbot
27d4da67fb
design v0.3.1: DESIGN.md apply review feedback (NATS client role, JSON config)
2026-10-06 10:33:54 +08:00
openbot
dad43aa1fd
design v0.3.1: apply review feedback (NATS client role, JSON config)
2026-10-06 10:33:08 +08:00
openbot
4aee2446cb
design v0.3: web admin UI, /switch command, monitoring dashboard
2026-10-06 10:31:09 +08:00
openbot
54cbd773ee
chore: last naming refs
2026-10-06 10:16:44 +08:00
openbot
65ca560640
fix: package/config naming to agenthub
2026-10-06 10:16:32 +08:00
openbot
de4a3337ec
rename acp-bridge -> agenthub; design v0.2: front-end agnostic entry + supervisor orchestration + depth guard
2026-10-06 10:16:15 +08:00
openbot
951fada34b
init: project skeleton + design docs (ACP bridge)
2026-10-06 09:59:08 +08:00