Skip to content

fix: restore Gemini async completion flow (hash/autostart/req_id compat)#97

Merged
bfly123 merged 2 commits intobfly123:mainfrom
bookandlover:fix/gemini-slug-hash-autostart-routing
Feb 24, 2026
Merged

fix: restore Gemini async completion flow (hash/autostart/req_id compat)#97
bfly123 merged 2 commits intobfly123:mainfrom
bookandlover:fix/gemini-slug-hash-autostart-routing

Conversation

@bookandlover
Copy link

@bookandlover bookandlover commented Feb 23, 2026

Problem

Recent Gemini workflow regressions observed in CCB:

  1. ask gemini can fail or hang in mixed Gemini project layouts.
  2. Gemini may finish, but caller side stays in "processing" and does not reliably collect completion.

Root Causes Addressed

  • Project session discovery did not robustly handle Gemini slug-based directories with collision suffixes (for example claude-code-bridge-1).
  • DONE marker matching in protocol adapters did not fully cover the current req_id format (YYYYMMDD-HHMMSS-mmm-PID-counter).
  • Connectivity checks/autostart could run under caller cwd instead of target project cwd in some paths.
  • Unified askd readiness was not checked early enough for async paths.

Changes

  • lib/gemini_comm.py

    • Add project-hash candidate discovery for slug + suffixed slug + legacy SHA layouts.
    • Prefer active/recent candidates and keep known hashes for reader continuity.
  • lib/gaskd_protocol.py

  • lib/daskd_protocol.py

    • Expand ANY_DONE_LINE_RE to accept req_id with trailing counter.
  • bin/ccb-ping

    • Add --autostart.
    • Resolve work dir from --session-file to ensure daemon checks/start happen in target project context.
  • bin/ccb-mounted

    • Add argument parsing for --json | --simple | --autostart [path].
    • Execute mounted checks against provided project path (not implicit caller cwd).
  • bin/ask

    • Add unified askd readiness/autostart check before async submission and unified send path.

Validation

Added tests:

  • test/test_gemini_comm.py
  • test/test_autostart_on_check.py
  • test/test_ask_cli.py

Local verification:

  • pytest -q test/test_gemini_comm.py test/test_autostart_on_check.py test/test_ask_cli.py
  • python -m compileall -q lib bin ccb

Compatibility / Risk

  • Scope is limited to Gemini path/session discovery, completion marker compatibility, and autostart routing.
  • Preserves compatibility with legacy SHA-based Gemini layout while supporting current slug-based layouts.
  • No behavior change intended for unrelated providers beyond shared daemon readiness guard.

PengMacStudio and others added 2 commits February 23, 2026 11:08
- Support Gemini CLI slug-based project directories with collision
  suffixes (e.g. claude-code-bridge-1)
- Update ANY_DONE_LINE_RE in daskd/gaskd to match new req_id format
  (YYYYMMDD-HHMMSS-mmm-PID-counter)
- Add --autostart flag to ccb-ping and ccb-mounted
- Add tests for slug hash discovery and autostart functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bfly123 bfly123 merged commit a14edff into bfly123:main Feb 24, 2026
3 of 13 checks passed
bfly123 added a commit that referenced this pull request Feb 24, 2026
Covers merged PRs #87, #91, #92, #96, #97: Gemini CLI 0.29.0
dual-hash support, OpenCode async deadlock fix, mail setup v3
compat, lpend stale-registry fallback, and autostart routing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants