You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor: switch to first-party provider dispatch; fix agent finalization and rescue crash
A production run of PR-Lens failed with two compounding defects:
1. The ToolLoopAgent exhausted its 12-step budget without calling submit_report.
2. The rescue path then crashed with AI_NoObjectGeneratedError because the
generic @ai-sdk/openai-compatible provider was created without
supportsStructuredOutputs, so `Output.object({ schema })` silently sent the
schema-less response_format and the model returned text that didn't parse.
Rather than paper over (2) with a capability flag and keep the generic BYO
wrapper for every provider, this change pivots to provider-name dispatch:
users pass llm-provider = openai | anthropic | deepseek | google | groq |
mistral | xai | openrouter | openai-compatible, and each branch uses the
respective first-party @ai-sdk/* package which already knows its own
capability shape.
Other fixes in the same pass:
- Add prepareStep to force `submit_report` on the final allowed step, so
stopWhen: hasToolCall('submit_report') fires by construction and the rescue
becomes a true safety net rather than a normal fallback.
- Simplify rescue to a single generateText + Output.object call against
VerifyReportSchema directly. Delete the repairJson / Lenient-schema / alias-
normalisation layers and the @qraftr/json-repair dependency — structured
outputs guarantee the exact Zod shape.
- Keep @ai-sdk/openai-compatible as the explicit escape hatch
(llm-provider: openai-compatible) with supportsStructuredOutputs + includeUsage.
- Bump LanguageModelV2 → LanguageModelV3 everywhere; all provider SDKs at v3.x
implement V3.
- Fix .gitignore so dist/ actually ships (previous ignore line contradicted the
comment right below it and the README's stated intent).
Breaking change: existing workflows must add `llm-provider:` and drop
`llm-base-url:` unless they're using an OpenAI-compatible self-hosted endpoint.
README and self-test workflow updated accordingly.
Smoke-tested end-to-end against sindresorhus/ky#853 via Moonshot kimi-k2.5
(openai-compatible branch): 7 steps, submittedViaTool=true, 15k tokens, no
warnings.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* ci: keep dist/ gitignored on main and pin Bun version
Previous commit mistakenly committed dist/index.js and un-ignored dist/.
release.yml's header comment clearly states dist/ is gitignored on main and
built+committed onto the tag commit at release time — that's the actual
design. CI's `git diff --exit-code dist/` then kept failing on PRs because
`bun run build --minify` output is not byte-stable across Bun versions (my
local canary produced one bundle, CI's bun@latest produced another).
Fixes:
- Restore `dist/` to .gitignore; clarify the comment so nobody repeats my
mistake. `git rm --cached dist/index.js` to untrack the accidental commit.
- Pin CI and Release workflows to `bun-version: 1.3.12` so the bundle that
ships at a tag matches what future CI would validate on PRs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* ci: build dist/ in the self-test job before dogfooding the action
Self-test was referencing `uses: ./` without dist/index.js present on the PR
branch (dist is gitignored on main — only built at release-tag time). Add a
bun install + bun run build step so the action bundle exists when the action
step runs. Uses the same pinned Bun version as ci.yml and release.yml.
This bug was latent in the initial commit but hadn't been hit before because
there were no PRs against the repo yet.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+69-21Lines changed: 69 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,40 +32,88 @@ It is intentionally orthogonal to code-review bots. It answers *"what should a h
32
32
with: { fetch-depth: 0 }
33
33
- uses: Iris-Ares/pr-lens-github-actions@v0
34
34
with:
35
-
llm-base-url: ${{ secrets.LLM_BASE_URL }}
35
+
llm-provider: openai
36
36
llm-api-key: ${{ secrets.LLM_API_KEY }}
37
-
llm-model: gpt-4o
37
+
llm-model: gpt-4.1
38
38
```
39
39
40
40
2. Store your provider credentials as repo secrets:
41
-
- `LLM_BASE_URL` — any OpenAI-compatible endpoint (e.g. `https://api.openai.com/v1`, `https://api.deepseek.com/v1`, `https://openrouter.ai/api/v1`, or a local `https://vllm.internal/v1`).
42
-
- `LLM_API_KEY`— the API key for that endpoint.
41
+
- `LLM_API_KEY` — the API key for the provider you picked.
43
42
44
43
3. (Optional) Seed a starter memory file at `.pr-lens/business.md` with your project's domain glossary. The agent will read from it and propose additions over time.
0 commit comments