Skip to content

Fix minor typos and improve backtick consistency - #853

Merged
sholladay merged 8 commits into
sindresorhus:mainfrom
Vegapunk-debug:main
Apr 4, 2026
Merged

Fix minor typos and improve backtick consistency#853
sholladay merged 8 commits into
sindresorhus:mainfrom
Vegapunk-debug:main

Conversation

@Vegapunk-debug

Copy link
Copy Markdown
Contributor

Fix minor typos and improve documentation consistency

Description

This PR addresses several minor typos and consistency issues in the ky documentation and source code comments to ensure a high-quality, professional appearance and better readability:

  • Standardized Terminology: Corrected "Ky-instances" to "Ky instances" in the readme.md and type definitions for better style consistency.
  • Improved Syntax Highlighting: Added missing backticks to key code symbols like response and undefined in readme.md code block comments.
  • Professional JSDoc Formatting: Added missing backticks to internal error class names (KyError, HTTPError, NetworkError, TimeoutError, and ForceRetryError) in source/utils/type-guards.ts and source/core/Ky.ts comments.

Type of Change

  • Documentation update (non-breaking change; fixes typos and formatting)

Checklist

  • My changes follow the code style of this project.
  • I have performed a self-review of my own changes.
  • My changes generate no new warnings.

Thank You!

@Vegapunk-debug

Vegapunk-debug commented Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

@sindresorhus @sholladay , could you please review my PR

@sindresorhus

Copy link
Copy Markdown
Owner

You missed one place. In source/types/options.ts:140

@Vegapunk-debug

Copy link
Copy Markdown
Contributor Author

@sindresorhus done

@sholladay sholladay changed the title docs: fix minor typos and improve backtick consistency Fix minor typos and improve backtick consistency Apr 4, 2026
@sholladay
sholladay merged commit a376fc4 into sindresorhus:main Apr 4, 2026
3 checks passed
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>
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.

3 participants