Skip to content

Cache CLI API reads with Keyv and SQLite - #57

Open
pranavcodeant wants to merge 1 commit into
mainfrom
codex/keyv-fetch-api-cache
Open

pranavcodeant wants to merge 1 commit into
mainfrom
codex/keyv-fetch-api-cache

Conversation

@pranavcodeant

@pranavcodeant pranavcodeant commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Summary

  • Add an optional Keyv and SQLite cache for repository and branch reads through fetchApi, scoped to the request, API host, tenant, and credential.
  • Bound disk usage with TTL cleanup, a 64 MiB database limit, and a 1 MiB entry limit. Evict branch entries after a default-branch update and clear credential-scoped entries on logout.
  • Fetch scan status, history, and commit-based results live so a rerun of the same commit can’t surface a stale completed result. Use live requests when SQLite or the optional dependencies are unavailable.

Validation

  • npm test passed all 191 tests.
  • Verified the packed CLI on macOS with Node 20, Node 24, and VS Code’s Electron runtime, including the live fallback without cache dependencies.
  • Smoke-tested the packaged MCP server without Keyv. Windows, Linux, and full IDE release builds remain unverified.

CodeAnt-AI Description

Cache repository and branch listings between CLI requests

What Changed

  • Repeated repository listings are reused for five minutes and branch listings for 30 seconds on supported Node.js versions; otherwise, requests fetch live data.
  • Changing a repository’s default branch clears its cached branch listings, and logging out clears saved data for that account.
  • Scan status, history, and commit-based results always fetch live data. Set CODEANT_NO_CACHE=1 to bypass the cache.

Impact

✅ Faster repeated repository and branch listings
✅ Fresh branch listings after a default-branch change
✅ Current scan status and results on every request

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@codeant-ai

codeant-ai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #db503 Reviewed your PR 9d1305d Nov 30, 2026 · 11:06 11:19

@codeant-ai

codeant-ai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant