feat(langchain): add LC-021, LC-022 TypeScript description quality rules - #93
Open
bradAGI wants to merge 1 commit into
Open
feat(langchain): add LC-021, LC-022 TypeScript description quality rules#93bradAGI wants to merge 1 commit into
bradAGI wants to merge 1 commit into
Conversation
The TypeScript counterpart to LC-018/019. LC-010 only checks that a description exists, so a tool described "TODO: describe this tool." or "Gets data." passes today while giving the model no selection signal. LangChain.js has no docstring to fall back on, so the description field is the entire account of the tool the model sees, and the Zod schema does not compensate — it constrains the arguments once the model has chosen this tool, never whether choosing it was right. Mis-selection scales badly here because an agent is routinely handed a dozen or more tools at once, and each wrong pick spends an iteration against the maxIterations bound LC-111 checks for.
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.
The TypeScript counterpart to LC-018/019 (#66). LC-010 only checks that a description exists, so a tool described
"TODO: describe this tool."or"Gets data."passes today while giving the model no selection signal.Three points, in the order they bite:
descriptionfield, so it's the entire account of the tool the model sees — unlike the Python side, where a thin description at least sits next to readable source.maxIterationsbound LC-111 checks for — so a run can exhaust its step budget and return nothing useful.Verification — engine built at
main:Fire (one
tool(...)described"TODO: describe this tool.", one"Gets data."):LC-021, LC-022, LC-201Silent (full description naming when to prefer the neighboring tool):
LC-201(LC-201 is the pre-existing missing-AGENTS.md repo rule.)
LC-022 pairs
description_length_lt: 40withhas_docstring: trueso it doesn't double-report against LC-010 on an empty description, same as CSDK-018.No new predicates, so no
schema_versionbump.Merge note: this and #66 both append to
langchain/tool_definition.yaml, so whichever lands second needs a trivial rebase — the rule blocks are independent and the resolution is "keep both." Happy to rebase on request.