feat(langchain): add LC-021, LC-022 TypeScript description quality rules - #93
feat(langchain): add LC-021, LC-022 TypeScript description quality rules#93bradAGI 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.
|
Thanks @bradAGI, this is a clean one. Checking both rules against The engine half in trustabl/trustabl#171 mirrors this file byte for byte (both sides land on the same blob hash), so One thought rather than a blocker: Before this ships it needs a rationale doc in |
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.