Skip to content

fix: load extension source for git installs - #2

Merged
aasmall merged 5 commits into
mainfrom
fix/git-install-artifacts
Jul 28, 2026
Merged

aasmall merged 5 commits into
mainfrom
fix/git-install-artifacts

Conversation

@aasmall

@aasmall aasmall commented Jul 28, 2026 •

Copy link
Copy Markdown

Summary

  • load the Pi extension directly from src/index.ts for Git-based installs
  • make the Penumbral Labs Git fork the documented installation path
  • exercise package-manifest resolution in CLI and terminal smoke tests
  • retain compiled dist output for conventional npm imports without committing generated files

Problem

pi install git:github.com/penumbral-labs/pi-provider-litellm cloned a repository whose Pi manifest referenced dist/index.js, but dist/ 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 skipped
  • npm run supply-chain:guard
  • npm pack --dry-run
  • fresh clone with npm install --omit=dev, no dist/, loaded via pi -e .; LiteLLM provider discovery executed through the package manifest

Summary by CodeRabbit

  • New Features

    • Git-based installations and Pi terminal/CLI smoke checks now load the extension from the source entrypoint (src) rather than the built artifact.
    • Published packages now include source files needed for Pi integration.
  • Documentation

    • Updated installation, SSO, provider configuration, environment-variable reference, discovery/caching behavior, and optional feature toggles (including required restart guidance).
    • Expanded troubleshooting and release/packaging guidance, including packaging verification and credential/scoping notes.
  • Tests

    • Adjusted smoke, compatibility, packaging, and supply-chain guard checks to validate the new source-based entrypoint and package contents.
  • Chores / Refactor

    • Improved supply-chain policy generation and token command extension handling.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 17 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ede6c1cb-dfd6-4f53-ad3c-570a7ef5dd14

📥 Commits

Reviewing files that changed from the base of the PR and between 23ae023 and de9bdd1.

📒 Files selected for processing (2)
  • src/gcloud-token.ts
  • tests/gcloud-token.test.ts
📝 Walkthrough

Walkthrough

The PR changes Pi Git-install loading to use src/index.ts, expands package contents and supply-chain validation, updates smoke commands and runtime compatibility, and revises README and agent guidance for authentication, discovery, features, smoke coverage, and packaging.

Changes

Source Entrypoint and Packaging

Layer / File(s) Summary
Entrypoint and package policy
package.json, scripts/supply-chain-guard.ts, tests/supply-chain-guard.test.ts
Pi metadata references ./src/index.ts; package whitelists and supply-chain rules include source files, with manifest and fixture tests updated.
Source runtime compatibility
src/gcloud-token.ts, src/provider.ts, tests/gcloud-token.test.ts, tests/provider.test.ts
Source execution selects the TypeScript token helper and provider APIs use the consolidated compatibility import, with matching tests and mocks.
Smoke entrypoint wiring
.github/workflows/litellm-smoke.yml, tests/litellm-smoke-workflow.test.ts, tests/terminal-smoke.test.ts
CLI and terminal smoke paths load the project root, with tests asserting the updated entrypoint and rejecting the prior compiled-file form.
Operational and user documentation
AGENTS.md, README.md, tests/package.test.ts
Documentation covers source loading, credentials, discovery, feature toggles, smoke coverage, troubleshooting, and packaging; README assertions tolerate formatting changes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

I’m a rabbit with a source-root guide,
Hopping where Pi’s entrypoints reside.
Smoke tests sparkle, package rules grow,
Credentials and docs now clearly show.
src leads the way—hip hop, hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: loading the extension from source for Git installs instead of the built artifact.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/git-install-artifacts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread package.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0a893ab and 9da506f.

📒 Files selected for processing (9)
  • .github/workflows/litellm-smoke.yml
  • AGENTS.md
  • README.md
  • package.json
  • scripts/supply-chain-guard.ts
  • tests/litellm-smoke-workflow.test.ts
  • tests/package.test.ts
  • tests/supply-chain-guard.test.ts
  • tests/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

View job details

##[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

View job details

##[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

View job details

##[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 under tests/.
Keep regression and feature tests current for discovery fallbacks, compatibility metadata, and Kimi/Moonshot normalization.

Files:

  • tests/terminal-smoke.test.ts
  • tests/package.test.ts
  • tests/litellm-smoke-workflow.test.ts
  • tests/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.ts through pi.extensions and npm consumers using the compiled ./dist/index.js entrypoint.
Keep the Pi gallery image URL exactly as declared unless explicitly requested to change it.
Limit the npm package to src, dist, README.md, and LICENSE; do not include gallery assets unless explicitly requested.
Keep package.json and package-lock.json versions synchronized for releases.
Use a tag-driven v*.*.* release workflow that publishes with npm publish --access public --provenance and creates a GitHub release.

Files:

  • package.json
.github/workflows/*.yml

📄 CodeRabbit inference engine (AGENTS.md)

CI must run npm ci and npm 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 with curl --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!

Comment thread .github/workflows/litellm-smoke.yml
Comment thread package.json

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/gcloud-token.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e569156 and 23ae023.

📒 Files selected for processing (6)
  • .github/workflows/litellm-smoke.yml
  • src/gcloud-token.ts
  • src/provider.ts
  • tests/gcloud-token.test.ts
  • tests/litellm-smoke-workflow.test.ts
  • tests/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.ts
  • tests/litellm-smoke-workflow.test.ts
  • tests/provider.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run the full test suite with npm test; use npm test -- tests/<file>.test.ts for focused Vitest runs.

Files:

  • tests/gcloud-token.test.ts
  • src/gcloud-token.ts
  • src/provider.ts
  • tests/litellm-smoke-workflow.test.ts
  • tests/provider.test.ts
**/*.{ts,tsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Run npm run check before committing code changes; it runs Biome, typechecking, and tests.

Files:

  • tests/gcloud-token.test.ts
  • src/gcloud-token.ts
  • src/provider.ts
  • tests/litellm-smoke-workflow.test.ts
  • tests/provider.test.ts
.github/workflows/*.yml

📄 CodeRabbit inference engine (AGENTS.md)

CI must run npm ci and npm 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 with curl --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 under src/; the litellm provider is registered from src/index.ts.
Model discovery lives in src/discover.ts; prefer /model/info for rich metadata and fall back to /v1/models only for HTTP 401, 403, or 404.
Keep /v1/models fallback metadata enrichment from the Pi catalog and https://models.dev/api.json covered by current tests.
Preserve documented behavior for LITELLM_OFFLINE and LITELLM_DISCOVERY_TIMEOUT_MS.
Stored Pi /login litellm credentials take precedence over LITELLM_API_KEY.
Store cache data as litellm-models.json under the Pi agent directory, keyed by an API-key fingerprint, with a 24-hour stale refresh window.
In the global before_provider_request hook, mutate provider payloads only when ctx.model?.provider === "litellm".
Do not add user-facing flags or environment variables to hide provider-scoping bugs.
Treat litellm_session_id as 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 the message_end hook and maintain feature-test coverage.
Put provider-specific request compatibility in discovered model compat metadata rather than broad runtime mutation.
Handle Kimi/Moonshot-style models in buildCompat() and keep regression tests with model discovery changes.
Set cacheControlFormat: "anthropic" for Anthropic-backed aliases so Pi forwards prompt-cache markers through LiteLLM.

Files:

  • src/gcloud-token.ts
  • src/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

Comment thread src/gcloud-token.ts Outdated
Comment thread tests/gcloud-token.test.ts
@aasmall
aasmall merged commit 5795d04 into main Jul 28, 2026
3 checks passed
@aasmall
aasmall deleted the fix/git-install-artifacts branch July 29, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant