Skip to content

fixes - #27

Merged
balureddy003 merged 1 commit into
mainfrom
upstream-sync
Mar 2, 2026
Merged

fixes#27
balureddy003 merged 1 commit into
mainfrom
upstream-sync

Conversation

@balureddy003

Copy link
Copy Markdown

Pull Request Template

⚠️ Before Submitting a PR, Please Review:

  • Please ensure that you have thoroughly read and understood the Contributing Docs before submitting your Pull Request.

⚠️ Documentation Updates Notice:

  • Kindly note that documentation updates are managed in this repository: librechat.ai

Summary

Please provide a brief summary of your changes and the related issue. Include any motivation and context that is relevant to your changes. If there are any dependencies necessary for your changes, please list them here.

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Translation update

Testing

Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

Copilot AI review requested due to automatic review settings March 2, 2026 02:34
@balureddy003
balureddy003 merged commit 5d0dcda into main Mar 2, 2026
2 of 5 checks passed
@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown

🚨 Unused NPM Packages Detected

The following unused dependencies were found:

📂 Root package.json

  • @opentelemetry/api
  • @opentelemetry/core
  • @opentelemetry/exporter-trace-otlp-http
  • @opentelemetry/sdk-node
  • oauth4webapi

📂 Client client/package.json

  • @codemirror/commands
  • @codemirror/lang-css
  • @codemirror/lang-html
  • @codemirror/lang-javascript
  • @codemirror/language
  • @codemirror/language-data
  • @codemirror/lint
  • @codemirror/search
  • @codemirror/state
  • @lezer/highlight
  • @react-hook/intersection-observer
  • @react-hook/window-size
  • @stitches/core
  • anser
  • clean-set
  • dequal
  • escape-carriage
  • lz-string
  • react-devtools-inline
  • react-is

📂 API api/package.json

  • @langchain/google-genai
  • @langchain/google-vertexai
  • @langchain/textsplitters
  • compressible
  • xml-crypto
  • xml-encryption
  • xml2js

⚠️ Please remove these unused dependencies to keep your project clean.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens Woodland agent behavior by improving result ranking/ambiguity handling in the Product/Engine history tools, expanding routing/validation guardrails in the supervisor router, and refining tractor query normalization—along with config and test-result updates.

Changes:

  • Add/adjust scoring + “needs human review” gating for ambiguous/low-confidence matches in Woodland Product/Engine history tools.
  • Expand supervisor router keyword rules and add output validation guardrails for unsupported claims without citations.
  • Update Azure Search MCP config to use an env-provided index name and update related environment/test artifacts.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/agents/woodland/results/accuracy_report.json Updates recorded timing metrics for Woodland test runs.
librechat.yaml Changes Azure Search MCP server index name from hardcoded to env-driven.
api/app/clients/tools/structured/WoodlandProductHistory.js Adjusts attribute match scoring and adds additional “needs review” heuristics.
api/app/clients/tools/structured/WoodlandEngineHistory.js Adds signal extraction + ranking/filtering and new “needs review” conditions.
api/app/clients/tools/structured/WoodlandAISearchTractor.js Improves abbreviation/deck-size normalization and make/model extraction for multi-word brands.
api/app/clients/agents/Woodland/supervisorRouterAgent.js Expands routing rules and adds validation warnings + guardrail behavior for unsupported/citationless claims.
api/app/clients/agents/Woodland/promptTemplates.js Adds stricter instruction about not stating specifics without tool evidence.
api/app/clients/agents/Woodland/cyclopediaSupportAgent.js Makes procedural safety import “optional” with a safe fallback.
api/app/clients/agents/Functions/initializeFunctionsAgent.js Adds a test-mode fallback output path for tool invocation.
.env Large env update including concrete secrets/credentials and formatting changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +8 to +9
} catch (_) {
// leave safe fallback

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The procedural safety classifier module exists in-repo (../../tools/structured/util/proceduralSafety), but this change silently swallows all require-time errors and falls back to treating everything as safe. If the module throws due to a regression, you’ll disable the technician-only escalation path without noticing. Catch only MODULE_NOT_FOUND (and log loudly when falling back), and rethrow other errors so safety checks can’t fail open.

Suggested change
} catch (_) {
// leave safe fallback
} catch (error) {
if (error && error.code === 'MODULE_NOT_FOUND') {
// eslint-disable-next-line no-console
console.warn('[CyclopediaSupportAgent] proceduralSafety module not found; using safe fallback classifier.', error);
} else {
throw error;
}

Copilot uses AI. Check for mistakes.
- If confidence is Low, state "needs human review" instead of guessing
- Cite specific evidence for claims (SKU numbers, article titles, case IDs)
- Do not state exact warranties, bundle composition/counts, pricing, blade sizes, or universal-fit claims unless directly returned by the selected domain tool response.
- If a customer asks for those exact specifics and tool output is incomplete, ask one clarifying anchor question or escalate with "needs human review.".

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s a punctuation/grammar error: the sentence ends with an extra period after the closing quote (..."needs human review.".). Remove the trailing period (and consider whether you want the period inside the quotes).

Suggested change
- If a customer asks for those exact specifics and tool output is incomplete, ask one clarifying anchor question or escalate with "needs human review.".
- If a customer asks for those exact specifics and tool output is incomplete, ask one clarifying anchor question or escalate with "needs human review".

Copilot uses AI. Check for mistakes.
Comment on lines +776 to +799
const requestedSignals = this._buildRequestedSignals(input);
const { ranked, activeSignalCount, topScore, ambiguous } = this._rankAndFilterResults(
results,
requestedSignals,
);

if (activeSignalCount > 0 && topScore <= 0) {
return this._serializeNeedsReview(
'NEEDS_HUMAN_REVIEW: No confident engine-history match for the provided model/engine cues.',
);
}

if (
!requestedSignals.isAttributeLookup &&
activeSignalCount >= 2 &&
ambiguous &&
topScore < 4
) {
return this._serializeNeedsReview(
'NEEDS_HUMAN_REVIEW: Multiple close engine matches found; please confirm one deciding cue (engine label exact model, horsepower, or rake model/year).',
);
}

return this._serializeSuccess(ranked, top);

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New result-ranking / ambiguity handling introduces additional NEEDS_HUMAN_REVIEW branches (e.g., topScore <= 0, ambiguous && topScore < 4). There are Jest prompt-scenario tests for EngineHistory, but none assert these new branches, so regressions here are likely to slip through. Add/extend tests to cover at least (1) zero-score with active signals, and (2) ambiguous close-match behavior.

Copilot uses AI. Check for mistakes.
Comment thread librechat.yaml
AZURE_SEARCH_ENDPOINT: "${AZURE_AI_SEARCH_SERVICE_ENDPOINT}"
AZURE_SEARCH_KEY: "${AZURE_AI_SEARCH_API_KEY}"
AZURE_SEARCH_INDEX_NAME: "wpp-knowledge-test-encyclopedia"
AZURE_SEARCH_INDEX_NAME: "${AZURE_AI_SEARCH_Encyclopedia_Index}"

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Azure Search MCP server now references ${AZURE_AI_SEARCH_Encyclopedia_Index}, but that env var does not exist in .env.example (and this repo already defines AZURE_AI_SEARCH_CYCLOPEDIA_INDEX, ..._WEBSITE_INDEX, etc.). This will resolve to an empty index name by default and break the MCP server at runtime. Use an existing variable name (e.g., AZURE_AI_SEARCH_CYCLOPEDIA_INDEX / a dedicated AZURE_AI_SEARCH_FAQ_INDEX) and add it to .env.example if it’s new.

Suggested change
AZURE_SEARCH_INDEX_NAME: "${AZURE_AI_SEARCH_Encyclopedia_Index}"
AZURE_SEARCH_INDEX_NAME: "${AZURE_AI_SEARCH_CYCLOPEDIA_INDEX}"

Copilot uses AI. Check for mistakes.
Comment thread .env



MONGO_URI=mongodb+srv://wppuser:3Zc7Vb1rtYUKFw2h@wpplibre.imudzax.mongodb.net/?retryWrites=true&w=majority&appName=wpplibre/LibreChat

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This .env change includes a full MongoDB connection string with embedded username/password. Committing real credentials to the repository is a security incident (and makes rotating/handling secrets difficult). Replace with a placeholder value (as in .env.example), move real secrets to your deployment secret store, and rotate these credentials immediately.

Suggested change
MONGO_URI=mongodb+srv://wppuser:3Zc7Vb1rtYUKFw2h@wpplibre.imudzax.mongodb.net/?retryWrites=true&w=majority&appName=wpplibre/LibreChat
MONGO_URI=mongodb+srv://<username>:<password>@<cluster-hostname>/?retryWrites=true&w=majority&appName=<app-name>

Copilot uses AI. Check for mistakes.
Comment thread .env
Comment on lines 391 to 393
CREDS_KEY=f34be427ebb29de8d88c107a71546019685ed8b241d8f2ed00c3df97ad2566f0

CREDS_IV=e2341419ec3dd3d19b13a1a87fafcbfb

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit adds encryption secrets (CREDS_KEY / CREDS_IV) directly into .env in the repo. These should not be checked in; keep them empty in tracked env templates and supply real values via environment/secret manager. Please rotate these keys since they are now exposed in git history.

Suggested change
CREDS_KEY=f34be427ebb29de8d88c107a71546019685ed8b241d8f2ed00c3df97ad2566f0
CREDS_IV=e2341419ec3dd3d19b13a1a87fafcbfb
CREDS_KEY=
CREDS_IV=

Copilot uses AI. Check for mistakes.
Comment thread .env
AZURE_AI_SEARCH_INDEX_NAME=wpp-knowledge-dev
AZURE_AI_SEARCH_API_KEY=

AZURE_AI_SEARCH_API_KEY=4n2O2WEXy5u0OdRv6DEsBotuSz7zzzm2iVspryzsKOAzSeAIFdGu

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AZURE_AI_SEARCH_API_KEY is committed with a concrete key value. API keys must not be stored in the repo; keep this blank (like .env.example) and inject it via environment/secret manager. The key should be rotated after removing it from the PR, since it’s now exposed.

Suggested change
AZURE_AI_SEARCH_API_KEY=4n2O2WEXy5u0OdRv6DEsBotuSz7zzzm2iVspryzsKOAzSeAIFdGu
AZURE_AI_SEARCH_API_KEY=

Copilot uses AI. Check for mistakes.
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.

2 participants