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
4e01126f
Commit
4e01126f
authored
Feb 07, 2026
by
yangjianbo
Browse files
test(codex): 清理无用的 opencode 缓存测试
移除不再需要的 setupCodexCache 调用与辅助函数(已不再回源/读写缓存)
parent
55b56328
Changes
1
Show whitespace changes
Inline
Side-by-side
backend/internal/service/openai_codex_transform_test.go
View file @
4e01126f
...
@@ -8,7 +8,6 @@ import (
...
@@ -8,7 +8,6 @@ import (
func
TestApplyCodexOAuthTransform_ToolContinuationPreservesInput
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_ToolContinuationPreservesInput
(
t
*
testing
.
T
)
{
// 续链场景:保留 item_reference 与 id,但不再强制 store=true。
// 续链场景:保留 item_reference 与 id,但不再强制 store=true。
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.2"
,
"model"
:
"gpt-5.2"
,
...
@@ -44,7 +43,6 @@ func TestApplyCodexOAuthTransform_ToolContinuationPreservesInput(t *testing.T) {
...
@@ -44,7 +43,6 @@ func TestApplyCodexOAuthTransform_ToolContinuationPreservesInput(t *testing.T) {
func
TestApplyCodexOAuthTransform_ExplicitStoreFalsePreserved
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_ExplicitStoreFalsePreserved
(
t
*
testing
.
T
)
{
// 续链场景:显式 store=false 不再强制为 true,保持 false。
// 续链场景:显式 store=false 不再强制为 true,保持 false。
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.1"
,
"model"
:
"gpt-5.1"
,
...
@@ -64,7 +62,6 @@ func TestApplyCodexOAuthTransform_ExplicitStoreFalsePreserved(t *testing.T) {
...
@@ -64,7 +62,6 @@ func TestApplyCodexOAuthTransform_ExplicitStoreFalsePreserved(t *testing.T) {
func
TestApplyCodexOAuthTransform_ExplicitStoreTrueForcedFalse
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_ExplicitStoreTrueForcedFalse
(
t
*
testing
.
T
)
{
// 显式 store=true 也会强制为 false。
// 显式 store=true 也会强制为 false。
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.1"
,
"model"
:
"gpt-5.1"
,
...
@@ -84,7 +81,6 @@ func TestApplyCodexOAuthTransform_ExplicitStoreTrueForcedFalse(t *testing.T) {
...
@@ -84,7 +81,6 @@ func TestApplyCodexOAuthTransform_ExplicitStoreTrueForcedFalse(t *testing.T) {
func
TestApplyCodexOAuthTransform_NonContinuationDefaultsStoreFalseAndStripsIDs
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_NonContinuationDefaultsStoreFalseAndStripsIDs
(
t
*
testing
.
T
)
{
// 非续链场景:未设置 store 时默认 false,并移除 input 中的 id。
// 非续链场景:未设置 store 时默认 false,并移除 input 中的 id。
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.1"
,
"model"
:
"gpt-5.1"
,
...
@@ -126,8 +122,6 @@ func TestFilterCodexInput_RemovesItemReferenceWhenNotPreserved(t *testing.T) {
...
@@ -126,8 +122,6 @@ func TestFilterCodexInput_RemovesItemReferenceWhenNotPreserved(t *testing.T) {
}
}
func
TestApplyCodexOAuthTransform_NormalizeCodexTools_PreservesResponsesFunctionTools
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_NormalizeCodexTools_PreservesResponsesFunctionTools
(
t
*
testing
.
T
)
{
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.1"
,
"model"
:
"gpt-5.1"
,
"tools"
:
[]
any
{
"tools"
:
[]
any
{
...
@@ -158,7 +152,6 @@ func TestApplyCodexOAuthTransform_NormalizeCodexTools_PreservesResponsesFunction
...
@@ -158,7 +152,6 @@ func TestApplyCodexOAuthTransform_NormalizeCodexTools_PreservesResponsesFunction
func
TestApplyCodexOAuthTransform_EmptyInput
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_EmptyInput
(
t
*
testing
.
T
)
{
// 空 input 应保持为空且不触发异常。
// 空 input 应保持为空且不触发异常。
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.1"
,
"model"
:
"gpt-5.1"
,
...
@@ -185,13 +178,8 @@ func TestNormalizeCodexModel_Gpt53(t *testing.T) {
...
@@ -185,13 +178,8 @@ func TestNormalizeCodexModel_Gpt53(t *testing.T) {
}
}
}
}
func
setupCodexCache
(
t
*
testing
.
T
)
{
t
.
Helper
()
}
func
TestApplyCodexOAuthTransform_CodexCLI_PreservesExistingInstructions
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_CodexCLI_PreservesExistingInstructions
(
t
*
testing
.
T
)
{
// Codex CLI 场景:已有 instructions 时不修改
// Codex CLI 场景:已有 instructions 时不修改
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.1"
,
"model"
:
"gpt-5.1"
,
...
@@ -209,7 +197,6 @@ func TestApplyCodexOAuthTransform_CodexCLI_PreservesExistingInstructions(t *test
...
@@ -209,7 +197,6 @@ func TestApplyCodexOAuthTransform_CodexCLI_PreservesExistingInstructions(t *test
func
TestApplyCodexOAuthTransform_CodexCLI_SuppliesDefaultWhenEmpty
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_CodexCLI_SuppliesDefaultWhenEmpty
(
t
*
testing
.
T
)
{
// Codex CLI 场景:无 instructions 时补充默认值
// Codex CLI 场景:无 instructions 时补充默认值
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.1"
,
"model"
:
"gpt-5.1"
,
...
@@ -225,8 +212,7 @@ func TestApplyCodexOAuthTransform_CodexCLI_SuppliesDefaultWhenEmpty(t *testing.T
...
@@ -225,8 +212,7 @@ func TestApplyCodexOAuthTransform_CodexCLI_SuppliesDefaultWhenEmpty(t *testing.T
}
}
func
TestApplyCodexOAuthTransform_NonCodexCLI_OverridesInstructions
(
t
*
testing
.
T
)
{
func
TestApplyCodexOAuthTransform_NonCodexCLI_OverridesInstructions
(
t
*
testing
.
T
)
{
// 非 Codex CLI 场景:使用 opencode 指令覆盖
// 非 Codex CLI 场景:使用内置 Codex CLI 指令覆盖
setupCodexCache
(
t
)
reqBody
:=
map
[
string
]
any
{
reqBody
:=
map
[
string
]
any
{
"model"
:
"gpt-5.1"
,
"model"
:
"gpt-5.1"
,
...
...
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