langchain-ai/langchainjs

12 rules learned from 999 merged PRs: the files and habits in langchain-ai/langchainjs that kept needing a fix after merge.

Merged PRs read
999
Needed a fix
86 (8.6%)
Reverted
4
Merged between
2025-12-22 and 2026-11-10

Tested on PRs the rules had never seen

6 of the 17 code PRs that breached a rule needed a fix (35%), against 5 of the 54 that breached none (9%).

Rules were learned from older PRs, then tested on later PRs they hadn't seen. How we tested

PRTitle and the rule it breachedWhat happened
fix(langchain): avoid full-state copies in parallel tool tasksHotspot: libs/langchain/src/agents/ReactAgent.ts (6 of 18 earlier PRs needed a fix) fixed in #12043, 5 days later
fix(google): support Argon thinking and preserve streaming usageHotspot: libs/providers/langchain-google/src/chat_models/base.ts (5 of 20 earlier PRs needed a fix) reverted, fixed in #11958, same day
feat(openai): support explicit prompt cachingHotspot: libs/providers/langchain-openai/src/converters/completions.ts (3 of 9 earlier PRs needed a fix) fixed in #11735, same day

Fix-prone files and folders

PRs that touched these paths needed a follow-up fix more often than the 9% repo average. Counts are PRs that touched the path.

  1. Hotspot: libs/langchain/src/agents/index.ts

    5 of 9 earlier PRs that changed this needed a fix.

    4 clean, 5 fixed (56%)
  2. Hotspot: libs/langchain/src/agents/utils.ts

    4 of 10 earlier PRs that changed this needed a fix.

    6 clean, 4 fixed (40%)
  3. Hotspot: libs/langchain/src/agents/ReactAgent.ts

    9 of 23 earlier PRs that changed this needed a fix.

    14 clean, 9 fixed (39%)
  4. Hotspot: libs/langchain-core/src/messages/base.ts

    5 of 13 earlier PRs that changed this needed a fix.

    8 clean, 5 fixed (38%)
  5. Hotspot: libs/providers/langchain-openai/src/converters/completions.ts

    5 of 13 earlier PRs that changed this needed a fix.

    8 clean, 5 fixed (38%)
  6. Hotspot: libs/langchain/src/agents/nodes/AgentNode.ts

    7 of 21 earlier PRs that changed this needed a fix.

    14 clean, 7 fixed (33%)
  7. Hotspot: libs/providers/langchain-anthropic/src/chat_models.ts

    10 of 31 earlier PRs that changed this needed a fix.

    21 clean, 10 fixed (32%)
  8. Hotspot: libs/providers/langchain-anthropic/src/utils/message_inputs.ts

    4 of 13 earlier PRs that changed this needed a fix.

    9 clean, 4 fixed (31%)
  9. Hotspot: libs/providers/langchain-openai/src/chat_models/completions.ts

    3 of 11 earlier PRs that changed this needed a fix.

    8 clean, 3 fixed (27%)
  10. Hotspot: libs/providers/langchain-openai/src/converters/responses.ts

    7 of 29 earlier PRs that changed this needed a fix.

    22 clean, 7 fixed (24%)
  11. Hotspot: libs/providers/langchain-google/src/chat_models/base.ts

    6 of 27 earlier PRs that changed this needed a fix.

    21 clean, 6 fixed (22%)

Conventions

Habits most PRs here follow, where PRs that broke them needed a fix more often. Counts on each bar are the PRs that broke it.

  1. Titles follow "Conventional Commits (type(scope): summary)"

    97% of PR titles follow it. 4 of 24 earlier PRs that broke it needed a fix, and 82 of 919 that followed it.

    broken: 20 clean, 4 fixed (17%)

Recent PRs that needed a fix

Rules flagged 73 recent PRs, and 15 of those needed a fix (21%), against 8% of all recent PRs. These are the 13 that needed a fix, with the PR that fixed each.

PRTitleSizeRule it breachedWhat happened
fix(langchain): preserve agent graph callbacks +178 -14 touches libs/langchain/src/agents/utils.ts6 clean, 4 fixed fixed in #11712, 3 days later
feat(langchain): surface tool-dispatched subagents on run.subagents +1,003 -175 touches libs/langchain/src/agents/ReactAgent.ts14 clean, 9 fixed fixed in #11087, 4 days later
fix(langchain): avoid full-state copies in parallel tool tasks +183 -10 touches libs/langchain/src/agents/ReactAgent.ts14 clean, 9 fixed fixed in #12043, 5 days later
fix(langchain): return failed returnDirect tool calls to the model +112 -2 touches libs/langchain/src/agents/ReactAgent.ts14 clean, 9 fixed fixed in #11880, 13 days later
feat(openai): support explicit prompt caching +553 -29 touches libs/providers/langchain-openai/src/converters/completions.ts8 clean, 5 fixed fixed in #11735, same day
fix(openai): drop Gemini functionCall content blocks in Chat Completions message conversion +57 -3 touches libs/providers/langchain-openai/src/converters/completions.ts8 clean, 5 fixed fixed in #11419, 1 day later
fix(openai): include usage in response_metadata when system_fingerprint is absent +36 -4 touches libs/providers/langchain-openai/src/converters/completions.ts8 clean, 5 fixed fixed in #11403, 7 days later
feat(anthropic): add mythos 5 and fable 5 support +273 -103 touches libs/providers/langchain-anthropic/src/chat_models.ts21 clean, 10 fixed fixed in #11073, 13 days later
feat(anthropic): add Claude Opus 5 support +125 -190 touches libs/providers/langchain-anthropic/src/chat_models.ts21 clean, 10 fixed fixed in #11278, 7 days later
fix(core): redact MCP tracing credentials +241 -6 touches libs/providers/langchain-anthropic/src/chat_models.ts21 clean, 10 fixed fixed in #11310, 5 days later
fix(openai): retain cache_write_tokens, update to v7 sdk +321 -20 touches libs/providers/langchain-openai/src/chat_models/completions.ts8 clean, 3 fixed fixed in #11448, 6 days later
fix(google): support Argon thinking and preserve streaming usage +140 -1 touches libs/providers/langchain-google/src/chat_models/base.ts21 clean, 6 fixed reverted
fix(google): route Vertex multi-region endpoints +44 -0 touches libs/providers/langchain-google/src/chat_models/base.ts21 clean, 6 fixed fixed in #11611, same day

Get this for your own repo

Precall reads your repo's history the same way and comments on new PRs that touch the spots that kept breaking. Download the rules file for langchain-ai/langchainjs.