Skip to content

fix: cap OpenAI-compatible output tokens - #662

Open
Rayan Salhab (cyphercodes) wants to merge 1 commit into
langchain-ai:mainfrom
cyphercodes:cyphercodes/openwiki-648-openai-compatible-max-tokens
Open

fix: cap OpenAI-compatible output tokens#662
Rayan Salhab (cyphercodes) wants to merge 1 commit into
langchain-ai:mainfrom
cyphercodes:cyphercodes/openwiki-648-openai-compatible-max-tokens

Conversation

@cyphercodes

Copy link
Copy Markdown

Summary

  • Add OPENWIKI_OPENAI_COMPATIBLE_MAX_TOKENS for OpenAI-compatible/local endpoints.
  • Pass the configured cap through to ChatOpenAI as maxTokens while preserving the current default when unset.
  • Document the setting and add a patch changeset.

Fixes #648

Testing

  • pnpm exec vitest run test/config/constants.test.ts test/agent/create-model.test.ts test/config/env-behavior.test.ts
  • pnpm exec prettier --check README.md src/agent/index.ts src/config/constants.ts src/config/env.ts test/agent/create-model.test.ts test/config/constants.test.ts test/config/env-behavior.test.ts .changeset/local-llamas-dance.md
  • pnpm exec eslint src/agent/index.ts src/config/constants.ts src/config/env.ts test/agent/create-model.test.ts test/config/constants.test.ts test/config/env-behavior.test.ts
  • pnpm run typecheck
  • pnpm test

AI assistance was used to prepare this focused change.

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6a8c403

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openwiki Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

[Bug]: Exceeds the available context size

1 participant