Repository navigation
First-run fixes: OPENAI_BASE_URL and CLI entrypoint regression test - #145
PatrickSys wants to merge 3 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The runtime effect is limited to OpenAI-compatible embedding requests. Fix the Windows symlink test before merging; it fails on machines without symlink privileges. FindingsSummaryThis PR wires
Reviews (1) · Last reviewed commit: "test(cli): cover reindex via npm-style b..." · Reviewed by Greptile |
|
|
||
| await writeFile(join(projectRoot, 'example.ts'), 'export const value = 1;\n'); | ||
| await mkdir(tempDirectory, { recursive: true }); | ||
| symlinkSync(entrypoint, linkedEntrypoint, 'file'); |
There was a problem hiding this comment.
If a Windows contributor lacks permission to create symlinks, symlinkSync throws before this test reaches its cleanup block. The suite fails and leaves both temporary directories behind. Use the same Windows skip guard as the symlink test immediately below, and clean up both directories when setup fails.
| vi.unstubAllEnvs(); | ||
| const { DEFAULT_EMBEDDING_CONFIG } = await import('../src/embeddings/types.js'); |
There was a problem hiding this comment.
vi.unstubAllEnvs() restores the original environment; it does not unset OPENAI_BASE_URL. If a contributor has that variable set, test:watch gets a false failure because it bypasses the normal test wrapper’s environment filter. Explicitly unset the variable with vi.stubEnv('OPENAI_BASE_URL', undefined) before importing the defaults.
| vi.unstubAllEnvs(); | |
| const { DEFAULT_EMBEDDING_CONFIG } = await import('../src/embeddings/types.js'); | |
| vi.stubEnv('OPENAI_BASE_URL', undefined); | |
| const { DEFAULT_EMBEDDING_CONFIG } = await import('../src/embeddings/types.js'); |
OPENAI_BASE_URL wiring is useless if a cached OpenAI client keeps the first endpoint.
Adversarial review (maintainer)Verdict: merge (small, targeted; ship before #142). What I verified: Built on clean What I fixed (pushed Left (not this PR): Conflict note: #142 touches overlapping init/docs paths — merge this first, then rebase #142. |
First-run report (clean VM, Node v22.23.4)
Followed README.md literally with
npx -y codebase-context(published 2.2.0) and compared against this branch’s 2.3.0 tarball (npx -y file:/…/codebase-context-2.3.0.tgz). MCP smoke: single-lineinitializeover stdio returned serverInfo2.3.0.Repos exercised
reindex,search,mapreindex --no-embeddings,search --query "session adapter"sessions.py/adapters.py(low-confidence banner shown)reindex --no-embeddingsWhat broke or confused (published 2.2.0)
CLI via
npxis a silent no-op (blocker).npx -y codebase-context reindex,npx -y codebase-context --version,npx -y codebase-context status0, no.codebase-context/created.index.js, so 2.2.0 never setsisDirectRunand skips CLI dispatch.node node_modules/codebase-context/dist/index.js reindexon the same install does index (~13s with embeddings onis).realpathentrypoint detection; verified:npx -y file:…/codebase-context-2.3.0.tgz reindex --no-embeddingsand--versionprint2.3.0and complete indexing.First
npxinstall noise (~14s on cold cache). Deprecation warnings (boolean,uuid,glob,node-domexception) — not fatal but noisy for a “5 minute” story.README vs npm skew. README documents unpublished
init/ model-free defaults (2.4.0 candidate) while npm is still 2.2.0; accurate but easy to misread. Workspace version is 2.3.0 (unpublished).OPENAI_BASE_URLignored (issue Feature Request: Support custom OpenAI-compatible API endpoints (OPENAI_BASE_URL) #70). Workaround for Transformers/onnx mutex (Bug Report: Mutex Lock Failed During Indexing on Intel Mac #68) requires pointing OpenAI provider at Ollama; env var was not wired into defaults.What this PR fixes
OPENAI_BASE_URL→DEFAULT_EMBEDDING_CONFIG.apiEndpoint(trailing slash stripped); documented indocs/capabilities.md; tests intests/embedding-config-env.test.tsandtests/openai-embeddings.test.ts.Regression test for npm-style bin symlink (
codebase-context→index.ts) runningreindex --no-embeddingswithout loading MCP stdio (tests/cli-entrypoint-runtime.test.ts).What’s left (ranked)
npxpath matches fixed CLI entrypointOpen issue triage
EMBEDDING_PROVIDER=ollamawarns and falls back). Severity: medium (quality-of-life vs OpenAI-compat). Effort: medium.Verification
pnpm test -- tests/openai-embeddings.test.ts tests/embedding-config-env.test.ts tests/cli-entrypoint-runtime.test.tsnpx -y file:/workspace/codebase-context-2.3.0.tgz reindex --no-embeddingsonsindresorhus/is(after pack) succeeded with status box output.