Skip to content

Conversation

@jaskfla
Copy link
Contributor

@jaskfla jaskfla commented Dec 1, 2025

RN-1802

Changes

  • Not in this PR, but coupled to it: In Bitwarden, updated Anthropic model from Sonnet 3.5 (retired in late October) to Sonnet 4.5 (to be supported until at least September 2026)
  • Bumps Langchain and related @tupaia/admin-panel-server dependencies to support new model
  • Deterministically handles Markdown fenced code blocks, because, y’know, LLMs 🙃

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jaskfla, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a regression issue by updating core Langchain dependencies and implementing robust handling for fenced JSON code blocks. The changes ensure that data sent to and received from the prompt manager is correctly formatted and parsed, which is crucial for reliable AI model interactions, particularly with updated models like Sonnet 4.5.

Highlights

  • Dependency Updates: Upgraded several Langchain-related packages, including @langchain/anthropic, @langchain/core, and langchain, to their latest versions, and added a resolution for @langchain/core.
  • Fenced Code Block Handling: Introduced new utility functions (fence and unfence) to consistently wrap and unwrap JSON data within ````json
    ...``` fenced code blocks, ensuring proper formatting for AI model interactions.
  • Prompt Manager Integration: Applied the new fencing logic within the PresentationOptionsPromptRoute to correctly format dataStructure and presentationOptions when generating presentation configurations and to parse the AI model's completion.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates LangChain dependencies, likely to support a new Anthropic model version, and adds logic to handle fenced code blocks in AI model completions. The changes are generally good, introducing helper functions to improve code clarity. I've provided a few suggestions to improve robustness: one to make the new unfence function handle whitespace better, and another to add a type check for the AI model's response to prevent potential runtime errors. I also noted a maintainability concern regarding the use of resolutions in package.json for a major version override.

@jaskfla jaskfla force-pushed the rn-1792-issue-1 branch 3 times, most recently from 3170580 to 0d97f09 Compare December 1, 2025 02:38
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This dependency bump accompanies a change in environment variable

See #6570 (comment)

@jaskfla jaskfla changed the base branch from release-2025-49 to dev December 1, 2025 23:03
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

"rimraf": "^6.0.1"
},
"resolutions": {
"@langchain/core": "0.3.79"
Copy link

Choose a reason for hiding this comment

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

Workspace-level resolutions silently ignored by Yarn Berry

Medium Severity

The resolutions field was added to packages/admin-panel-server/package.json, but this project uses Yarn Berry v3.2.1 (per root "packageManager": "yarn@3.2.1"), which only processes resolutions from the root package.json. The root already has its own resolutions block (for other packages). This means the @langchain/core pin to 0.3.79 will be silently ignored, defeating the purpose of preventing @langchain/core version duplication — a known pain point in the langchain ecosystem. The resolution needs to be in the root package.json to take effect.

Fix in Cursor Fix in Web

@jaskfla jaskfla changed the title fix(adminPanel): update Sonnet 3.5 → 4.5, handle fenced code block completions fix(adminPanel): RN-1802 update Sonnet 3.5 → 4.5, handle fenced code block completions Feb 10, 2026
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