Skip to content

Utf-16 annotation indices#555

Closed
crspeller wants to merge 8 commits into
masterfrom
cursor/utf-16-annotation-indices-59b8
Closed

Utf-16 annotation indices#555
crspeller wants to merge 8 commits into
masterfrom
cursor/utf-16-annotation-indices-59b8

Conversation

@crspeller
Copy link
Copy Markdown
Member

@crspeller crspeller commented Mar 13, 2026

Summary

  • Synced this branch to the current master branch to resolve the merge conflict.
  • Verified that the UTF-16 annotation/indexing changes originally proposed here are already present on master.
  • This PR now has no code diff and is no longer needed for the original fix.

Relevance

The underlying UTF-16 citation/indexing fix has already landed upstream, so this PR can be closed.

Ticket Link

N/A

Screenshots

N/A

Release Note

NONE

crspeller and others added 6 commits February 19, 2026 08:22
* Integrate Bifrost LLM gateway library for unified provider access

Replace individual LLM provider implementations (OpenAI, Anthropic, Azure,
Bedrock, Cohere, Mistral) with the Bifrost gateway library for chat completions.

Key changes:
- Add new bifrost/ package implementing llm.LanguageModel interface
- BifrostLLM adapter handles message conversion, tool calling, and streaming
- Maps ServiceConfig to Bifrost provider configuration
- Update bots/bots.go to use Bifrost for supported providers
- Keep asage provider as fallback for unsupported types
- Retain openai package for transcription and embeddings (not covered by Bifrost)
- Retain anthropic/bedrock packages for FetchModels and evals

This provides a unified API for multiple LLM providers while maintaining
backwards compatibility with existing configurations.

* Add Bifrost support for embeddings and transcription

Extend Bifrost integration to cover additional LLM capabilities:

Embeddings:
- Add BifrostEmbeddingProvider implementing embeddings.EmbeddingProvider interface
- Support CreateEmbedding and BatchCreateEmbeddings via Bifrost gateway
- Add "bifrost" provider type to embeddings configuration
- Support OpenAI, Azure, Cohere, and Bedrock providers for embeddings

Transcription:
- Add BifrostTranscriber for audio-to-text conversion via Bifrost
- Support VTT format output compatible with existing subtitles parsing
- Configurable model and provider selection

This provides unified access to embedding and transcription APIs through
the Bifrost gateway, allowing users to choose their preferred provider
while maintaining a consistent interface.

* Remove legacy provider packages in favor of Bifrost

This commit completes the migration to using Bifrost as the unified LLM
gateway by:

- Deleting openai/, anthropic/, bedrock/, and asage/ packages
- Removing ASage service type support from configuration
- Updating bots.go to use Bifrost exclusively for LLM and transcription
- Updating search/embeddings.go to use Bifrost for embedding providers
- Fixing type assignment issues in getLLM with interface types
- Using service DefaultModel for transcription (fallback to whisper-1)
- Cleaning up config.go by removing OpenAI-specific helper functions

All LLM providers are now accessed through the Bifrost gateway library,
providing a consistent interface across OpenAI, Anthropic, Azure,
OpenAI-compatible, and Bedrock providers.

* Improve Bifrost configuration to use built-in features

- Use NetworkConfig.BaseURL for OpenAI Compatible and other providers
  that support custom API endpoints (Azure uses AzureKeyConfig instead)
- Pass OpenAI OrgID via NetworkConfig.ExtraHeaders
- Configure built-in retry logic (2 retries with 1s-10s backoff)
- Remove unused httpClient from providerAccount struct
  (Bifrost manages its own HTTP client internally)

* Update Bifrost integration for newer library API

* Responses API

* Fix CI

* Mod tidy

* Add reasoning and annotation streaming to Bifrost responses

* Restore missing functionality in Bifrost migration

- Add auto-run tool resolution wrapper with recursive loop
- Honor ReasoningDisabled per-request config
- Route native web search through Responses API for all providers
- Stream reasoning/thinking events in chat API path
- Restore Anthropic thinking budget auto-calculation
- Preserve thinking blocks in conversation history
- Merge consecutive same-role messages for Anthropic
- Fix transcription model to always use whisper-1
- Pass embedding dimensions in requests
- Remove unused httpClient parameter from Bifrost

* Fix review issues in Bifrost migration

* /v1 issue

* Fix remaining e2e failures: reasoning summaries, mock model, and embedding URL

- Set reasoning.Summary = "auto" for OpenAI Responses API so reasoning
  summary events are emitted in the stream (matches old SDK behavior)
- Add defaultModel to mock service configs (Bifrost requires it)
- Pass APIURL for OpenAI embedding provider for consistency
- Normalize embedding provider URLs to strip /v1 suffix

* Fix some time issues

* Fix e2e flake mode

* Lint

* Annotations fixed

* Fix for Anthropic annotations

---------

Co-authored-by: Claude <noreply@anthropic.com>
Bring agents-v2 up to date with master, incorporating 8 commits:
token accounting, bot config hot-reload, license gating, e2e
observability, model constant updates, MCP OAuth fix, docs, and
RHS prompt hint removal. Resolved conflicts in bots/bots.go
(imports), evals/evals.go (model constants), and accepted deletion
of openai/ files superseded by the bifrost migration.

Made-with: Cursor
* Add live system-console e2e flow for real provider

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Exercise model dropdown in live e2e flow

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Fix Responses API payload unsupported summary field

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Run live system-console test in real API CI job

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Stabilize live system-console test form selectors

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Make live system-console CI test retry-safe

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Relax model persistence assertion for dropdown labels

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Force clean session before regular-user login

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Support Client4 getPosts in live flow polling

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Avoid strict text collision on mention assertion

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Assert live replies are bot-authored and non-error

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Prefer stable non-haiku model in live flow

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Prefer exact default-model match from dropdown

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Retry live replies when model returns transient error

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Polyfill crypto.randomUUID for insecure Docker test contexts

The e2e tests run inside Docker where testcontainers resolves the
Mattermost URL to the Docker bridge gateway IP (e.g. 172.17.0.1)
instead of localhost. Chromium treats non-localhost HTTP origins as
insecure contexts where crypto.randomUUID() is unavailable.

The webapp's Add Service / Add Bot buttons call crypto.randomUUID()
to generate IDs, which throws in insecure contexts. This polyfill
uses crypto.getRandomValues() (available in all contexts) to provide
a UUID v4 fallback.

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Use dated Anthropic model name compatible with Bifrost library

The Bifrost gateway library (v1.3.11) does not recognize the newer
claude-sonnet-4-6 model alias. Use the dated version claude-sonnet-4-20250514
which Bifrost can route properly.

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Strip Bifrost provider prefix from model IDs in config

Bifrost's ListModels endpoint returns model IDs prefixed with the
provider name (e.g. 'anthropic/claude-sonnet-4-20250514'). These
prefixed IDs were being saved to the plugin config, but the chat
API expects plain model names since the provider is specified
separately. Strip the prefix in FetchModels (for new selections)
and in NewFromServiceConfig (for existing saved configs).

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>

* Scope Bifrost provider prefix stripping to FetchModels only

* Remove unused

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>
* Fix bot config changes not taking effect until plugin restart (#508)

* Gate channel analysis by enterprise license (#511)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* webapp: upgrade to React 18 dependency stack

Co-authored-by: nick.misasi <nick.misasi@mattermost.com>

* webapp: fix store typings for redux 5

Co-authored-by: nick.misasi <nick.misasi@mattermost.com>

* fix bots compile by importing config package

Add the missing config import so config.DeepCopyJSON resolves in EnsureBots,
unblocking build, lint, and downstream test jobs in CI.

Made-with: Cursor

* Fix OpenAI Responses API rejecting reasoning summaries in input and test infra fixes

- Remove reasoning summary echoing in convertToResponsesMessages; the Responses
  API rejects input entries that include a summary field
- Add test asserting ResponsesReasoning is nil on input assistant messages
- Make Anthropic/OpenAI model names configurable via ANTHROPIC_MODEL/OPENAI_MODEL env vars
- Guard mmcontainer logStream writes to avoid 'write after end' race on teardown

Made-with: Cursor

* Fix bot config changes not taking effect until plugin restart (#508)

* webapp: upgrade to React 18 dependency stack

Co-authored-by: nick.misasi <nick.misasi@mattermost.com>

* webapp: fix store typings for redux 5

Co-authored-by: nick.misasi <nick.misasi@mattermost.com>

* Fix OpenAI Responses API rejecting reasoning summaries in input and test infra fixes

- Remove reasoning summary echoing in convertToResponsesMessages; the Responses
  API rejects input entries that include a summary field
- Add test asserting ResponsesReasoning is nil on input assistant messages
- Make Anthropic/OpenAI model names configurable via ANTHROPIC_MODEL/OPENAI_MODEL env vars
- Guard mmcontainer logStream writes to avoid 'write after end' race on teardown

Made-with: Cursor

* Fix lint: remove unused setEditorText and extra blank line

Remove the unused setEditorText function and extra blank line in
rhs_new_tab.tsx that were introduced during conflict resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Revert non-React-18 changes to keep branch focused on webapp upgrade

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix e2e logStream write-after-end crash in CI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Christopher Speller <crspeller@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>
@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Mar 13, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 13, 2026

🤖 LLM Evaluation Results

OpenAI

⚠️ Overall: 17/19 tests passed (89.5%)

Provider Total Passed Failed Pass Rate
⚠️ OPENAI 19 17 2 89.5%

❌ Failed Evaluations

Show 2 failures

OPENAI

1. TestReactEval/[openai]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text string "heart_eyes_cat" rather than an actual cat emoji (e.g., 😺) or a heart/love emoji (e.g., ❤️).

2. TestThreadsOpenQuestionsFromExportedData/[openai]_open_questions_from_eval_timed_dnd.json

  • Score: 0.00
  • Rubric: does not list any questions that went completely unanswered
  • Reason: The output summarizes a discussion and includes at least one explicit question ("whether there’s a concrete bug to solve vs. just consistency") without providing a definitive answer/resolution. Since it includes a question that appears unanswered in the text, it fails the rubric requirement to ...

Anthropic

⚠️ Overall: 18/19 tests passed (94.7%)

Provider Total Passed Failed Pass Rate
⚠️ ANTHROPIC 19 18 1 94.7%

❌ Failed Evaluations

Show 1 failures

ANTHROPIC

1. TestReactEval/[anthropic]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text string "heart_eyes_cat", not an actual cat emoji (e.g., 😺/🐱) or a heart/love emoji (e.g., ❤️/😍).

This comment was automatically generated by the eval CI pipeline.

@mm-cloud-bot
Copy link
Copy Markdown

Creating a Plugin SpinWick test server

@mm-cloud-bot
Copy link
Copy Markdown

Plugin Spinwick PR #555 🎉

Test server created!

Access here: https://agents-pr-555-na8a3.test.mattermost.cloud

Plugin Version Artifact
agents def57b4 Download

Installation ID: krx4k1mfh7n178cd8x1h638t5h
Logs: Click here

Credentials: Posted securely in this Mattermost channel - Look for PR #555

Base automatically changed from agents-v2 to master March 19, 2026 07:42
Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>
@mm-cloud-bot
Copy link
Copy Markdown

Test server creation failed. Review the error details here.

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>
@mm-cloud-bot
Copy link
Copy Markdown

Test server creation failed. Review the error details here.

@crspeller crspeller closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants