Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
f10e56be
Commit
f10e56be
authored
Mar 24, 2026
by
Ethan0x0000
Browse files
refactor(test): improve type assertions in ops endpoint context tests
parent
2f8e10db
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/internal/handler/ops_error_logger_test.go
View file @
f10e56be
...
@@ -285,11 +285,15 @@ func TestSetOpsEndpointContext_SetsContextKeys(t *testing.T) {
...
@@ -285,11 +285,15 @@ func TestSetOpsEndpointContext_SetsContextKeys(t *testing.T) {
v
,
ok
:=
c
.
Get
(
opsUpstreamModelKey
)
v
,
ok
:=
c
.
Get
(
opsUpstreamModelKey
)
require
.
True
(
t
,
ok
)
require
.
True
(
t
,
ok
)
require
.
Equal
(
t
,
"claude-3-5-sonnet-20241022"
,
v
.
(
string
))
vStr
,
ok
:=
v
.
(
string
)
require
.
True
(
t
,
ok
)
require
.
Equal
(
t
,
"claude-3-5-sonnet-20241022"
,
vStr
)
rt
,
ok
:=
c
.
Get
(
opsRequestTypeKey
)
rt
,
ok
:=
c
.
Get
(
opsRequestTypeKey
)
require
.
True
(
t
,
ok
)
require
.
True
(
t
,
ok
)
require
.
Equal
(
t
,
int16
(
2
),
rt
.
(
int16
))
rtVal
,
ok
:=
rt
.
(
int16
)
require
.
True
(
t
,
ok
)
require
.
Equal
(
t
,
int16
(
2
),
rtVal
)
}
}
func
TestSetOpsEndpointContext_EmptyModelNotStored
(
t
*
testing
.
T
)
{
func
TestSetOpsEndpointContext_EmptyModelNotStored
(
t
*
testing
.
T
)
{
...
@@ -305,7 +309,9 @@ func TestSetOpsEndpointContext_EmptyModelNotStored(t *testing.T) {
...
@@ -305,7 +309,9 @@ func TestSetOpsEndpointContext_EmptyModelNotStored(t *testing.T) {
rt
,
ok
:=
c
.
Get
(
opsRequestTypeKey
)
rt
,
ok
:=
c
.
Get
(
opsRequestTypeKey
)
require
.
True
(
t
,
ok
)
require
.
True
(
t
,
ok
)
require
.
Equal
(
t
,
int16
(
1
),
rt
.
(
int16
))
rtVal
,
ok
:=
rt
.
(
int16
)
require
.
True
(
t
,
ok
)
require
.
Equal
(
t
,
int16
(
1
),
rtVal
)
}
}
func
TestSetOpsEndpointContext_NilContext
(
t
*
testing
.
T
)
{
func
TestSetOpsEndpointContext_NilContext
(
t
*
testing
.
T
)
{
...
...
backend/internal/pkg/apicompat/anthropic_to_responses_response.go
View file @
f10e56be
...
@@ -397,11 +397,6 @@ func anthToResHandleMessageDelta(evt *AnthropicStreamEvent, state *AnthropicEven
...
@@ -397,11 +397,6 @@ func anthToResHandleMessageDelta(evt *AnthropicStreamEvent, state *AnthropicEven
}
}
}
}
// Extract stop_reason from delta
if
evt
.
Delta
!=
nil
&&
evt
.
Delta
.
StopReason
!=
""
{
// We'll use this in message_stop
}
return
nil
return
nil
}
}
...
...
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