Skip to content
Merged

v1.4.0 #1153

Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
217 commits
Select commit Hold shift + click to select a range
9853088
feat: added agents and codemode to mcp (#941)
Pratham-Mishra04 Nov 28, 2025
0f0be03
feat: add MCP server implementation (#936)
Pratham-Mishra04 Nov 28, 2025
22cca4b
Merge branch 'main' into v1.4.0
Pratham-Mishra04 Dec 8, 2025
cd4cfac
Merge branch 'main' into v1.4.0
Pratham-Mishra04 Dec 12, 2025
bd2355b
Merge branch 'main' into v1.4.0
akshaydeo Dec 22, 2025
270cc82
feat: governance plugin refactor
Pratham-Mishra04 Dec 8, 2025
d877912
deadlock fix
akshaydeo Dec 11, 2025
0753937
chore: governance tests added
Pratham-Mishra04 Dec 9, 2025
580f591
feat: governance plugin refactor (#1154)
akshaydeo Dec 24, 2025
e42e8da
chore: governance tests added (#1041)
akshaydeo Dec 24, 2025
f26d081
feat: added binding level toggle in mcp codemode
Pratham-Mishra04 Dec 22, 2025
fab6ecc
feat: added responses mcp tool execute endpoint
Pratham-Mishra04 Dec 23, 2025
d7414a6
feat: added pings for mcp connections
Pratham-Mishra04 Dec 23, 2025
4f82c3b
feat: add tool-level binding option for MCP code mode (#1160)
akshaydeo Dec 24, 2025
187061c
feat: added Response API execution enpoint for MCP tools (#1161)
akshaydeo Dec 24, 2025
86283ac
feat: add health monitoring for MCP clients (#1168)
akshaydeo Dec 24, 2025
e65a335
Merge branch 'main' into v1.4.0
akshaydeo Dec 26, 2025
bca600b
mod update
akshaydeo Dec 26, 2025
0a6427c
Merge branch 'main' into v1.4.0
akshaydeo Dec 29, 2025
76a4e9d
Merge branch 'main' into v1.4.0
akshaydeo Dec 29, 2025
07da5f5
plugins v2 architecture
akshaydeo Nov 19, 2025
d3b125f
backmerge fixes
akshaydeo Dec 26, 2025
ed0154c
plugins v2 architecture (#888)
akshaydeo Dec 29, 2025
0851d14
bumped plugin versions
akshaydeo Dec 29, 2025
34eeb43
Merge branch 'main' into 12-29-bumped_plugin_versions
akshaydeo Dec 29, 2025
6be3aa3
bumped plugin versions (#1187)
akshaydeo Dec 29, 2025
2c4cc12
cr-fixes
akshaydeo Dec 29, 2025
525b59e
cr-fixes (#1188)
akshaydeo Dec 29, 2025
f0d5187
framework: bump core to v1.3.0 --skip-pipeline
github-actions[bot] Dec 29, 2025
869d7aa
skipping tests for plugins
akshaydeo Dec 29, 2025
c3c68a9
skipping tests for plugins (#1190)
akshaydeo Dec 29, 2025
b66e053
plugins/governance: bump core to v1.3.0 and framework to v1.2.0 --ski…
github-actions[bot] Dec 29, 2025
f879fdf
plugins/jsonparser: bump core to v1.3.0 and framework to v1.2.0 --ski…
github-actions[bot] Dec 29, 2025
4754b30
plugins/logging: bump core to v1.3.0 and framework to v1.2.0 --skip-p…
github-actions[bot] Dec 29, 2025
e6d398b
plugins/maxim: bump core to v1.3.0 and framework to v1.2.0 --skip-pip…
github-actions[bot] Dec 29, 2025
8a46230
plugins/mocker: bump core to v1.3.0 and framework to v1.2.0 --skip-pi…
github-actions[bot] Dec 29, 2025
9e55ffb
plugins/otel: bump core to v1.3.0 and framework to v1.2.0 --skip-pipe…
github-actions[bot] Dec 29, 2025
9c384a4
upgrades mocker plugin for semantic cache
akshaydeo Dec 29, 2025
b14e8c8
upgrades mocker plugin for semantic cache (#1192)
akshaydeo Dec 29, 2025
238bb2c
plugins/semanticcache: bump core to v1.3.0 and framework to v1.2.0 --…
github-actions[bot] Dec 29, 2025
31f1d83
plugins/telemetry: bump core to v1.3.0 and framework to v1.2.0 --skip…
github-actions[bot] Dec 29, 2025
1ce7ff4
build script fixes
akshaydeo Dec 29, 2025
f3dd273
Merge pull request #1194 from maximhq/12-29-build_script_fixes
akshaydeo Dec 29, 2025
654fee8
transports: update dependencies --skip-pipeline
github-actions[bot] Dec 29, 2025
27f830b
Adds changelog for v1.4.0-prerelease1 --skip-pipeline
github-actions[bot] Dec 29, 2025
4d9a667
Merge branch 'main' into v1.4.0
akshaydeo Dec 29, 2025
2704fff
Merge branch 'main' into v1.4.0
akshaydeo Dec 30, 2025
e1545ca
main backmerge
akshaydeo Dec 30, 2025
5a909bf
adds parent span id tracer
akshaydeo Dec 30, 2025
7bebf0a
adds parent span id tracer (#1203)
akshaydeo Dec 30, 2025
d7af146
framework: bump core to v1.3.1 --skip-pipeline
github-actions[bot] Dec 30, 2025
fb8e214
plugins/jsonparser: bump core to v1.3.1 and framework to v1.2.1 --ski…
github-actions[bot] Dec 30, 2025
4b95cef
plugins/logging: bump core to v1.3.1 and framework to v1.2.1 --skip-p…
github-actions[bot] Dec 30, 2025
c3e7302
plugins/maxim: bump core to v1.3.1 and framework to v1.2.1 --skip-pip…
github-actions[bot] Dec 30, 2025
125232c
plugins/mocker: bump core to v1.3.1 and framework to v1.2.1 --skip-pi…
github-actions[bot] Dec 30, 2025
aa6a141
plugins/otel: bump core to v1.3.1 and framework to v1.2.1 --skip-pipe…
github-actions[bot] Dec 30, 2025
44dbcbd
plugins/semanticcache: bump core to v1.3.1 and framework to v1.2.1 --…
github-actions[bot] Dec 30, 2025
37b31bb
plugins/telemetry: bump core to v1.3.1 and framework to v1.2.1 --skip…
github-actions[bot] Dec 30, 2025
63e0291
skipping test cases for governance
akshaydeo Dec 30, 2025
9c82fe8
Merge pull request #1204 from maximhq/12-30-skipping_test_cases_for_g…
akshaydeo Dec 30, 2025
41ff4e6
transports: update dependencies --skip-pipeline
github-actions[bot] Dec 30, 2025
e71b976
Adds changelog for v1.4.0-prerelease2 --skip-pipeline
github-actions[bot] Dec 30, 2025
122e22a
Merge branch 'main' into v1.4.0
akshaydeo Jan 1, 2026
cfe250a
streaming fix
akshaydeo Jan 1, 2026
59ad0dd
streaming fix (#1212)
akshaydeo Jan 2, 2026
ee953c2
Merge branch 'main' into v1.4.0
akshaydeo Jan 2, 2026
5659fe4
release cut
akshaydeo Jan 2, 2026
3cfaf8b
Merge pull request #1220 from maximhq/01-03-release_cut
akshaydeo Jan 2, 2026
8f5f8e8
framework: bump core to v1.3.2 --skip-pipeline
github-actions[bot] Jan 2, 2026
fc2c34b
plugins/governance: bump core to v1.3.2 and framework to v1.2.2 --ski…
github-actions[bot] Jan 2, 2026
6f7ee35
plugins/jsonparser: bump core to v1.3.2 and framework to v1.2.2 --ski…
github-actions[bot] Jan 2, 2026
c64613b
plugins/logging: bump core to v1.3.2 and framework to v1.2.2 --skip-p…
github-actions[bot] Jan 2, 2026
c54ac30
plugins/maxim: bump core to v1.3.2 and framework to v1.2.2 --skip-pip…
github-actions[bot] Jan 2, 2026
7cc47da
plugins/mocker: bump core to v1.3.2 and framework to v1.2.2 --skip-pi…
github-actions[bot] Jan 2, 2026
f1a3b63
plugins/otel: bump core to v1.3.2 and framework to v1.2.2 --skip-pipe…
github-actions[bot] Jan 2, 2026
2098b6d
plugins/semanticcache: bump core to v1.3.2 and framework to v1.2.2 --…
github-actions[bot] Jan 2, 2026
bc88e6f
plugins/telemetry: bump core to v1.3.2 and framework to v1.2.2 --skip…
github-actions[bot] Jan 2, 2026
9799064
multiselect build fix
akshaydeo Jan 2, 2026
6f49cf3
Merge pull request #1223 from maximhq/01-03-multiselect_build_fix
akshaydeo Jan 2, 2026
59c7963
transports: update dependencies --skip-pipeline
github-actions[bot] Jan 2, 2026
9556576
Adds changelog for v1.4.0-prerelease3 --skip-pipeline
github-actions[bot] Jan 2, 2026
ab53f3f
Merge branch 'main' into v1.4.0
akshaydeo Jan 4, 2026
fcad02f
sync with main
akshaydeo Jan 4, 2026
0b8ac84
enterprise api key updates
akshaydeo Dec 9, 2025
a323479
enterprise api key updates (#1197)
akshaydeo Jan 5, 2026
30bf09d
Merge branch 'main' into v1.4.0
akshaydeo Jan 5, 2026
3453ae7
prerelease4 cut
akshaydeo Jan 5, 2026
1749c59
prerelease4 cut (#1247)
akshaydeo Jan 5, 2026
89e797b
adds file base64 test behind retries
akshaydeo Jan 5, 2026
d7d275b
Merge pull request #1249 from maximhq/01-05-adds_file_base64_test_beh…
akshaydeo Jan 5, 2026
b542f6c
framework: bump core to v1.3.3 --skip-pipeline
github-actions[bot] Jan 5, 2026
403a243
plugins/governance: bump core to v1.3.3 and framework to v1.2.3 --ski…
github-actions[bot] Jan 5, 2026
e3116ff
plugins/jsonparser: bump core to v1.3.3 and framework to v1.2.3 --ski…
github-actions[bot] Jan 5, 2026
4563dfd
plugins/logging: bump core to v1.3.3 and framework to v1.2.3 --skip-p…
github-actions[bot] Jan 5, 2026
7bbd2cc
plugins/maxim: bump core to v1.3.3 and framework to v1.2.3 --skip-pip…
github-actions[bot] Jan 5, 2026
e56accf
plugins/mocker: bump core to v1.3.3 and framework to v1.2.3 --skip-pi…
github-actions[bot] Jan 5, 2026
9a76261
plugins/otel: bump core to v1.3.3 and framework to v1.2.3 --skip-pipe…
github-actions[bot] Jan 5, 2026
b855248
plugins/semanticcache: bump core to v1.3.3 and framework to v1.2.3 --…
github-actions[bot] Jan 5, 2026
aaf05b0
plugins/telemetry: bump core to v1.3.3 and framework to v1.2.3 --skip…
github-actions[bot] Jan 5, 2026
2354f71
transports: update dependencies --skip-pipeline
github-actions[bot] Jan 5, 2026
6dca47e
Adds changelog for v1.4.0-prerelease4 --skip-pipeline
github-actions[bot] Jan 5, 2026
8a7f616
Merge branch 'main' into v1.4.0
akshaydeo Jan 5, 2026
4849f83
fixes non-streaming integration llm calls
akshaydeo Jan 5, 2026
5e6aefe
Merge pull request #1253 from maximhq/01-06-fixes_non-streaming_integ…
akshaydeo Jan 5, 2026
7919dda
Adds changelog for v1.4.0-prerelease5 --skip-pipeline
github-actions[bot] Jan 5, 2026
20cfde1
Merge branch 'main' into v1.4.0
akshaydeo Jan 6, 2026
8d7b8d5
stream data deduplication fixes
akshaydeo Jan 6, 2026
369964e
stream data deduplication fixes (#1257)
akshaydeo Jan 6, 2026
8788960
fix: tracer lifecycle management fixes
Pratham-Mishra04 Jan 6, 2026
184165c
fix: improve tracer lifecycle management and stream accumulator handl…
akshaydeo Jan 6, 2026
d85e75d
Merge branch 'main' into v1.4.0
akshaydeo Jan 7, 2026
6272071
plugin loaders
akshaydeo Jan 5, 2026
6010e56
move to schemas.BifrostContext
akshaydeo Jan 6, 2026
400f137
feat: extended debug profiler to track go routines better
Pratham-Mishra04 Jan 7, 2026
672851d
plugin loaders (#1242)
akshaydeo Jan 7, 2026
f9d671b
move to schemas.BifrostContext (#1262)
akshaydeo Jan 7, 2026
2437925
feat: add goroutine profiling endpoint with categorization and analys…
akshaydeo Jan 7, 2026
b592595
Merge branch 'main' into v1.4.0
akshaydeo Jan 7, 2026
aa1e0f9
fixed core tests
akshaydeo Jan 7, 2026
276ec00
fixed core tests (#1271)
akshaydeo Jan 7, 2026
6f4e6ac
fixed bifrost test
akshaydeo Jan 7, 2026
3cd02ee
fixed bifrost test (#1272)
akshaydeo Jan 7, 2026
91cd564
framework: bump core to v1.3.4 --skip-pipeline
github-actions[bot] Jan 7, 2026
9e9e123
plugins/governance: bump core to v1.3.4 and framework to v1.2.4 --ski…
github-actions[bot] Jan 7, 2026
fe2cf6b
plugins/jsonparser: bump core to v1.3.4 and framework to v1.2.4 --ski…
github-actions[bot] Jan 7, 2026
5db3c91
plugins/logging: bump core to v1.3.4 and framework to v1.2.4 --skip-p…
github-actions[bot] Jan 7, 2026
6762b2e
plugins/maxim: bump core to v1.3.4 and framework to v1.2.4 --skip-pip…
github-actions[bot] Jan 7, 2026
0c468ea
plugins/mocker: bump core to v1.3.4 and framework to v1.2.4 --skip-pi…
github-actions[bot] Jan 7, 2026
df77c13
plugins/otel: bump core to v1.3.4 and framework to v1.2.4 --skip-pipe…
github-actions[bot] Jan 7, 2026
66b554d
plugins/telemetry: bump core to v1.3.4 and framework to v1.2.4 --skip…
github-actions[bot] Jan 7, 2026
4a41c02
semantic cache build fix
akshaydeo Jan 7, 2026
d89066b
Merge pull request #1273 from maximhq/01-08-semantic_cache_build_fix
akshaydeo Jan 7, 2026
3063cb0
fix: message type and message id in anthropic responses converters
Jan 7, 2026
8160a4e
Merge pull request #1275 from maximhq/01-08-fixes_semantic_cache_test
akshaydeo Jan 7, 2026
12f4f13
version bumps
akshaydeo Jan 7, 2026
a9f652f
Merge pull request #1279 from maximhq/01-08-version_bumps
akshaydeo Jan 7, 2026
0182055
framework: bump core to v1.3.5 --skip-pipeline
github-actions[bot] Jan 7, 2026
8b28021
plugins/governance: bump core to v1.3.5 and framework to v1.2.5 --ski…
github-actions[bot] Jan 7, 2026
fbbca4c
plugins/jsonparser: bump core to v1.3.5 and framework to v1.2.5 --ski…
github-actions[bot] Jan 7, 2026
3c5ee4b
plugins/logging: bump core to v1.3.5 and framework to v1.2.5 --skip-p…
github-actions[bot] Jan 7, 2026
3c6bcc5
plugins/maxim: bump core to v1.3.5 and framework to v1.2.5 --skip-pip…
github-actions[bot] Jan 7, 2026
f398f02
plugins/mocker: bump core to v1.3.5 and framework to v1.2.5 --skip-pi…
github-actions[bot] Jan 7, 2026
8f47edd
plugins/otel: bump core to v1.3.5 and framework to v1.2.5 --skip-pipe…
github-actions[bot] Jan 7, 2026
695e18c
plugins/semanticcache: bump core to v1.3.5 and framework to v1.2.5 --…
github-actions[bot] Jan 7, 2026
8f4fa4b
plugins/telemetry: bump core to v1.3.5 and framework to v1.2.5 --skip…
github-actions[bot] Jan 7, 2026
635e3a4
transports: update dependencies --skip-pipeline
github-actions[bot] Jan 7, 2026
9aec87e
Adds changelog for v1.4.0-prerelease6 --skip-pipeline
github-actions[bot] Jan 7, 2026
306b5d0
fix: correct query parameter parsing in transport interceptor middleware
Jan 8, 2026
f8b3848
fix: added custom error converter in common openai request handlers f…
Jan 8, 2026
59950eb
langfuse + otel integration
akshaydeo Jan 8, 2026
5a12323
langfuse + otel integration (#1284)
akshaydeo Jan 8, 2026
b78051f
fix: correct query parameter parsing in transport interceptor middlew…
akshaydeo Jan 8, 2026
bc6c1af
fix: added custom error converter in common openai request handlers f…
akshaydeo Jan 8, 2026
1e63276
fix: remove omit empty tag from output field in bifrost responses res…
Jan 8, 2026
bb37271
rbac fixes
akshaydeo Jan 8, 2026
511bd9c
rbac fixes (#1287)
akshaydeo Jan 8, 2026
6729fc3
Merge pull request #1286 from maximhq/01-08-fix_remove_omit_empty_tag…
akshaydeo Jan 8, 2026
075da49
framework: bump core to v1.3.6 --skip-pipeline
github-actions[bot] Jan 8, 2026
e83274a
plugins/governance: bump core to v1.3.6 and framework to v1.2.6 --ski…
github-actions[bot] Jan 8, 2026
eeee08b
plugins/jsonparser: bump core to v1.3.6 and framework to v1.2.6 --ski…
github-actions[bot] Jan 8, 2026
7907bba
plugins/logging: bump core to v1.3.6 and framework to v1.2.6 --skip-p…
github-actions[bot] Jan 8, 2026
09b3ea9
plugins/maxim: bump core to v1.3.6 and framework to v1.2.6 --skip-pip…
github-actions[bot] Jan 8, 2026
526ad6b
plugins/mocker: bump core to v1.3.6 and framework to v1.2.6 --skip-pi…
github-actions[bot] Jan 8, 2026
28af692
plugins/otel: bump core to v1.3.6 and framework to v1.2.6 --skip-pipe…
github-actions[bot] Jan 8, 2026
b88e3c8
plugins/semanticcache: bump core to v1.3.6 and framework to v1.2.6 --…
github-actions[bot] Jan 8, 2026
0206c59
plugins/telemetry: bump core to v1.3.6 and framework to v1.2.6 --skip…
github-actions[bot] Jan 8, 2026
4596892
build fix
akshaydeo Jan 8, 2026
cba3ddb
Merge pull request #1288 from maximhq/01-09-build_fix
akshaydeo Jan 8, 2026
eccf20e
transports: update dependencies --skip-pipeline
github-actions[bot] Jan 8, 2026
a05108a
Adds changelog for v1.4.0-prerelease7 --skip-pipeline
github-actions[bot] Jan 8, 2026
13f8cb9
docs update
akshaydeo Jan 8, 2026
5b3fa08
docs update (#1289)
akshaydeo Jan 8, 2026
d7842a3
fix: system instruction handling
Jan 9, 2026
df4b99e
feat: support instructions parameter as fallback for system messages …
akshaydeo Jan 9, 2026
bc2e8de
config resolution for first time vk
akshaydeo Jan 9, 2026
347499b
config resolution for first time vk (#1293)
akshaydeo Jan 9, 2026
f3ec00b
fix: fixed header lookups and vertex list models
Pratham-Mishra04 Jan 9, 2026
9a22b56
fix: enhance Vertex list models to support deployment values and norm…
akshaydeo Jan 9, 2026
ff780a9
framework: bump core to v1.3.7 --skip-pipeline
github-actions[bot] Jan 9, 2026
da72f20
plugins/governance: bump core to v1.3.7 and framework to v1.2.7 --ski…
github-actions[bot] Jan 9, 2026
b0cd18a
plugins/jsonparser: bump core to v1.3.7 and framework to v1.2.7 --ski…
github-actions[bot] Jan 9, 2026
139f65a
plugins/logging: bump core to v1.3.7 and framework to v1.2.7 --skip-p…
github-actions[bot] Jan 9, 2026
db905fe
plugins/maxim: bump core to v1.3.7 and framework to v1.2.7 --skip-pip…
github-actions[bot] Jan 9, 2026
96bb084
plugins/mocker: bump core to v1.3.7 and framework to v1.2.7 --skip-pi…
github-actions[bot] Jan 9, 2026
fdbd368
plugins/otel: bump core to v1.3.7 and framework to v1.2.7 --skip-pipe…
github-actions[bot] Jan 9, 2026
7b0149b
plugins/semanticcache: bump core to v1.3.7 and framework to v1.2.7 --…
github-actions[bot] Jan 9, 2026
3b44cb3
plugins/telemetry: bump core to v1.3.7 and framework to v1.2.7 --skip…
github-actions[bot] Jan 9, 2026
fe935d3
Merge branch 'main' into v1.4.0
akshaydeo Jan 9, 2026
151540e
reverts to-lower changes for header passing
akshaydeo Jan 9, 2026
10c279d
reverts to-lower changes for header passing (#1295)
akshaydeo Jan 9, 2026
3a9c86d
transports: update dependencies --skip-pipeline
github-actions[bot] Jan 9, 2026
2968464
Adds changelog for v1.4.0-prerelease8 --skip-pipeline
github-actions[bot] Jan 9, 2026
ac581ef
adds ts integration tests
akshaydeo Jan 9, 2026
612fd4c
adds stream disconnect handler for streaming calls
akshaydeo Jan 9, 2026
c061933
Merge pull request #1298 from maximhq/01-09-adds_stream_disconnect_ha…
akshaydeo Jan 11, 2026
217e276
Merge pull request #1296 from maximhq/01-09-adds_ts_integration_tests
akshaydeo Jan 11, 2026
1ea9024
adds retries to file tests
akshaydeo Jan 11, 2026
350654d
adds retries to file tests (#1303)
akshaydeo Jan 11, 2026
a933839
framework: bump core to v1.3.8 --skip-pipeline
github-actions[bot] Jan 11, 2026
8975d43
plugins/governance: bump core to v1.3.8 and framework to v1.2.8 --ski…
github-actions[bot] Jan 11, 2026
3840f42
plugins/jsonparser: bump core to v1.3.8 and framework to v1.2.8 --ski…
github-actions[bot] Jan 11, 2026
0b6cef0
plugins/logging: bump core to v1.3.8 and framework to v1.2.8 --skip-p…
github-actions[bot] Jan 11, 2026
e259ca9
plugins/maxim: bump core to v1.3.8 and framework to v1.2.8 --skip-pip…
github-actions[bot] Jan 11, 2026
662c8fc
plugins/mocker: bump core to v1.3.8 and framework to v1.2.8 --skip-pi…
github-actions[bot] Jan 11, 2026
b47d9f8
plugins/otel: bump core to v1.3.8 and framework to v1.2.8 --skip-pipe…
github-actions[bot] Jan 11, 2026
c94be44
plugins/telemetry: bump core to v1.3.8 and framework to v1.2.8 --skip…
github-actions[bot] Jan 11, 2026
90b4e04
fixes race condition in semanticcache
akshaydeo Jan 11, 2026
1c8fe47
fixes race condition in semanticcache (#1304)
akshaydeo Jan 11, 2026
135b841
transports: update dependencies --skip-pipeline
github-actions[bot] Jan 11, 2026
0a5f2af
Adds changelog for v1.4.0-prerelease9 --skip-pipeline
github-actions[bot] Jan 11, 2026
5748987
fix: remove non reasoning variant from grok reasoning models list
Jan 12, 2026
b42d387
fix: remove non reasoning variant from grok reasoning models list (#1…
akshaydeo Jan 12, 2026
bec61ed
review fixes
akshaydeo Jan 12, 2026
d1c337f
review fixes (#1309)
akshaydeo Jan 12, 2026
613dfe3
feat: add case-insensitive helper methods for HTTP request headers an…
Pratham-Mishra04 Jan 12, 2026
c1e5ff7
adds nil bodystream check
akshaydeo Jan 12, 2026
22c5159
adds nil bodystream check (#1310)
akshaydeo Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ insert_final_newline = false
end_of_line = lf
charset = utf-8

[*.go]
indent_style = tab
indent_size = 4

[*.{js,jsx,ts,tsx,mjs,json,md,css,scss,html}]
insert_final_newline = false
138 changes: 103 additions & 35 deletions core/bifrost.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"time"

"github.com/google/uuid"
"github.com/maximhq/bifrost/core/mcp"
"github.com/maximhq/bifrost/core/providers/anthropic"
"github.com/maximhq/bifrost/core/providers/azure"
"github.com/maximhq/bifrost/core/providers/bedrock"
Expand Down Expand Up @@ -66,7 +67,8 @@ type Bifrost struct {
pluginPipelinePool sync.Pool // Pool for PluginPipeline objects
bifrostRequestPool sync.Pool // Pool for BifrostRequest objects
logger schemas.Logger // logger instance, default logger is used if not provided
mcpManager *MCPManager // MCP integration manager (nil if MCP not configured)
mcpManager *mcp.MCPManager // MCP integration manager (nil if MCP not configured)
mcpInitOnce sync.Once // Ensures MCP manager is initialized only once
dropExcessRequests atomic.Bool // If true, in cases where the queue is full, requests will not wait for the queue to be empty and will be dropped instead.
keySelector schemas.KeySelector // Custom key selector function
}
Expand Down Expand Up @@ -179,13 +181,10 @@ func Init(ctx context.Context, config schemas.BifrostConfig) (*Bifrost, error) {

// Initialize MCP manager if configured
if config.MCPConfig != nil {
mcpManager, err := newMCPManager(bifrostCtx, *config.MCPConfig, bifrost.logger)
if err != nil {
bifrost.logger.Warn(fmt.Sprintf("failed to initialize MCP manager: %v", err))
} else {
bifrost.mcpManager = mcpManager
bifrost.mcpInitOnce.Do(func() {
bifrost.mcpManager = mcp.NewMCPManager(bifrostCtx, *config.MCPConfig, bifrost.logger)
bifrost.logger.Info("MCP integration initialized successfully")
}
})
}

// Create buffered channels for each provider and start workers
Expand Down Expand Up @@ -539,8 +538,7 @@ func (bifrost *Bifrost) TextCompletionStreamRequest(ctx context.Context, req *sc
return bifrost.handleStreamRequest(ctx, bifrostReq)
}

// ChatCompletionRequest sends a chat completion request to the specified provider.
func (bifrost *Bifrost) ChatCompletionRequest(ctx context.Context, req *schemas.BifrostChatRequest) (*schemas.BifrostChatResponse, *schemas.BifrostError) {
func (bifrost *Bifrost) makeChatCompletionRequest(ctx context.Context, req *schemas.BifrostChatRequest) (*schemas.BifrostChatResponse, *schemas.BifrostError) {
if req == nil {
return nil, &schemas.BifrostError{
IsBifrostError: false,
Expand Down Expand Up @@ -574,10 +572,35 @@ func (bifrost *Bifrost) ChatCompletionRequest(ctx context.Context, req *schemas.
if err != nil {
return nil, err
}
//TODO: Release the response

return response.ChatResponse, nil
}

// ChatCompletionRequest sends a chat completion request to the specified provider.
func (bifrost *Bifrost) ChatCompletionRequest(ctx context.Context, req *schemas.BifrostChatRequest) (*schemas.BifrostChatResponse, *schemas.BifrostError) {
// If ctx is nil, use the bifrost context (defensive check for mcp agent mode)
if ctx == nil {
ctx = bifrost.ctx
}

response, err := bifrost.makeChatCompletionRequest(ctx, req)
if err != nil {
return nil, err
}

// Check if we should enter agent mode
if bifrost.mcpManager != nil {
return bifrost.mcpManager.CheckAndExecuteAgentForChatRequest(
&ctx,
req,
response,
bifrost.makeChatCompletionRequest,
)
}
Comment thread
akshaydeo marked this conversation as resolved.

return response, nil
}

// ChatCompletionStreamRequest sends a chat completion stream request to the specified provider.
func (bifrost *Bifrost) ChatCompletionStreamRequest(ctx context.Context, req *schemas.BifrostChatRequest) (chan *schemas.BifrostStream, *schemas.BifrostError) {
if req == nil {
Expand Down Expand Up @@ -612,8 +635,7 @@ func (bifrost *Bifrost) ChatCompletionStreamRequest(ctx context.Context, req *sc
return bifrost.handleStreamRequest(ctx, bifrostReq)
}

// ResponsesRequest sends a responses request to the specified provider.
func (bifrost *Bifrost) ResponsesRequest(ctx context.Context, req *schemas.BifrostResponsesRequest) (*schemas.BifrostResponsesResponse, *schemas.BifrostError) {
func (bifrost *Bifrost) makeResponsesRequest(ctx context.Context, req *schemas.BifrostResponsesRequest) (*schemas.BifrostResponsesResponse, *schemas.BifrostError) {
if req == nil {
return nil, &schemas.BifrostError{
IsBifrostError: false,
Expand Down Expand Up @@ -647,10 +669,34 @@ func (bifrost *Bifrost) ResponsesRequest(ctx context.Context, req *schemas.Bifro
if err != nil {
return nil, err
}
//TODO: Release the response
return response.ResponsesResponse, nil
}

// ResponsesRequest sends a responses request to the specified provider.
func (bifrost *Bifrost) ResponsesRequest(ctx context.Context, req *schemas.BifrostResponsesRequest) (*schemas.BifrostResponsesResponse, *schemas.BifrostError) {
// If ctx is nil, use the bifrost context (defensive check for mcp agent mode)
if ctx == nil {
ctx = bifrost.ctx
}

response, err := bifrost.makeResponsesRequest(ctx, req)
if err != nil {
return nil, err
}

// Check if we should enter agent mode
if bifrost.mcpManager != nil {
return bifrost.mcpManager.CheckAndExecuteAgentForResponsesRequest(
&ctx,
req,
response,
bifrost.makeResponsesRequest,
)
}

return response, nil
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

// ResponsesStreamRequest sends a responses stream request to the specified provider.
func (bifrost *Bifrost) ResponsesStreamRequest(ctx context.Context, req *schemas.BifrostResponsesRequest) (chan *schemas.BifrostStream, *schemas.BifrostError) {
if req == nil {
Expand Down Expand Up @@ -1644,7 +1690,7 @@ func (bifrost *Bifrost) RegisterMCPTool(name, description string, handler func(a
return fmt.Errorf("MCP is not configured in this Bifrost instance")
}

return bifrost.mcpManager.registerTool(name, description, handler, toolSchema)
return bifrost.mcpManager.RegisterTool(name, description, handler, toolSchema)
}

// ExecuteMCPTool executes an MCP tool call and returns the result as a tool message.
Expand All @@ -1670,13 +1716,12 @@ func (bifrost *Bifrost) ExecuteMCPTool(ctx context.Context, toolCall schemas.Cha
}
}

result, err := bifrost.mcpManager.executeTool(ctx, toolCall)
result, err := bifrost.mcpManager.ExecuteTool(ctx, toolCall)
if err != nil {
return nil, &schemas.BifrostError{
IsBifrostError: false,
Error: &schemas.ErrorField{
Message: err.Error(),
Error: err,
},
ExtraFields: schemas.BifrostErrorExtraFields{
RequestType: schemas.ChatCompletionRequest, // MCP tools are used with chat completions
Expand All @@ -1702,12 +1747,9 @@ func (bifrost *Bifrost) GetMCPClients() ([]schemas.MCPClient, error) {
return nil, fmt.Errorf("MCP is not configured in this Bifrost instance")
}

clients, err := bifrost.mcpManager.GetClients()
if err != nil {
return nil, err
}

clients := bifrost.mcpManager.GetClients()
clientsInConfig := make([]schemas.MCPClient, 0, len(clients))

for _, client := range clients {
tools := make([]schemas.ChatToolFunction, 0, len(client.ToolMap))
for _, tool := range client.ToolMap {
Expand Down Expand Up @@ -1735,6 +1777,17 @@ func (bifrost *Bifrost) GetMCPClients() ([]schemas.MCPClient, error) {
return clientsInConfig, nil
}

// GetAvailableTools returns the available tools for the given context.
//
// Returns:
// - []schemas.ChatTool: List of available tools
func (bifrost *Bifrost) GetAvailableMCPTools(ctx context.Context) []schemas.ChatTool {
if bifrost.mcpManager == nil {
return nil
}
return bifrost.mcpManager.GetAvailableTools(ctx)
}

// AddMCPClient adds a new MCP client to the Bifrost instance.
// This allows for dynamic MCP client management at runtime.
//
Expand All @@ -1753,13 +1806,17 @@ func (bifrost *Bifrost) GetMCPClients() ([]schemas.MCPClient, error) {
// })
func (bifrost *Bifrost) AddMCPClient(config schemas.MCPClientConfig) error {
if bifrost.mcpManager == nil {
manager := &MCPManager{
ctx: bifrost.ctx,
clientMap: make(map[string]*MCPClient),
logger: bifrost.logger,
}
// Use sync.Once to ensure thread-safe initialization
bifrost.mcpInitOnce.Do(func() {
bifrost.mcpManager = mcp.NewMCPManager(bifrost.ctx, schemas.MCPConfig{
ClientConfigs: []schemas.MCPClientConfig{config},
}, bifrost.logger)
})
}

bifrost.mcpManager = manager
// Handle case where initialization succeeded elsewhere but manager is still nil
if bifrost.mcpManager == nil {
return fmt.Errorf("MCP manager is not initialized")
}

return bifrost.mcpManager.AddClient(config)
Expand Down Expand Up @@ -1827,6 +1884,20 @@ func (bifrost *Bifrost) ReconnectMCPClient(id string) error {
return bifrost.mcpManager.ReconnectClient(id)
}

// UpdateToolManagerConfig updates the tool manager config for the MCP manager.
// This allows for hot-reloading of the tool manager config at runtime.
func (bifrost *Bifrost) UpdateToolManagerConfig(maxAgentDepth int, toolExecutionTimeoutInSeconds int) error {
if bifrost.mcpManager == nil {
return fmt.Errorf("MCP is not configured in this Bifrost instance")
}

bifrost.mcpManager.UpdateToolManagerConfig(&schemas.MCPToolManagerConfig{
MaxAgentDepth: maxAgentDepth,
ToolExecutionTimeout: time.Duration(toolExecutionTimeoutInSeconds) * time.Second,
})
return nil
}

// PROVIDER MANAGEMENT

// createBaseProvider creates a provider based on the base provider type
Expand Down Expand Up @@ -2332,11 +2403,8 @@ func (bifrost *Bifrost) tryRequest(ctx context.Context, req *schemas.BifrostRequ
}

// Add MCP tools to request if MCP is configured and requested
if req.RequestType != schemas.EmbeddingRequest &&
req.RequestType != schemas.SpeechRequest &&
req.RequestType != schemas.TranscriptionRequest &&
bifrost.mcpManager != nil {
req = bifrost.mcpManager.addMCPToolsToBifrostRequest(ctx, req)
if bifrost.mcpManager != nil {
req = bifrost.mcpManager.AddToolsToRequest(ctx, req)
}

pipeline := bifrost.getPluginPipeline()
Expand Down Expand Up @@ -2452,7 +2520,7 @@ func (bifrost *Bifrost) tryStreamRequest(ctx context.Context, req *schemas.Bifro

// Add MCP tools to request if MCP is configured and requested
if req.RequestType != schemas.SpeechStreamRequest && req.RequestType != schemas.TranscriptionStreamRequest && bifrost.mcpManager != nil {
req = bifrost.mcpManager.addMCPToolsToBifrostRequest(ctx, req)
req = bifrost.mcpManager.AddToolsToRequest(ctx, req)
}

pipeline := bifrost.getPluginPipeline()
Expand Down Expand Up @@ -2644,7 +2712,7 @@ func executeRequestWithRetries[T any](

// Calculate and apply backoff
backoff := calculateBackoff(attempts-1, config)
logger.Debug("sleeping for %s", backoff)
logger.Debug("sleeping for %s before retry", backoff)
time.Sleep(backoff)
}

Expand Down Expand Up @@ -3463,7 +3531,7 @@ func (bifrost *Bifrost) Shutdown() {

// Cleanup MCP manager
if bifrost.mcpManager != nil {
err := bifrost.mcpManager.cleanup()
err := bifrost.mcpManager.Cleanup()
if err != nil {
bifrost.logger.Warn(fmt.Sprintf("Error cleaning up MCP manager: %s", err.Error()))
}
Expand Down
34 changes: 20 additions & 14 deletions core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,26 @@ go 1.25.5
require (
github.com/aws/aws-sdk-go-v2 v1.41.0
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4
github.com/aws/aws-sdk-go-v2/config v1.32.5
github.com/aws/aws-sdk-go-v2/credentials v1.19.5
github.com/aws/aws-sdk-go-v2/service/s3 v1.93.2
github.com/aws/aws-sdk-go-v2/config v1.32.6
github.com/aws/aws-sdk-go-v2/credentials v1.19.6
github.com/aws/aws-sdk-go-v2/service/s3 v1.94.0
github.com/aws/smithy-go v1.24.0
github.com/bytedance/sonic v1.14.1
github.com/bytedance/sonic v1.14.2
github.com/clarkmcc/go-typescript v0.7.0
github.com/dop251/goja v0.0.0-20251103141225-af2ceb9156d7
Comment thread
akshaydeo marked this conversation as resolved.
github.com/google/uuid v1.6.0
github.com/hajimehoshi/go-mp3 v0.3.4
github.com/mark3labs/mcp-go v0.41.1
github.com/mark3labs/mcp-go v0.43.2
github.com/rs/zerolog v1.34.0
github.com/stretchr/testify v1.11.1
github.com/valyala/fasthttp v1.67.0
golang.org/x/oauth2 v0.32.0
golang.org/x/text v0.31.0
github.com/valyala/fasthttp v1.68.0
golang.org/x/oauth2 v0.34.0
golang.org/x/text v0.32.0
)

require (
cloud.google.com/go/compute/metadata v0.9.0 // indirect
github.com/Masterminds/semver/v3 v3.3.1 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 // indirect
Expand All @@ -33,17 +36,20 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.16 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.7 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.8 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/bytedance/sonic/loader v0.4.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
github.com/invopop/jsonschema v0.13.0 // indirect
github.com/klauspost/compress v1.18.1 // indirect
github.com/klauspost/compress v1.18.2 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/mailru/easyjson v0.9.1 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
Expand All @@ -55,9 +61,9 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
golang.org/x/arch v0.22.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/arch v0.23.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sys v0.39.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading