Skip to content

feat(stackchan): add agent tasks dashboard and gateway - #135

Closed
yuanxiaoyu wants to merge 3 commits into
m5stack:mainfrom
yuanxiaoyu:codex/agent-tasks-dashboard
Closed

yuanxiaoyu wants to merge 3 commits into
m5stack:mainfrom
yuanxiaoyu:codex/agent-tasks-dashboard

Conversation

@yuanxiaoyu

Copy link
Copy Markdown

No description provided.

@Forairaaaaa Forairaaaaa self-assigned this Nov 13, 2026
@gianpaj

gianpaj commented Nov 14, 2026

Copy link
Copy Markdown

nice idea :)

@yuanxiaoyu

yuanxiaoyu commented Nov 14, 2026 via email

Copy link
Copy Markdown
Author

@m5agent

m5agent commented Nov 16, 2026

Copy link
Copy Markdown

Thanks — a two-column Codex/Claude status view is a good fit for StackChan, and the device/gateway contract is coherent. I reviewed 01b78f6 and ran everything that does not need an ESP-IDF toolchain. The host suites pass. My concern is scope: this changes global firmware behaviour, adds an app the existing visibility switch cannot hide, and vendors a ~30k-line gateway. I would not merge it as one changeset.

Evidence class: host-level test + code-level verification. Hardware and virtual-device runs were NOT RUN; the reason is at the end.

What I ran (logs and full report: https://github.com/m5agent/agent-work-logs/blob/63667e9fe5fc019d1b845f60f57ccd9a2f3d7651/records/stackchan/2026-11-16-agent-tasks-dashboard-pr135/README.md ):

  • Firmware host tests — cmake -S firmware/tests -B build && cmake --build build && ctest --output-on-failure → 3/3 PASS (model, home gesture, motion).
  • Gateway — fresh venv, uv pip install -e . pytest pytest-asyncio, pytest -q → 913 passed, 5 skipped, 1 failed at tests/test_cli.py::test_check_port_unresolvable_host_returns_bind_error. That failure is a platform-specific error-string assertion (this macOS returns Can't assign requested address instead of getaddrinfo failed), not a product defect. uv lock --check passes.
  • Started serve --transport streamable-http --no-mdns and called /agent-dashboard: 401 without the bearer token, 200 with it, and the JSON matches the firmware parser field by field (agents with codex/claude order, id/text/status, bools, Content-Length present).

Findings:

  1. The shared home gesture changes for every app (please split). firmware/main/apps/common/home_indicator/bottom_swipe.h:34-35 widens the bottom trigger zone from 20 to 40 px and lowers the swipe distance from 50 to 40 px, and bottom_swipe.h:18-22 now fires while the finger is still down, where the old code fired on release. Because this gesture is shared by all apps, an ordinary upward drag that starts in the bottom 40 px now goes home. firmware/tests/home_gesture_test.cpp covers the state machine only. Please make this its own PR with regression checks on avatar/launcher/app-center, or keep the old thresholds.

  2. The new app cannot be hidden. firmware/main/main.cpp:45 installs AppAgentTasks without hal_toggles::register_app_id, and firmware/main/hal/hal_toggles.h:12 has no AgentTasks entry, so is_app_enabled() returns true for it. SETUP → Apps → App visibility can hide AI.AGENT / AVATAR / ESPNOW / APP.CENTER / EZDATA / DANCE but not this entry, which stays on the launcher for users who never set up the gateway. Related: firmware/main/apps/app_setup/app_setup.cpp:149 adds Agent 看板 as the only non-English label in that menu, and the dashboard strings (status_label, 请先配置网关, 暂无待办任务) are Chinese-only while the app name and the rest of the UI are English.

  3. Leaving the app can stall the main loop. firmware/main/apps/app_agent_tasks/agent_tasks_poller.cpp:157-160 busy-waits for the fetch task, which can be blocked inside client->Open with the 5 s budget from agent_tasks_poller.cpp:16; onClose calls it (app_agent_tasks.cpp:40) from the same loop that feeds the watchdog (firmware/main/main.cpp:47-55). With the gateway unreachable — the common case — closing the dashboard can block that loop for up to the HTTP timeout. If you have not checked this on device, please do; otherwise make shutdown asynchronous or abort the socket.

  4. Size and build cost. firmware/main/apps/app_agent_tasks/view/agent_tasks_cjk_14.c is 3.0 MB / 47k lines of generated source (7,540 glyphs) compiled into every StackChan build. Your measured image is 4,292,768 bytes against the 0x4f0000 partition (17% left), so it fits today, but it leaves little room for the official app to grow. A Kconfig gate or a smaller subset would help. The font licensing (view/OFL.txt, 字体说明.md) looks correct.

  5. Gateway delivery shape. gateway/pyproject.toml still declares stackchan-mcp 0.20.0, author kisaragi-mochi, with Homepage/Repository pointing at the upstream project, and the tree includes WebSocket device control, /capture, TTS/STT and robot handlers that your own README says need a different firmware. Attribution is complete, but please either depend on the upstream package plus a small patch, or record the pinned upstream commit and disable the unused services in the default serve path.

  6. Docs and reproducibility. README.md:1-59 puts a Chinese project introduction ahead of the official one, docs/superpowers/{specs,plans} are planning artifacts, and docs/design/agent-tasks-official-preview.png is a design mock. The repo has no firmware CI, so the ESP-IDF 6.1 build and the hardware result cannot be reproduced by a maintainer. Please add the exact build command, the image SHA-256, and one real-device screencast of AGENT TASKS.

NOT RUN and why: no firmware build — ESP-IDF v6.1 and the fetch_repos.py xiaozhi components are not installed in my environment, and the PR ships no BIN. So I have no virtual-device or hardware boot of this image. A StackChan QEMU profile does exist, but without a flashable image I have no display, touch or Wi-Fi evidence and am not claiming any.

Happy to re-run the host suites and the endpoint check on a split series.

@yuanxiaoyu yuanxiaoyu closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants