Skip to content

fix(installer/runtime): honor CODEX_BIN_DIR everywhere#71

Open
Microdent wants to merge 2 commits intobfly123:mainfrom
Microdent:pr/bin-dir-paths
Open

fix(installer/runtime): honor CODEX_BIN_DIR everywhere#71
Microdent wants to merge 2 commits intobfly123:mainfrom
Microdent:pr/bin-dir-paths

Conversation

@Microdent
Copy link

@Microdent Microdent commented Jan 30, 2026

Summary

Remove runtime and installer assumptions about ~/.local/bin so custom CODEX_BIN_DIR works end-to-end.

Changes

  • Installer: PATH export and tmux helper install paths use CODEX_BIN_DIR/BIN_DIR.
  • tmux config/scripts: injected bin-dir option and script-relative helper resolution.
  • Runtime: resolve helper scripts via CODEX_BIN_DIR and PATH (ccb + completion hooks) instead of hardcoded ~/.local/bin.
  • Docs: update troubleshooting text to reference CODEX_BIN_DIR.

Testing

  • python -m py_compile ccb bin/ccb-completion-hook lib/completion_hook.py

Copilot AI review requested due to automatic review settings January 30, 2026 17:39
@Microdent Microdent marked this pull request as draft January 30, 2026 17:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes hardcoded ~/.local/bin assumptions throughout the codebase to properly honor the CODEX_BIN_DIR environment variable for custom installation paths. It is stacked on top of PR #70 which changes request ID format.

Changes:

  • Replaced hardcoded ~/.local/bin paths with dynamic resolution using CODEX_BIN_DIR environment variable
  • Added helper functions to locate bin directories and scripts using consistent priority orders (env vars, PATH, defaults)
  • Updated tmux configuration to use injected bin directory path via template replacement
  • Updated documentation with examples that reference CODEX_BIN_DIR for troubleshooting

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/completion_hook.py Added dynamic script path resolution using CODEX_BIN_DIR, CODEX_INSTALL_PREFIX, and PATH lookups
lib/ccb_protocol.py Changed request ID format to 32-hex (from PR #70); added backward-compatible regex patterns
config/tmux-ccb.conf Added tmux keybindings using @ccb_bin_dir variable; updated comments to reference CODEX_BIN_DIR
ccb Added _get_bin_dir() and _find_helper_script() helper functions; updated _set_tmux_theme() and _detect_cca() to use dynamic paths
bin/ccb-completion-hook Updated find_ask_command() and session file search to use CODEX_BIN_DIR and CODEX_INSTALL_PREFIX
README.md Updated troubleshooting section to reference CODEX_BIN_DIR instead of hardcoded ~/.local/bin
README_zh.md Updated troubleshooting section to reference CODEX_BIN_DIR instead of hardcoded ~/.local/bin

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ccb
return Path.home() / ".local" / "bin"


def _find_helper_script(name: str) -> Path | None:
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type annotation Path | None requires Python 3.10+ or the from __future__ import annotations import. The ccb file is missing this import, which will cause a syntax error on Python 3.7-3.9. Add from __future__ import annotations at the top of the file, following the pattern used in other Python files in this codebase (e.g., lib/completion_hook.py, lib/ccb_protocol.py).

Copilot uses AI. Check for mistakes.
@Microdent Microdent marked this pull request as ready for review January 31, 2026 15:36
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