Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,409 in github.com/QuantumNous/new-api
⨍
Functions
15,409
◇
Types & classes
2,241
Function
TestTaskPluginMarketplaceSourceKindComesFromTheAddress
(t *testing.T)
setting/task_plugin_test.go:67
Function
TestTaskPluginModelRewriteKeepsBorrowedBodies
(t *testing.T)
middleware/task_plugin_test.go:445
Function
TestTaskPluginOrderSQLQuotesMySQLKeyColumn
(t *testing.T)
model/task_plugin_test.go:145
Function
TestTaskPluginPagesReportPartsAndCredentialHooks
The plugin list, the plugin detail and the bind options report the same parts, stage hooks and credential hooks for a version the runtime serves. A ve
controller/task_plugin_test.go:651
Function
TestTaskPluginProtocolHeartbeatDoesNotDispatchEmptySDKEvent
(t *testing.T)
controller/plugin_protocol_test.go:612
Function
TestTaskPluginResponsesNonStreamDecodesWithOfficialGoSDK
(t *testing.T)
controller/plugin_protocol_sdk_test.go:26
Function
TestTaskPluginResponsesStreamDecodesWithOfficialGoSDK
(t *testing.T)
controller/plugin_protocol_sdk_test.go:84
Function
TestTaskPluginRoutingDebugReasonDoesNotExposeRawFailure
(t *testing.T)
pkg/jsplugin/registry_test.go:538
Function
TestTaskPluginRuntimeExposesDatabaseRevisionAheadOfLocalGeneration
(t *testing.T)
controller/task_plugin_test.go:1130
Function
TestTaskPluginRuntimeReportsPluginLevelCompileErrors
(t *testing.T)
controller/task_plugin_test.go:1184
Function
TestTaskPluginRuntimeSurvivesDatabaseSyncFailure
(t *testing.T)
controller/task_plugin_test.go:1223
Function
TestTaskPluginSourceAboveMySQLTextLimitRoundTrips
The shipped alibaba plugin is already larger than a MySQL TEXT column (64 KiB), so storing it through the model path the upload endpoint uses and read
controller/task_plugin_test.go:340
Function
TestTaskPluginSubmitDiagnosticsArePluginOnlyAndDoNotLogPayloads
(t *testing.T)
controller/task_plugin_debug_test.go:19
Function
TestTaskPluginSwitchOnPathsRejectRoutingConflicts
With two enabled plugins whose routing conflicts, the restart order would pick the one that serves. Every path that puts a plugin into service refuses
controller/task_plugin_test.go:1523
Function
TestTaskPluginSyncSnapshotRevisionTracksDesiredRuntimeState
(t *testing.T)
model/task_plugin_test.go:99
Function
TestTaskPluginVersionActivationAndSourceImmutability
(t *testing.T)
model/task_plugin_test.go:23
Function
TestTaskPollingUsesTheSubmittingAccount
(t *testing.T)
relay/channel/task/jsplugin/credential_test.go:223
Function
TestTaskPricingDefaultsAndOptionUpdate
(t *testing.T)
setting/task_pricing_setting/config_test.go:11
Function
TestTaskQueryRedirects
(t *testing.T)
relay/channel/task/jsplugin/adaptor_test.go:656
Function
TestTaskReport
A stored task reports once from its row, at its final state, and not at submit; its record carries the submission, the result and the final quota.
relay/requestplugin/socket_test.go:363
Function
TestTaskReportBeforeTheTaskExists
A submission that failed before its task existed reports at once.
relay/requestplugin/socket_test.go:426
Function
TestTaskReportsOnceAtTheFinalState
A task reports once, when it reaches its final state: not per poll, not when another poller lost the race, never when no instance may report it.
service/task_polling_test.go:1100
Function
TestTaskResultBounds
The task result keeps URLs and texts within its bounds.
relay/requestplugin/socket_test.go:443
Function
TestTaskSubmissionRunsRequestPlugins
A task submission runs the request plugins: ingress on the client body before it is decoded, priced or reserved, egress on the body the task plugin bu
controller/plugin_native_e2e_test.go:441
Function
TestTaskSubmissionStages
(t *testing.T)
relay/requestplugin/requestplugin_test.go:1774
Function
TestTaskSubmitDeltaStreamContract
(t *testing.T)
relay/channel/task/jsplugin/adaptor_test.go:2565
Function
TestTaskSubmitHooksReceiveIndependentRequestSnapshots
(t *testing.T)
relay/channel/task/jsplugin/adaptor_test.go:2501
Function
TestTaskSubmitReplyLimitFollowsRetainResult
A native route that declares retainResult: false never persists its reply, so a Base64 image reply may exceed the 1 MiB task data limit.
relay/channel/task/jsplugin/adaptor_test.go:2330
Function
TestTaskSubmitStreamCancellationClosesReader
(t *testing.T)
relay/channel/task/jsplugin/adaptor_test.go:2367
Function
TestTaskSubmitStreamContract
(t *testing.T)
relay/channel/task/jsplugin/adaptor_test.go:2163
Function
TestTaskSubmitStreamIdleTimeout
(t *testing.T)
relay/channel/task/jsplugin/adaptor_test.go:2380
Function
TestTaskSubmitStreamRelaysToNativeClients
A native route's client receives every upstream event as the vendor framed it, and once one has arrived the submission settles instead of failing. The
relay/channel/task/jsplugin/adaptor_test.go:2224
Function
TestTaskSubmitUsesTheCredential
(t *testing.T)
relay/channel/task/jsplugin/credential_test.go:194
Function
TestTaskToOpenAIVideoDoesNotExposeResultURL
(t *testing.T)
model/task_openai_video_test.go:11
Function
TestTaskToOpenAIVideoStatusAndCompletedAt
(t *testing.T)
model/task_openai_video_test.go:39
Function
TestTaskUsageExpressionUsesFactsAndTaskQuotaConversion
(t *testing.T)
pkg/billingexpr/task_usage_test.go:10
Function
TestTaskUsageValidationLeavesReturnedHostRequestUnchanged
(t *testing.T)
relay/channel/task/jsplugin/adaptor_test.go:2532
Function
TestTelegramOAuthBindingIsAtomicAndSessionBound
(t *testing.T)
controller/telegram_test.go:293
Function
TestTelegramOAuthBindingRejectsChangedAccountsAndDuplicateOwnership
(t *testing.T)
controller/telegram_test.go:330
Function
TestTelegramOAuthConcurrentBindingHasSingleOwner
(t *testing.T)
controller/telegram_test.go:432
Function
TestTelegramOAuthConfigurationAndLegacyEndpoints
(t *testing.T)
controller/telegram_test.go:360
Function
TestTelegramOAuthPreservesExistingAccountAndBinding
(t *testing.T)
controller/telegram_test.go:202
Function
TestTelegramOAuthRejectsInvalidTokens
(t *testing.T)
controller/telegram_test.go:236
Function
TestTerminalSidecarRemainsAuthoritativeAgainstFinalize
(t *testing.T)
relaykit/relayconvert/internal/claude_messages/stream_billing_usage_test.go:44
Function
TestTestAllChannelsRejectsExistingActiveTask
(t *testing.T)
controller/channel_test_internal_test.go:479
Function
TestTextRequestViaResponsesConvertsClaudeDirectly
(t *testing.T)
relay/chat_completions_via_responses_test.go:138
Function
TestThinkingSuffixUpstreamFields
The -none/-low/-max tails of deepseek-flash and deepseek-v4-* reach DeepSeek as its own thinking switch and effort in each upstream format, with the b
relay/channel/deepseek/adaptor_test.go:24
Function
TestTimeFunctions_AllFunctionsCompile
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:941
Function
TestTimeFunctions_EmptyTimezone
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:964
Function
TestTimeFunctions_InvalidTimezone
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:952
Function
TestTimeFunctions_MonthDayPattern
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:999
Function
TestTimeFunctions_NightDiscountPattern
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:975
Function
TestTimeFunctions_ValidTimezone
--------------------------------------------------------------------------- Time function tests ------------------------------------------------------
pkg/billingexpr/billingexpr_test.go:930
Function
TestTimeFunctions_WeekdayRange
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:987
Function
TestToWebSocketURL
(t *testing.T)
relay/channel/api_request_test.go:210
Function
TestTokenAllowUserQuotaQueryOnCreateAndUpdate
(t *testing.T)
controller/token_test.go:592
Function
TestTokenAllowUserQuotaQueryRoundTripsThroughRedisHashCache
(t *testing.T)
model/token_auto_groups_cache_test.go:31
Function
TestTokenAuthReadOnlyTranslatesErrors
Read-only API key routes (/api/usage/token, /api/log/token) are called by scripts, not the web console, so their errors are translated by the backend
middleware/auth_test.go:97
Function
TestTokenAutoGroupsRoundTripThroughRedisHashCache
(t *testing.T)
model/token_auto_groups_cache_test.go:11
Function
TestTokenAutoMigrateUsesVarchar128KeyColumn
(t *testing.T)
controller/token_test.go:406
Function
TestTokenCacheInitPreservesLiveQuotaAndFenceBlocksStaleSnapshot
(t *testing.T)
model/quota_reserve_test.go:223
Function
TestTokenCountMetaCountsAgentLoopContent
Agent loops replay tool definitions, tool calls, and tool output on every turn; the prompt estimate must see all of them as the model reads them.
relaykit/dto/token_count_meta_test.go:14
Function
TestTokenMigrationFromChar48ToVarchar128
(t *testing.T)
controller/token_test.go:417
Function
TestTokenMigrationFromChar48ToVarchar128MySQL
(t *testing.T)
controller/token_test.go:422
Function
TestTokenMigrationFromChar48ToVarchar128Postgres
(t *testing.T)
controller/token_test.go:432
Function
TestTokenModelLimitAllowsExemptAtNameByFullName
(t *testing.T)
middleware/distributor_test.go:268
Function
TestTokenModelLimitAllowsLegacyAliasAndModifierVariant
(t *testing.T)
middleware/distributor_test.go:234
Function
TestTokenUpdateSynchronouslyNarrowsPreheatedAutoGroupsCache
(t *testing.T)
model/token_auto_groups_cache_test.go:44
Function
TestToolPriceCustomFunctionHasNoHardcodedFallback
(t *testing.T)
setting/operation_setting/tools_price_test.go:98
Function
TestToolPriceHardcodedFallbacksSurviveMissingOperatorConfig
(t *testing.T)
setting/operation_setting/tools_price_test.go:22
Function
TestToolPriceOperatorOverridePrecedenceAndExplicitZero
(t *testing.T)
setting/operation_setting/tools_price_test.go:69
Function
TestTopLevelRoutesSkipOnlyHostRoutesAndOtherKeys
Built-in and uploaded plugins alike serve their top-level paths, /v1 ones included, unless a host route answers first or the first segment is another
router/plugin_router_test.go:414
Function
TestTopUpQuotaValidation
(t *testing.T)
controller/topup_quota_limit_test.go:21
Function
TestTryReserveQuotaWithoutRedis
(t *testing.T)
model/quota_reserve_test.go:77
Function
TestTryTieredSettleFallsBackToFrozenPreConsumeOnExprError
(t *testing.T)
service/tiered_settle_test.go:96
Function
TestTryTieredSettleNoClampInRange
TestTryTieredSettleNoClampInRange confirms an in-range settlement leaves RelayInfo.QuotaClamp nil.
service/text_quota_test.go:1253
Function
TestTryTieredSettleRecordsClampOnOverflow
TestTryTieredSettleRecordsClampOnOverflow guards that an oversized tiered settlement both saturates the quota and records the clamp on RelayInfo, so e
service/text_quota_test.go:1227
Function
TestTryTieredSettleUsesFinalGroupAfterRetry
(t *testing.T)
service/tiered_settle_test.go:525
Function
TestTryTieredSettleUsesFrozenRequestInput
--------------------------------------------------------------------------- Existing tests (preserved) -----------------------------------------------
service/tiered_settle_test.go:65
Function
TestTryTieredSettle_BoundaryPlusOne
(t *testing.T)
service/tiered_settle_test.go:200
Function
TestTryTieredSettle_CacheTokensAffectSettlement
(t *testing.T)
service/tiered_settle_test.go:248
Function
TestTryTieredSettle_ErrorFallbackToEstimatedQuotaAfterGroup
--------------------------------------------------------------------------- Fallback tests -----------------------------------------------------------
service/tiered_settle_test.go:643
Function
TestTryTieredSettle_ExactBoundary
--------------------------------------------------------------------------- Tiered boundary conditions -----------------------------------------------
service/tiered_settle_test.go:183
Function
TestTryTieredSettle_GroupRatioScaling
(t *testing.T)
service/tiered_settle_test.go:567
Function
TestTryTieredSettle_GroupRatioZero
(t *testing.T)
service/tiered_settle_test.go:580
Function
TestTryTieredSettle_HugeTokens
(t *testing.T)
service/tiered_settle_test.go:235
Function
TestTryTieredSettle_NoRequestInput_FallsBackToDefault
(t *testing.T)
service/tiered_settle_test.go:299
Function
TestTryTieredSettle_PostConsumeOverPreConsume
(t *testing.T)
service/tiered_settle_test.go:141
Function
TestTryTieredSettle_PostConsumeUnderPreConsume
(t *testing.T)
service/tiered_settle_test.go:160
Function
TestTryTieredSettle_PreConsumeMatchesPostConsume
--------------------------------------------------------------------------- Pre-consume vs Post-consume consistency ----------------------------------
service/tiered_settle_test.go:124
Function
TestTryTieredSettle_RatioMode_EmptyBillingMode
(t *testing.T)
service/tiered_settle_test.go:623
Function
TestTryTieredSettle_RatioMode_NilSnapshot
--------------------------------------------------------------------------- Ratio mode (negative tests) — TryTieredSettle must return false ----------
service/tiered_settle_test.go:596
Function
TestTryTieredSettle_RatioMode_WrongBillingMode
(t *testing.T)
service/tiered_settle_test.go:607
Function
TestTryTieredSettle_RequestProbeInfluencesBilling
--------------------------------------------------------------------------- Request probe tests ------------------------------------------------------
service/tiered_settle_test.go:280
Function
TestTryTieredSettle_ZeroTokens
(t *testing.T)
service/tiered_settle_test.go:220
Function
TestTryUserAuthCredentialClassification
(t *testing.T)
middleware/auth_test.go:240
Function
TestUnattributableRebuildFailureRetainsOldGeneration
(t *testing.T)
router/plugin_router_test.go:800
Function
TestUnavailablePlugin
(t *testing.T)
relay/requestplugin/requestplugin_test.go:1838
Function
TestUnknownModelModifierIsBadRequestWithoutRetry
(t *testing.T)
relay/convert_request_error_test.go:225
Function
TestUnmarshalBodyReusableNoCopySurvivesBodyReplacement
(t *testing.T)
common/body_storage_test.go:71
← previous
next →
14,001–14,100 of 15,409, ranked by callers