Skip to content

πŸš€ CodeFox CLI - Alpha 0.4.7v

Latest

Choose a tag to compare

@URLbug URLbug released this 18 Nov 17:08
· 20 commits to main since this release
Immutable release. Only release title and notes can be modified.

🦊 CodeFox CLI v0.4.7

Silent failures, gone.
When CodeFox had nothing to say in your pull request, it stayed quiet β€” no comment, no error, just a green check and silence.
This release makes every failure loud, explainable, and fast to recover from.


✨ At a glance

πŸ› Empty PR comments Blank reviews are no longer posted; the run fails with the real reason
πŸ›‘οΈ Crash-proof reviews A broken RAG index no longer blocks the review
🧩 Chunking that can't fail No more 0 chunks β†’ max() iterable argument is empty
⚑ Bounded CI indexing Whole-repo embedding storm replaced with a capped index
πŸ”§ Action cache fix ${{ pwd }} β†’ ${{ github.workspace }}

🎯 Why this release exists

Two support reports drove it:

"The PR comment doesn't show up."
A pull request showed an empty comment β€” literally No description provided.
Behind it was a chain of silent failures: a missing .codefox.yml aborted the
run before any review could be posted, and an empty model response was sent
straight to the API, which happily created a blank comment.

"Too slow to build."
Continuous integration stalled embedding thousands of chunks from a handful of
files, until the runner was cancelled mid-index.

Both are fixed at the root: fail loudly, degrade gracefully, do less work.


πŸ› No more silent empty comments

Before: an empty or placeholder model response was posted as an empty PR
comment. Missing configuration aborted the step without a trace.

Now:

  • codefox scan --ci raises a dedicated EmptyReviewError with the raw output
    truncated to 200 characters, instead of publishing nothing useful.
  • Empty, whitespace-only, None, "None", "null", "n/a", "undefined",
    "no response" and "empty" are all rejected before hitting the API.
  • GitHubBot.send() refuses empty or whitespace-only bodies β€” matching the
    guard GitLabBot already had β€” so a blank comment can never reach GitHub.
  • The action creates a default .codefox.yml when the repository has none,
    and exits with an explicit ::error:: if it still cannot.
Scan result: β›” CodeFox scan failed: The model returned an empty review, so
nothing was posted to the pull request. Reported raw output: ''. Check the
model name, API key and token limits in .codefox.yml / .codefoxenv.

🧩 Chunking that survives a cold CI runner

sent_tokenize failed on fresh runners because NLTK 3.9 needs the punkt_tab
package, not just punkt. The resulting LookupError had an empty message,
and except Exception: continue swallowed it β€” one dropped file turned into
all files dropped.

Fixes:

  • Both punkt and punkt_tab are downloaded, with a warning instead of a
    crash if the download fails.
  • A regex-based sentence splitter backs up NLTK, and code-like text is split
    line-by-line β€” sentence tokenization on Python source was slow and pointless.
  • Skipped files are now listed with their real reason (first 5, plus a count).
  • An empty corpus raises a readable ValueError instead of the opaque
    max() iterable argument is empty.
- βœ“ Created 0 chunks from 16 files.
- Failed to upload files to model: LocalRAG error: max() iterable argument is empty
+ βœ“ Created 7622 chunks from 16 files.
+ ⚠ 1 file(s) could not be chunked and were skipped:
+   src/generated.py: LookupError (no message)

πŸ›‘οΈ A broken index no longer blocks the review

RAG only enriches a review with project context. Treating it as a hard
requirement meant losing the index cost you the entire review.

Now a failed index falls back to diff-only review, and the warning is surfaced:

Warning: LocalRAG unavailable, reviewing diff only: No chunks could be built…

⚑ Bounded, faster CI indexing

Embedding the entire checkout is what stalled CI: every chunk costs one CPU
embedding on a 2–4 core runner.

Chunk size is now actually honored. The previous packer checked the size
before re-prepending the overlap tail, so chunks ballooned to 2737
characters
at chunk_size=300 β€” then every one of them got embedded.

Measured on this repository:

Setting Chunks Chunking BM25 Embedding batches
old: 300, uncapped 776 0.22 s 0.02 s 13
new: 1000, cap 600 279 0.21 s 0.01 s 5

Directory filtering β€” vendored dependencies, virtualenvs, caches, hidden
folders and RAG artifacts are no longer indexed:

Files indexed
before 14 226
after 55

CI defaults (set by the action when the repo hasn't opted out):

model:
  rag_chunk_size: 1000
  rag_chunk_overlap: 200
  rag_max_chunks: 600
  rag_max_files: 300

Existing values in your .codefox.yml are never overwritten. To index
everything, opt out:

env:
  CODEFOX_FULL_REPO_RAG: "true"

Or tune the cap directly:

env:
  CODEFOX_RAG_MAX_CHUNKS: "200"   # fastest
  CODEFOX_RAG_MAX_FILES: "300"

Note: the embedding stage itself was not benchmarked end-to-end for this
release. The chunk cap is a hard ceiling, so index build time no longer grows
with repository size beyond 600 chunks.


πŸ”§ Action cache path fix

${{ pwd }} is not a valid GitHub Actions expression, so the CodeFox cache was
never restored. It is now ${{ github.workspace }}/.codefox/, meaning repeat
runs reuse the embedding cache and index instead of rebuilding them.


πŸ“¦ Install

# uv
uv tool install codefox

# pip
python3 -m pip install codefox

Use in a workflow:

- uses: URLbug/CodeFox-CLI@v0.4.7
  with:
    codefox-api-key: ${{ secrets.CODEFOX_API_KEY }}

βœ… Quality

  • 83 tests passing, including new regression coverage for empty responses,
    RAG fallback, chunk-size bounding and directory filtering.
  • ruff and mypy clean.
  • action.yml validated as parseable YAML and its scan step executed
    end-to-end.

πŸ—ΊοΈ What's in this tag vs. what's next

Being precise, because it matters for what you can actually run:

  • In v0.4.7: the action-cache path fix only.
  • Merged to main after this tag: everything else described above β€” empty
    comment handling, RAG resilience, chunking fixes and bounded indexing.

If you need today's fixes now, track main; they will ship together in the
next tagged release.


πŸ™ Thanks

To everyone who reported the empty comment and the stalled build β€” both led
straight to root causes that would otherwise have stayed hidden.

Full changelog: v0.4.6...v0.4.7