Skip to content

fix(ccc): HQ tasks reach idle sessions (inbox claim + mod) — release v0.93.0 - #44

Merged
8syncdev merged 7 commits into
mainfrom
feat/hq-idle-inbox
Oct 16, 2026
Merged

8syncdev merged 7 commits into
mainfrom
feat/hq-idle-inbox

Conversation

@8syncdev

Copy link
Copy Markdown
Contributor

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 ccc room, 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).
  • Mod 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.
  • HQ UI wording: "qua inbox (nhận ngay khi phiên rảnh)".
  • Release v0.93.0 (version bump + CHANGELOG).

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 clean
  • claude plugin test (9) for the mod, HQ UI vitest
  • CI 38839274793 green on ubuntu, windows, macos
  • Reviewer: 2 passes, all BLOCKER/SHOULD fixed. Gates: /sec OK, /rules ALLOWED, /aup-audit clean
  • Not verified: live UAT (owner assigns a task to an idle session after 8sync ccc kit + restart), Windows 8sync shim resolution in $.process.run

🤖 Generated with Claude Code

8syncdev and others added 7 commits October 16, 2026 08:55
… 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]>
… 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]>
@8syncdev
8syncdev merged commit a4b82a8 into main Oct 16, 2026
6 checks passed
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.

1 participant