Skip to content

fix(llm): allow Codex CLI outside Git repositories#6347

Merged
houko merged 1 commit into
librefang:mainfrom
pavver:bugfix/codex-cli-non-git
Jun 28, 2026
Merged

fix(llm): allow Codex CLI outside Git repositories#6347
houko merged 1 commit into
librefang:mainfrom
pavver:bugfix/codex-cli-non-git

Conversation

@pavver

@pavver pavver commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Problem

The Codex CLI provider failed when LibreFang was started as a desktop application or daemon outside a Git repository.

The provider check still reported Codex as available because it only verified that the executable and credentials existed. The first real completion then failed with:

Not inside a trusted directory and --skip-git-repo-check was not specified.

The driver also passed the deprecated --full-auto option, producing a warning on every request.

Root cause

LibreFang launched codex exec in the process working directory.

Desktop and daemon processes are not guaranteed to start inside a Git repository, while non-interactive Codex execution rejects such directories unless --skip-git-repo-check is explicitly supplied.

Changes

  • Always pass --skip-git-repo-check to codex exec.
  • Replace deprecated --full-auto with --sandbox workspace-write.
  • Update the driver warning and documentation to describe the current sandbox option.
  • Add regression tests that verify the complete argument list in both permission modes.
  • Add an entry to the unreleased changelog.

Verification

  • cargo fmt --check
  • cargo test -p librefang-llm-drivers --lib codex_cli
    • 14 Codex CLI driver tests passed.
  • cargo clippy -p librefang-llm-drivers --lib -- -D warnings
  • Built a local librefang-desktop release package.
  • Verified that the packaged executable contains --skip-git-repo-check and no longer contains --full-auto.
  • Installed the package and completed real Codex CLI-backed agent requests from the desktop application.

Out of scope

The desktop dashboard currently retries an agent WebSocket connection with an Origin based on its random frontend port, while the API validates it against the separate API listen port. This produces repeated 403 Origin validation failed warnings. HTTP message fallback still works, and this separate desktop/WebSocket issue is not included in this PR.

@github-actions github-actions Bot added size/S 10-49 lines changed area/docs Documentation and guides labels Jun 27, 2026
@houko
houko merged commit 72262b8 into librefang:main Jun 28, 2026
32 checks passed
@houko houko mentioned this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation and guides size/S 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants