feat: ceki-daemon persistent renter-process + CLI IPC#15
Open
iWedmak wants to merge 10 commits into
Open
Conversation
added 10 commits
July 19, 2026 15:09
…e import logging, visible stderr error - Sync __init__.__version__ to 2.36.0 matching pyproject.toml - Close log_file handle after subprocess.Popen in _ensure_daemon() and _cmd_daemon_start() - Move import logging to top-level imports - Add user-visible stderr error on daemon auto-start failure in _ensure_daemon() - Remove redundant is_running() check after for-loop (proc.poll() already covers it) - Add .claude/ .graphifyignore .mypy_cache/ to .gitignore
Missing [project.scripts] ceki-daemon = ceki_sdk.daemon:main entry point — the published PyPI package had no ceki-daemon binary. Every Joe review round (4400, 4439, 4444) cited this as the blocker.
Same wire call, same args, different name — lets AI agents express 'edit the task' intent instead of 'propose a correction'. - New top-level subcommand 'edit' (ceki edit <eid> --label ...) - Delegates to ContractClient.propose() under the hood - Accepts all the same args: --status, --label, --desc, --start, --end, --date, --duration, --amount, --currency, --benefitable, --tags
Added 'edit' as a contract subparser (ceki contract edit <eid> ...) that delegates to ContractClient.propose() — same args, same wire call, different name for 'edit task' intent.
- WebRTCTransport: wraps aiortc RTCPeerConnection for P2P CDP
over DataChannel('ceki-cmd') with ICE candidate queuing
- _client.py: P2P init, webrtc.offer/answer/ice_candidate dispatch
- _browser.py: DC-aware Browser.send() — P2P transport preferred
over WS fallback when ceki-cmd DC is open
- CEKI_FORCE_WS env flag, CEKI_TURN_SERVERS env,
CEKI_ICE_TRANSPORT_POLICY env
- 41 unit tests in tests/test_webrtc_p2p.py (134/135 pass,
1 pre-existing failure in test_cli.py)
- pyproject.toml: aiortc>=1.9,<2 dependency
BUG: In P2P mode (cmd_dc_open=true), CDP responses arrive via BOTH
WS relay (as cdp_response) and the ceki-cmd data channel. The WS
response arrives first but has empty result {} for large payloads
like screenshot base64. The pending CDP future resolves with empty
data before the DC response with real data arrives.
FIX: In _reader_loop, when P2P is active and cmd_dc_open is true,
skip WS cdp_response messages. The DC response arrives and resolves
the future with complete data. When DC is not open (WS-only mode),
WS cdp_response is handled as before.
Affected: screenshot(), snapshot() return 0 bytes in P2P mode without this fix.
v1 (25cb42e) was too broad: skipped ALL WS cdp_response when P2P DC was open, including responses for commands sent via WS before P2P connected. v2 fix: tag each pending CDP future with its transport ('dc' or 'ws') at send time. _on_cdp_response only skips WS echo for futures tagged as 'dc' (the screenshot race). WS-sent commands resolve normally even if P2P connects before their response arrives. Key changes: - Browser.send(): tag fut._cdp_transport before storing - Browser._on_cdp_response(): check tag + message origin; skip WS echo for DC-sent commands, accept all others
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ceki-daemon — persistent renter-process, решающий CLI one-shot session disconnect.
Что сделано
Part 1 — daemon core (новый
ceki_sdk/daemon.py)/tmp/ceki-daemon.pidPart 2 — CLI integration (
ceki_sdk/cli.py)ceki daemon start|stop|statusPart 3 — SDK transport
BrowserAPI не меняетсяВерсия
bump 2.35.6 → 2.36.0
После merge — создать GitHub Release v2.36.0 для публикации на PyPI.