Fix minor typos and improve backtick consistency - #853
Merged
Conversation
Contributor
Author
|
@sindresorhus @sholladay , could you please review my PR |
Owner
|
You missed one place. In source/types/options.ts:140 |
Contributor
Author
|
@sindresorhus done |
Iris-Ares
added a commit
to Iris-Ares/pr-lens-github-actions
that referenced
this pull request
Apr 14, 2026
…tion 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>
Iris-Ares
added a commit
to Iris-Ares/pr-lens-github-actions
that referenced
this pull request
Apr 15, 2026
…crash (#1) * 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix minor typos and improve documentation consistency
Description
This PR addresses several minor typos and consistency issues in the
kydocumentation and source code comments to ensure a high-quality, professional appearance and better readability:readme.mdand type definitions for better style consistency.responseandundefinedinreadme.mdcode block comments.KyError,HTTPError,NetworkError,TimeoutError, andForceRetryError) insource/utils/type-guards.tsandsource/core/Ky.tscomments.Type of Change
Checklist
Thank You!