Repository navigation
fix: load extension source for git installs - #2
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR changes Pi Git-install loading to use ChangesSource Entrypoint and Packaging
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9da506fe4f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/litellm-smoke.yml:
- Around line 224-229: Add npm run prepublishOnly to the workflow after npm ci
and before the existing pi model-listing smoke commands, ensuring the prepublish
validation runs before any smoke checks.
In `@package.json`:
- Around line 33-35: Update the package publication whitelist in package.json to
retain dist alongside src, README.md, and LICENSE, ensuring dist/index.js
remains included in npm packages.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 78d0b6ad-da0b-41b5-a620-de7cc5224cde
📒 Files selected for processing (9)
.github/workflows/litellm-smoke.ymlAGENTS.mdREADME.mdpackage.jsonscripts/supply-chain-guard.tstests/litellm-smoke-workflow.test.tstests/package.test.tstests/supply-chain-guard.test.tstests/terminal-smoke.test.ts
📜 Review details
⚠️ CI failures not shown inline (3)
GitHub Actions: LiteLLM Smoke / smoke: fix: load extension source for git installs
Conclusion: failure
##[group]Run docker logs litellm-smoke || true
�[36;1mdocker logs litellm-smoke || true�[0m
shell: /usr/bin/bash -e {0}
env:
LITELLM_BASE_URL: http://127.0.0.1:4000
LITELLM_***REDACTED***
LITELLM_MASTER_KEY: sk-ci-litellm-smoke
LITELLM_LICENSE:
LITELLM_DATABASE_URL: ***host.docker.internal:5432/litellm
LITELLM_IMAGE: docker.litellm.ai/berriai/litellm:main-latest
LITELLM_SMOKE_MODELS: vidaimock-openai anthropic/vidaimock-claude
LITELLM_SMOKE_EXPECT_SOURCE: model_info
LITELLM_CLI_SMOKE_MODEL: vidaimock-openai
LITELLM_CLI_SMOKE_MODEL_ANTHROPIC: anthropic/vidaimock-claude
VIDAIMOCK_BASE_URL: http://127.0.0.1:8100
VIDAIMOCK_VERSION: v0.2.7
##[endgroup]
�[92m16:44:03 - LiteLLM Proxy:ERROR�[0m: litellm_license.py:88 - litellm.proxy.auth.litellm_license.py::_verify - Unable to verify License= via api. - Client error '404 Not Found' for url 'https://license.litellm.ai/verify_license/'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
Traceback (most recent call last):
File "/app/.venv/lib/python3.13/site-packages/litellm/proxy/auth/litellm_license.py", line 69, in _verify
response.raise_for_status()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/app/.venv/lib/python3.13/site-packages/httpx/_models.py", line 829, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '404 Not Found' for url 'https://license.litellm.ai/verify_license/'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
INFO: Started server process [1]
INFO: Waiting for application startup.
�[92m16:44:05 - LiteLLM Proxy:ERROR�[0m: litellm_license.py:88 - litellm.proxy.auth.litellm_license.py::_verify - Unable to verify License= via api. - Client error '404 Not Found' for url 'https://license.litellm.ai/verify_license/'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/40...
GitHub Actions: LiteLLM Smoke / smoke: fix: load extension source for git installs
Conclusion: failure
##[group]Run npm test -- tests/terminal-smoke.test.ts
�[36;1mnpm test -- tests/terminal-smoke.test.ts�[0m
shell: /usr/bin/bash -e {0}
env:
LITELLM_BASE_URL: http://127.0.0.1:4000
LITELLM_***REDACTED***
LITELLM_MASTER_KEY: sk-ci-litellm-smoke
LITELLM_LICENSE:
LITELLM_DATABASE_URL: ***host.docker.internal:5432/litellm
LITELLM_IMAGE: docker.litellm.ai/berriai/litellm:main-latest
LITELLM_SMOKE_MODELS: vidaimock-openai anthropic/vidaimock-claude
LITELLM_SMOKE_EXPECT_SOURCE: model_info
LITELLM_CLI_SMOKE_MODEL: vidaimock-openai
LITELLM_CLI_SMOKE_MODEL_ANTHROPIC: anthropic/vidaimock-claude
VIDAIMOCK_BASE_URL: http://127.0.0.1:8100
VIDAIMOCK_VERSION: v0.2.7
LITELLM_DISCOVERY_TIMEOUT_MS: 60000
LITELLM_TERMINAL_SMOKE: 1
PI_CODING_AGENT_DIR: /home/runner/work/_temp/pi-cli-smoke
##[endgroup]
> pi-provider-litellm@2.0.0 test
> vitest --run tests/terminal-smoke.test.ts
�[1m�[30m�[46m RUN �[49m�[39m�[22m �[36mv4.1.10 �[39m�[90m/home/runner/work/pi-provider-litellm/pi-provider-litellm�[39m
�[31m❯�[39m tests/terminal-smoke.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m | �[22m�[31m1 failed�[39m�[2m)�[22m�[33m 1131�[2mms�[22m�[39m
�[32m✓�[39m dismisses command autocomplete without inspecting form values�[32m 2�[2mms�[22m�[39m
�[32m✓�[39m selects Pi's native API-key authentication method�[32m 0�[2mms�[22m�[39m
�[31m �[31m�[31m logs in and selects LiteLLM models�[39m�[33m 1121�[2mms�[22m�[39m
�[31m⎯⎯⎯⎯⎯⎯⎯�[39m�[1m�[41m Failed Tests 1 �[49m�[22m�[31m⎯⎯⎯⎯⎯⎯⎯�[39m
�[41m�[1m FAIL �[22m�[49m tests/terminal-smoke.test.ts�[2m > �[22minteractive Pi terminal smoke�[2m > �[22mlogs in and selects LiteLLM models
�[31m�[1mTerminalControlError�[22m: session ended before visible terminal included "Warning: No models available"�[39m
�[90m �[2m❯�[22m Interface.<anonymous> node_modules/@kitlangton/terminal-control/src/index.ts:�[2m331:25�[22m�[39m
�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯�[22m�[39m
�[2m Test Files �[22m �[1m�[31m1 failed�...
GitHub Actions: LiteLLM Smoke / 0_smoke.txt: fix: load extension source for git installs
Conclusion: failure
##[group]Run npm test -- tests/terminal-smoke.test.ts
�[36;1mnpm test -- tests/terminal-smoke.test.ts�[0m
shell: /usr/bin/bash -e {0}
env:
LITELLM_BASE_URL: http://127.0.0.1:4000
LITELLM_***REDACTED***
LITELLM_MASTER_KEY: sk-ci-litellm-smoke
LITELLM_LICENSE:
LITELLM_DATABASE_URL: ***host.docker.internal:5432/litellm
LITELLM_IMAGE: docker.litellm.ai/berriai/litellm:main-latest
LITELLM_SMOKE_MODELS: vidaimock-openai anthropic/vidaimock-claude
LITELLM_SMOKE_EXPECT_SOURCE: model_info
LITELLM_CLI_SMOKE_MODEL: vidaimock-openai
LITELLM_CLI_SMOKE_MODEL_ANTHROPIC: anthropic/vidaimock-claude
VIDAIMOCK_BASE_URL: http://127.0.0.1:8100
VIDAIMOCK_VERSION: v0.2.7
LITELLM_DISCOVERY_TIMEOUT_MS: 60000
LITELLM_TERMINAL_SMOKE: 1
PI_CODING_AGENT_DIR: /home/runner/work/_temp/pi-cli-smoke
##[endgroup]
> pi-provider-litellm@2.0.0 test
> vitest --run tests/terminal-smoke.test.ts
�[1m�[30m�[46m RUN �[49m�[39m�[22m �[36mv4.1.10 �[39m�[90m/home/runner/work/pi-provider-litellm/pi-provider-litellm�[39m
�[31m❯�[39m tests/terminal-smoke.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m | �[22m�[31m1 failed�[39m�[2m)�[22m�[33m 1131�[2mms�[22m�[39m
�[32m✓�[39m dismisses command autocomplete without inspecting form values�[32m 2�[2mms�[22m�[39m
�[32m✓�[39m selects Pi's native API-key authentication method�[32m 0�[2mms�[22m�[39m
�[31m �[31m�[31m logs in and selects LiteLLM models�[39m�[33m 1121�[2mms�[22m�[39m
�[31m⎯⎯⎯⎯⎯⎯⎯�[39m�[1m�[41m Failed Tests 1 �[49m�[22m�[31m⎯⎯⎯⎯⎯⎯⎯�[39m
�[41m�[1m FAIL �[22m�[49m tests/terminal-smoke.test.ts�[2m > �[22minteractive Pi terminal smoke�[2m > �[22mlogs in and selects LiteLLM models
�[31m�[1mTerminalControlError�[22m: session ended before visible terminal included "Warning: No models available"�[39m
�[90m �[2m❯�[22m Interface.<anonymous> node_modules/@kitlangton/terminal-control/src/index.ts:�[2m331:25�[22m�[39m
�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯�[22m�[39m
�[2m Test Files �[22m �[1m�[31m1 failed�...
🧰 Additional context used
📓 Path-based instructions (5)
tests/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
tests/**/*.test.ts: Keep tests as Vitest specifications undertests/.
Keep regression and feature tests current for discovery fallbacks, compatibility metadata, and Kimi/Moonshot normalization.
Files:
tests/terminal-smoke.test.tstests/package.test.tstests/litellm-smoke-workflow.test.tstests/supply-chain-guard.test.ts
scripts/supply-chain-guard.ts
📄 CodeRabbit inference engine (AGENTS.md)
Reject install lifecycle scripts, runtime dependencies, non-registry specifications, non-registry lockfile URLs, and unexpected package files.
Files:
scripts/supply-chain-guard.ts
package.json
📄 CodeRabbit inference engine (AGENTS.md)
package.json: Keep Git installs loading./src/index.tsthroughpi.extensionsand npm consumers using the compiled./dist/index.jsentrypoint.
Keep the Pi gallery image URL exactly as declared unless explicitly requested to change it.
Limit the npm package tosrc,dist,README.md, andLICENSE; do not include gallery assets unless explicitly requested.
Keeppackage.jsonandpackage-lock.jsonversions synchronized for releases.
Use a tag-drivenv*.*.*release workflow that publishes withnpm publish --access public --provenanceand creates a GitHub release.
Files:
package.json
.github/workflows/*.yml
📄 CodeRabbit inference engine (AGENTS.md)
CI must run
npm ciandnpm run prepublishOnly.
Files:
.github/workflows/litellm-smoke.yml
.github/workflows/litellm-smoke.yml
📄 CodeRabbit inference engine (AGENTS.md)
.github/workflows/litellm-smoke.yml: LiteLLM smoke tests must use VidaiMock and a real LiteLLM proxy without requiring real provider API keys.
Keep smoke readiness probes bounded withcurl --connect-timeout 1 --max-time 3.
Files:
.github/workflows/litellm-smoke.yml
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: penumbral-labs/pi-provider-litellm
Timestamp: 2026-07-28T16:43:25.812Z
Learning: Support Node.js `>=22.19.0`.
Learnt from: CR
Repo: penumbral-labs/pi-provider-litellm
Timestamp: 2026-07-28T16:43:25.812Z
Learning: Use `npm ci` for lockfile-based reinstalls, run `npm test` for the full suite, run `npm run check` before committing changes, and build plus package-check when exported/runtime code or packaging changes.
Learnt from: CR
Repo: penumbral-labs/pi-provider-litellm
Timestamp: 2026-07-28T16:43:25.812Z
Learning: Create only local release commits and tags unless the user explicitly overrides the no-push rule; verify published releases after the user pushes the tag.
🪛 ast-grep (0.44.1)
scripts/supply-chain-guard.ts
[warning] 47-47: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(^dist/(?:${sourceModules})\\.(?:js|d\\.ts)$)
Note: [CWE-1333] Inefficient Regular Expression Complexity
(regexp-from-variable)
[warning] 48-48: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(^src/(?:${sourceModules})\\.ts$)
Note: [CWE-1333] Inefficient Regular Expression Complexity
(regexp-from-variable)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFile } from "node:child_process";
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
🪛 GitHub Actions: LiteLLM Smoke / 0_smoke.txt
tests/terminal-smoke.test.ts
[error] 1-1: Vitest failed: Terminal smoke test 'logs in and selects LiteLLM models' ended before visible terminal included "Warning: No models available". Error: TerminalControlError at node_modules/@kitlangton/terminal-control/src/index.ts:331:25
🪛 GitHub Actions: LiteLLM Smoke / smoke
tests/terminal-smoke.test.ts
[error] 1-1: Vitest failed: TerminalControlError: session ended before visible terminal included "Warning: No models available" (test "logs in and selects LiteLLM models"). Step/command: "npm test -- tests/terminal-smoke.test.ts".
🪛 LanguageTool
AGENTS.md
[style] ~19-~19: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... when changing exported/runtime code. - Use npm run supply-chain:guard and `npm p...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🔇 Additional comments (9)
package.json (1)
10-13: LGTM!Also applies to: 37-39
scripts/supply-chain-guard.ts (1)
43-49: LGTM!tests/supply-chain-guard.test.ts (1)
1-1: LGTM!Also applies to: 84-90, 92-104, 136-136
.github/workflows/litellm-smoke.yml (1)
240-240: LGTM!tests/terminal-smoke.test.ts (1)
10-10: LGTM!tests/litellm-smoke-workflow.test.ts (1)
64-67: LGTM!Also applies to: 185-185
AGENTS.md (1)
8-9: LGTM!Also applies to: 19-21, 22-40, 51-66, 70-74
README.md (1)
5-25: LGTM!Also applies to: 36-59, 68-74, 113-127, 142-144, 154-185, 194-221, 233-234, 243-274
tests/package.test.ts (1)
40-40: LGTM!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23ae023f69
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/gcloud-token.ts`:
- Around line 48-50: Update the CLI path resolution around the extension
selection and gcloud-token CLI launch so the TypeScript source path remains
loadable when gcloud-token-cli.ts runs directly. Ensure its dependency import
resolves to the available source module, while preserving the built-JavaScript
launch behavior.
In `@tests/gcloud-token.test.ts`:
- Around line 36-40: Extend the getGcloudTokenCommand tests to exercise the
compiled-package branch that selects the JavaScript helper, while preserving the
existing source-mode assertion for gcloud-token-cli.ts. If the branch depends on
runtime extension detection, isolate or control that condition so both
TypeScript and JavaScript paths can be tested deterministically.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 18fe29d8-0e2e-4181-b3a6-69b65c28b900
📒 Files selected for processing (6)
.github/workflows/litellm-smoke.ymlsrc/gcloud-token.tssrc/provider.tstests/gcloud-token.test.tstests/litellm-smoke-workflow.test.tstests/provider.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: smoke
🧰 Additional context used
📓 Path-based instructions (6)
tests/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests as Vitest specification files under
tests/.
Files:
tests/gcloud-token.test.tstests/litellm-smoke-workflow.test.tstests/provider.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run the full test suite with
npm test; usenpm test -- tests/<file>.test.tsfor focused Vitest runs.
Files:
tests/gcloud-token.test.tssrc/gcloud-token.tssrc/provider.tstests/litellm-smoke-workflow.test.tstests/provider.test.ts
**/*.{ts,tsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Run
npm run checkbefore committing code changes; it runs Biome, typechecking, and tests.
Files:
tests/gcloud-token.test.tssrc/gcloud-token.tssrc/provider.tstests/litellm-smoke-workflow.test.tstests/provider.test.ts
.github/workflows/*.yml
📄 CodeRabbit inference engine (AGENTS.md)
CI must run
npm ciandnpm run prepublishOnly.
Files:
.github/workflows/litellm-smoke.yml
.github/workflows/litellm-smoke.yml
📄 CodeRabbit inference engine (AGENTS.md)
.github/workflows/litellm-smoke.yml: The LiteLLM smoke workflow must use VidaiMock and a real LiteLLM proxy without requiring real provider API keys.
Keep smoke readiness probes bounded withcurl --connect-timeout 1 --max-time 3.
Files:
.github/workflows/litellm-smoke.yml
src/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.ts: Keep Pi extension source as TypeScript ESM undersrc/; thelitellmprovider is registered fromsrc/index.ts.
Model discovery lives insrc/discover.ts; prefer/model/infofor rich metadata and fall back to/v1/modelsonly for HTTP 401, 403, or 404.
Keep/v1/modelsfallback metadata enrichment from the Pi catalog andhttps://models.dev/api.jsoncovered by current tests.
Preserve documented behavior forLITELLM_OFFLINEandLITELLM_DISCOVERY_TIMEOUT_MS.
Stored Pi/login litellmcredentials take precedence overLITELLM_API_KEY.
Store cache data aslitellm-models.jsonunder the Pi agent directory, keyed by an API-key fingerprint, with a 24-hour stale refresh window.
In the globalbefore_provider_requesthook, mutate provider payloads only whenctx.model?.provider === "litellm".
Do not add user-facing flags or environment variables to hide provider-scoping bugs.
Treatlitellm_session_idas optional LiteLLM session metadata; if LiteLLM-routed requests reject it, preserve Pi requests and document the admin recommendation separately.
Normalize Kimi/Moonshot<think>text for Pi in themessage_endhook and maintain feature-test coverage.
Put provider-specific request compatibility in discovered modelcompatmetadata rather than broad runtime mutation.
Handle Kimi/Moonshot-style models inbuildCompat()and keep regression tests with model discovery changes.
SetcacheControlFormat: "anthropic"for Anthropic-backed aliases so Pi forwards prompt-cache markers through LiteLLM.
Files:
src/gcloud-token.tssrc/provider.ts
🔇 Additional comments (5)
tests/gcloud-token.test.ts (1)
5-5: LGTM!src/provider.ts (1)
1-9: LGTM!tests/provider.test.ts (1)
14-17: LGTM!.github/workflows/litellm-smoke.yml (1)
55-55: LGTM!Also applies to: 224-240
tests/litellm-smoke-workflow.test.ts (1)
60-67: LGTM!Also applies to: 185-185
Summary
src/index.tsfor Git-based installsdistoutput for conventional npm imports without committing generated filesProblem
pi install git:github.com/penumbral-labs/pi-provider-litellmcloned a repository whose Pi manifest referenceddist/index.js, butdist/is gitignored and npm's install step does not run the publish build. Pi therefore loaded no extension: the LiteLLM provider, login flow, and discovered models were absent.Verification
npm run check— 227 passed, 1 skippednpm run supply-chain:guardnpm pack --dry-runnpm install --omit=dev, nodist/, loaded viapi -e .; LiteLLM provider discovery executed through the package manifestSummary by CodeRabbit
New Features
src) rather than the built artifact.Documentation
Tests
Chores / Refactor