Repository navigation
fix(ccc): HQ tasks reach idle sessions (inbox claim + mod) — release v0.93.0 - #44
Merged
Merged
Conversation
… mod 8sync-hints), shell completions `8sync ccc hint [--complete <token>] [--json]` (crates/cli/src/verbs/ccc/hint.rs) computes, from local files only, a ghost-text suggestion for the next prompt (open /ship-loop, own urgent flag, bigram over ~/.claude/history.jsonl filtered by project, then git state), a <= 2-line band (loop · branch ↑ahead ✎dirty · urgent · watchdog alert) and typeahead rows for `/skill`, `8sync <cmd>` and `ccc <verb>` tokens. One `git status --porcelain=v2` with a 50 ms budget; no network, no gh, no model. Mod `8sync-hints` (assets/claude/skills/8sync-hints, Claude Code function hooks) draws it: session.start + main-loop turn.complete + every 20 s while idle → `$.prompt.suggest`; prompt.autocomplete → `--complete` (skill-name tokens only, not at the box start where the engine's own menu lists skills); AbovePrompt band with an "Ẩn" button. `8sync` is never awaited on the prompt/turn path and is silent on any failure; the session id reaches it as CLAUDE_CODE_SESSION_ID so the own-urgency hint works. The bigram never repeats a prompt that carries a secret-looking token (secret_mask) or a collapsed paste placeholder, reads only the last 512 KiB of history (lossy UTF-8, partial first line skipped), and untracked files count as dirty. Installed by `8sync ccc kit` (KIT_FILES 29 → 34) into ~/.claude/skills/8sync-hints, which the engine auto-loads. `8sync completions <bash|zsh|fish|powershell|elvish>` (clap_complete over `crate::command()`). research/omp-features.md: omp 18.11.1 feature scan (MIT, ideas only) — ported this batch: ghost text/predict, typeahead with descriptions, context-aware suggestion, shell completion. Tests: hint_* (14, latency < 50 ms on a real git repo + 41 skills + 512 KiB history), completions_* (3), kit_installs_the_hints_mod, `claude plugin validate|test` (8), scripts/uat/hints-load.sh (claude -p --plugin-dir, haiku). Reviewer + QA UAT findings folded in (su-code/ship/ccc-hints/LOOP.md). Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI run 38837734481: on windows-latest `git status` did not answer within 50 ms, so the hint band had no branch and two hint tests failed. The git call runs beside the prompt (the mod never awaits it), so a 300 ms budget costs nothing; our own work still stays under 50 ms (latency test now measures both). The real-repo test reads git with a generous test-only budget so a loaded runner cannot flake it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… ccc inbox)
Owner: a task assigned from HQ reached a ccc session only while it was working; sent to an idle
session it hung. A session HQ did not start (every 8sync ccc room, every session on Windows) gets
tasks through its inbox, and the only reader was the kit Stop hook, at a turn end. An idle session
has no turn to end, so the task waited for good.
- `8sync ccc inbox [--session <id>] [--json]`: the same once-only, masked, rename-first take as the
Stop hook (shared take_inbox_msgs), framed for an idle session; `{"text": string|null}`.
- Mod 8sync-inbox (Claude Code function hooks, KIT_FILES 34 -> 38): every 5 s while the main loop is
idle (turn.start/turn.complete without agentId) it takes the inbox and `$.prompt.submit`s it; a
refused prompt goes into the prompt box (`$.prompt.fill`) with a toast. Headless sessions do not
poll; the Stop hook still covers a running turn, and only one taker wins the rename.
- HQ wording: "qua inbox (nhận ngay khi phiên rảnh)".
Tests: inbox_idle_take_delivers_once_and_the_stop_hook_does_not_repeat_it, kit_installs_the_inbox_mod,
claude plugin validate|test (5), hq-ui vitest 302/302. Not verified until a session restarts with the
mod: a task arriving while the owner has a half-typed prompt.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`8sync ccc inbox` now claims pending HQ messages (`<id>.claimed`) instead of deleting them; the 8sync-inbox mod acks once the prompt entered the session (submitted, or appended to the prompt box keeping the owner's draft) and releases it back otherwise. A claim nobody acks is served again after 120 s; orphaned `.taking.<pid>` files are swept back; claims are created with a hard link so two pollers never overwrite each other; appends keep line boundaries. Mod: session id re-read every poll (after /clear) with last-good fallback, poll backoff 5 s -> 15 s -> 30 s reset on a finished turn, try/finally on turn.complete, failed toast no longer releases a filled task. Review: 2 BLOCKER + 5 SHOULD (pass 1) and 5 SHOULD (pass 2) fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
Owner: "trên hq ui giao task khi ccc còn working nó mới làm còn khi nó chưa working gửi task nó bị treo".
Root cause: sessions HQ did not start (every
8sync cccroom, all Windows sessions) get tasks through the HQ inbox, read only by the Stop hook at the end of a turn. An idle session never ends a turn, so the task waited forever.8sync ccc inbox [--session <id>] [--ack|--release] [--json]: two-phase claim of the inbox (never deletes before delivery; stale claim re-served after 120 s; orphan sweep; hard-link claim).8sync-inbox: polls while idle (5 s → 15 s → 30 s), submits the task as a prompt, appends to the prompt box if refused, acks or releases.Stacked on #43: merge that PR first.
Test plan
cargo test -p su-code inbox(6),kit_installs_the_inbox_mod,hint_ccc_verbs, clippy cleanclaude plugin test(9) for the mod, HQ UI vitest8sync ccc kit+ restart), Windows8syncshim resolution in$.process.run🤖 Generated with Claude Code