Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
e90a7c48
authored
Aug 15, 2026
by
Seefs
Committed by
GitHub
Aug 15, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add field passthrough controls for gateway channels (#6847)
parent
7d09c695
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
19 deletions
+50
-19
web/src/features/channels/components/drawers/channel-mutate-drawer.tsx
+0
-0
web/src/features/channels/constants.ts
+24
-0
web/src/features/channels/lib/channel-form.ts
+26
-19
No files found.
web/src/features/channels/components/drawers/channel-mutate-drawer.tsx
View file @
e90a7c48
This diff is collapsed.
Click to expand it.
web/src/features/channels/constants.ts
View file @
e90a7c48
...
...
@@ -392,6 +392,30 @@ export const MODEL_FETCHABLE_TYPES = new Set([
59
,
60
,
])
export
const
FIELD_PASSTHROUGH_TYPES
=
new
Set
([
1
,
14
,
57
,
58
,
59
,
CHANNEL_TYPE_NEW_API
,
])
export
const
OPENAI_FIELD_PASSTHROUGH_TYPES
=
new
Set
([
1
,
57
,
58
,
59
,
CHANNEL_TYPE_NEW_API
,
])
export
const
CLAUDE_FIELD_PASSTHROUGH_TYPES
=
new
Set
([
14
,
58
,
59
,
CHANNEL_TYPE_NEW_API
,
])
export
const
TYPE_TO_KEY_PROMPT
:
Record
<
number
,
string
>
=
{
15
:
'Format: APIKey|SecretKey'
,
18
:
'Format: APPID|APISecret|APIKey'
,
...
...
web/src/features/channels/lib/channel-form.ts
View file @
e90a7c48
...
...
@@ -19,10 +19,13 @@ For commercial licensing, please contact support@quantumnous.com
import
{
z
}
from
'zod'
import
{
CLAUDE_FIELD_PASSTHROUGH_TYPES
,
CHANNEL_TYPE_NEW_API
,
CHANNEL_STATUS
,
ERROR_MESSAGES
,
FIELD_PASSTHROUGH_TYPES
,
MODEL_FETCHABLE_TYPES
,
OPENAI_FIELD_PASSTHROUGH_TYPES
,
}
from
'../constants'
import
type
{
Channel
}
from
'../types'
import
{
...
...
@@ -487,8 +490,7 @@ export function transformChannelToFormDefaults(
thinking_to_content
:
parsed
.
thinking_to_content
||
false
,
proxy
:
parsed
.
proxy
||
''
,
http_protocol
:
protocol
,
http2_connection_shards
:
protocol
===
HTTP_PROTOCOL_HTTP1
?
1
:
shards
,
http2_connection_shards
:
protocol
===
HTTP_PROTOCOL_HTTP1
?
1
:
shards
,
pass_through_body_enabled
:
parsed
.
pass_through_body_enabled
||
false
,
system_prompt
:
parsed
.
system_prompt
||
''
,
system_prompt_override
:
parsed
.
system_prompt_override
||
false
,
...
...
@@ -672,21 +674,21 @@ function buildSettingsJSON(formData: ChannelFormValues): string {
}
// Field passthrough controls:
// - OpenAI (type 1) and Anthropic (type 14): allow_service_tier
// - OpenAI only: disable_store, allow_safety_identifier
if
(
formData
.
type
===
1
||
formData
.
type
===
14
||
formData
.
type
===
57
)
{
// - OpenAI, Anthropic, Codex, and New API: allow_service_tier
// - OpenAI request fields: OpenAI, Codex, and New API
// - Claude request fields: Anthropic and New API
if
(
FIELD_PASSTHROUGH_TYPES
.
has
(
formData
.
type
))
{
settingsObj
.
allow_service_tier
=
formData
.
allow_service_tier
===
true
}
else
if
(
'allow_service_tier'
in
settingsObj
)
{
delete
settingsObj
.
allow_service_tier
}
if
(
formData
.
type
===
1
||
formData
.
type
===
57
)
{
if
(
OPENAI_FIELD_PASSTHROUGH_TYPES
.
has
(
formData
.
type
)
)
{
settingsObj
.
disable_store
=
formData
.
disable_store
===
true
settingsObj
.
allow_safety_identifier
=
formData
.
allow_safety_identifier
===
true
settingsObj
.
allow_include_obfuscation
=
formData
.
allow_include_obfuscation
===
true
settingsObj
.
allow_inference_geo
=
formData
.
allow_inference_geo
===
true
}
else
{
if
(
'disable_store'
in
settingsObj
)
{
delete
settingsObj
.
disable_store
...
...
@@ -697,23 +699,28 @@ function buildSettingsJSON(formData: ChannelFormValues): string {
if
(
'allow_include_obfuscation'
in
settingsObj
)
{
delete
settingsObj
.
allow_include_obfuscation
}
if
(
formData
.
type
!==
14
&&
'allow_inference_geo'
in
settingsObj
)
{
delete
settingsObj
.
allow_inference_geo
}
}
// Anthropic (type 14): claude_beta_query, allow_inference_geo, allow_speed
if
(
formData
.
type
===
14
)
{
if
(
OPENAI_FIELD_PASSTHROUGH_TYPES
.
has
(
formData
.
type
)
||
CLAUDE_FIELD_PASSTHROUGH_TYPES
.
has
(
formData
.
type
)
)
{
settingsObj
.
allow_inference_geo
=
formData
.
allow_inference_geo
===
true
}
else
if
(
'allow_inference_geo'
in
settingsObj
)
{
delete
settingsObj
.
allow_inference_geo
}
if
(
CLAUDE_FIELD_PASSTHROUGH_TYPES
.
has
(
formData
.
type
))
{
settingsObj
.
allow_speed
=
formData
.
allow_speed
===
true
}
else
if
(
'allow_speed'
in
settingsObj
)
{
delete
settingsObj
.
allow_speed
}
// Only the Anthropic adaptor supports forcing the Claude beta query.
if
(
formData
.
type
===
14
)
{
settingsObj
.
claude_beta_query
=
formData
.
claude_beta_query
===
true
}
else
{
if
(
'allow_speed'
in
settingsObj
)
{
delete
settingsObj
.
allow_speed
}
if
(
'claude_beta_query'
in
settingsObj
)
{
delete
settingsObj
.
claude_beta_query
}
}
else
if
(
'claude_beta_query'
in
settingsObj
)
{
delete
settingsObj
.
claude_beta_query
}
settingsObj
.
disable_task_polling_sleep
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment