diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35511b4..f4eaaff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,8 @@ name: CI on: push: + branches: + - master pull_request: permissions: diff --git a/README.en.md b/README.en.md index c90ffbf..7bab02f 100644 --- a/README.en.md +++ b/README.en.md @@ -4,12 +4,26 @@ Arduino firmware and a macOS companion for the Waveshare ESP32-S3-Touch-AMOLED-2.16. The device receives real Codex account usage and task status from the local computer over encrypted BLE. Codex credentials are never stored on the ESP32. -![Codex Usage Display hardware](docs/device-photo.jpg) +

+ Codex Usage Display hardware +

> Current status: first usable hardware release. The firmware, BLE companion, > global hooks, tests, and PlatformIO build are working end to end. Only the > specified Waveshare board and macOS are currently supported. +## Contents + +- [Features](#features) +- [Recommended: PlatformIO](#recommended-platformio) +- [Arduino IDE (alternative)](#arduino-ide-alternative) +- [Start the macOS Companion](#start-the-macos-companion) +- [Repository structure](#repository-structure) +- [Tests](#tests) +- [Data semantics and boundaries](#data-semantics-and-boundaries) +- [Current limitations](#current-limitations) +- [Contributing, security, and licenses](#contributing-security-and-licenses) + ## Features - CO5300 480 × 480 AMOLED over QSPI diff --git a/README.md b/README.md index 4d04121..e0f159e 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,25 @@ Waveshare ESP32-S3-Touch-AMOLED-2.16 的 Arduino 固件和 macOS Companion。设备通过加密 BLE 接收本机 Codex 的真实账户用量和任务状态,不在 ESP32 中保存 Codex 凭据。 -![Codex Usage Display 实机照片](docs/device-photo.jpg) +

+ Codex Usage Display 实机照片 +

> 当前状态:首个可用硬件版本。固件、BLE Companion、全局 Hook、测试和 > PlatformIO 构建均已打通;目前只支持指定的 Waveshare 开发板和 macOS。 +## 目录 + +- [当前已实现](#当前已实现) +- [推荐:使用 PlatformIO](#推荐使用-platformio) +- [Arduino IDE(兼容方式)](#arduino-ide兼容方式) +- [启动 macOS Companion](#启动-macos-companion) +- [代码结构](#代码结构) +- [测试](#测试) +- [数据口径与边界](#数据口径与边界) +- [当前限制](#当前限制) +- [贡献、安全与许可证](#贡献安全与许可证) + ## 当前已实现 - CO5300 480 × 480 AMOLED(QSPI) diff --git a/companion/codex_display/hook_events.py b/companion/codex_display/hook_events.py index a02c81c..315cfdc 100644 --- a/companion/codex_display/hook_events.py +++ b/companion/codex_display/hook_events.py @@ -82,7 +82,7 @@ async def process_event(self, event: Dict[str, object]) -> None: self._turns[key] = PendingTurn( turn_id=turn_id, transcript_path=path, - phase="pending_start", + phase="pending_start" if path is not None else "active", created_at=now, counted=True, ) diff --git a/companion/tests/test_hook_events.py b/companion/tests/test_hook_events.py index 9c76732..f8a6a37 100644 --- a/companion/tests/test_hook_events.py +++ b/companion/tests/test_hook_events.py @@ -55,6 +55,9 @@ async def test_pathless_stop_clears_sidechat_immediately(self): await self.tracker.process_event(submit) self.assertEqual(self.tracker.extra_count(set()), 1) + await self.tracker.reconcile(now=111) + self.assertEqual(self.tracker.extra_count(set()), 1) + stop = self._event("Stop") stop["transcript_path"] = None await self.tracker.process_event(stop)