Skip to content

fix: support Gemini CLI 0.29.0 session path change and improve daemon reliability#87

Merged
bfly123 merged 2 commits intobfly123:mainfrom
daniellee2015:fix/gemini-cli-029-session-path
Feb 18, 2026
Merged

fix: support Gemini CLI 0.29.0 session path change and improve daemon reliability#87
bfly123 merged 2 commits intobfly123:mainfrom
daniellee2015:fix/gemini-cli-029-session-path

Conversation

@daniellee2015
Copy link
Copy Markdown
Contributor

Problem

  1. Gemini CLI v0.29.0 changed session storage from SHA-256 to
    directory basename, causing CCB to hang indefinitely when polling for
    responses
  2. bin/ask uses caller's cwd as work_dir, which mismatches when
    called from subdirectories or scripts
  3. Dead worker threads are not detected or replaced, causing silent
    failures

Fix

Gemini CLI 0.29.0 Compatibility

  • Dual-format session scanning (basename + SHA-256) with
    auto-adoption
  • Backward compatible with older Gemini CLI versions

Daemon Work Directory

  • bin/askd accepts --work-dir / CCB_WORK_DIR to record project
    root
  • bin/ask reads daemon's work_dir from state file instead of using
    cwd
  • askd_client adds daemon work_dir as resolution priority 3

Robustness

  • Worker pool detects and replaces dead threads
  • New ccb-cleanup tool for zombie daemon and stale file cleanup

Backward Compatibility

  • Older Gemini CLI versions continue to work via SHA-256 fallback
  • GEMINI_PROJECT_HASH env override still respected
  • No changes to session file format or binding metadata

Gemini CLI 0.29.0 changed session storage from SHA-256 hash to directory
basename (~/.gemini/tmp/<basename>/ instead of ~/.gemini/tmp/<sha256>/).
This caused CCB to hang indefinitely when polling for Gemini responses,
as it only looked under the old SHA-256 path.

Changes:
- Add _compute_project_hashes() returning (basename, sha256) tuple
- Update _get_project_hash() to prefer basename when its chats/ dir
  exists, fall back to SHA-256 for older Gemini CLI versions
- Update _work_dirs_for_hash() to register both hash formats in cache
  so the watchdog can match session events from either format
- Update GeminiLogReader to store _all_known_hashes set and scan all
  known hash directories in _scan_latest_session(), picking the newest
  session by mtime and auto-adopting the winning hash format

This fix is backward compatible: projects using older Gemini CLI versions
will continue to work via SHA-256 fallback.
- bin/ask: use daemon's work_dir from state file instead of cwd
- bin/askd: add --work-dir parameter (also reads CCB_WORK_DIR env)
- askd_server: write work_dir to state file for downstream consumers
- askd/daemon: pass work_dir through to server
- askd_client: add daemon work_dir as priority 3 in resolution chain
- askd_runtime: add get_daemon_work_dir() helper
- worker_pool: detect and replace dead worker threads
- ccb-cleanup: new tool for cleaning zombie daemons and stale files
@daniellee2015 daniellee2015 changed the title fix: support Gemini CLI 0.29.0 session path change and improve daemon reliability fix: support Gemini CLI 0.29.0 session path change and improve daemon reliability Feb 18, 2026
@bfly123 bfly123 merged commit ce20d5c into bfly123:main Feb 18, 2026
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