Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Quorinex/Kiro-Go
/ functions
Functions
794 in github.com/Quorinex/Kiro-Go
⨍
Functions
794
◇
Types & classes
85
↓ 1 callers
Function
writeCanonicalJSON
(buf *bytes.Buffer, value interface{})
proxy/cache_tracker.go:536
↓ 1 callers
Function
writeHashChunk
(hasher hashWriter, chunk string)
proxy/cache_tracker.go:596
Function
Get
()
config/config.go:370
Method
GetNextForModel
GetNextForModel 获取下一个支持指定模型的可用账号。 model 应为去掉 thinking 后缀的实际模型名。 若无账号有该模型列表数据,行为与 GetNext 相同(乐观路由)。
pool/account.go:184
Function
GetUserInfo
GetUserInfo 获取用户信息
proxy/kiro_api.go:111
Function
KiroToOpenAIResponse
==================== Kiro -> OpenAI 转换 ====================
proxy/translator.go:2024
Method
MarkOverLimit
MarkOverLimit marks an account as over usage limit (after a 402 / OVERAGE response). With the upstream OverageStatus model, the live status is refresh
pool/account.go:377
Method
RoundTrip
(req *http.Request)
proxy/kiro_api_test.go:294
Function
SetAccountEnabled
SetAccountEnabled toggles the enabled state of an account and persists the change. Used to disable accounts whose refresh token has been revoked (401
config/config.go:467
Function
SetOutput
SetOutput redirects all level outputs to w. Useful for tests.
logger/logger.go:86
Function
TestAccountAllowOverageMigration
TestAccountAllowOverageMigration verifies that a config.json from before the upstream-Overages-switch refactor (which carried `allowOverage: true` per
config/config_test.go:62
Function
TestAccountFailureClassifiers
(t *testing.T)
proxy/account_failover_test.go:5
Function
TestApiImportCredentialsRejectsWhenRefreshFails
TestApiImportCredentialsRejectsWhenRefreshFails verifies the regression: previously, when auth.RefreshToken failed and the user supplied an accessToke
proxy/import_credentials_test.go:35
Function
TestApiImportCredentialsUsesUpstreamExpiresAt
TestApiImportCredentialsUsesUpstreamExpiresAt verifies the happy path: when refresh succeeds, the persisted ExpiresAt reflects the upstream expiresIn,
proxy/import_credentials_test.go:83
Function
TestApiKeyCRUD
(t *testing.T)
config/apikeys_test.go:103
Function
TestApiKeyMigrationFromLegacyField
(t *testing.T)
config/apikeys_test.go:12
Function
TestApiKeyMigrationPublicDeploymentStaysDisabled
Public deployments (RequireApiKey=false) must not silently start enforcing auth after upgrade. The migrated legacy entry is created disabled so the se
config/apikeys_test.go:67
Function
TestApiKeyOverLimit
(t *testing.T)
config/apikeys_test.go:245
Function
TestAuthenticateAcceptsEnabledKey
(t *testing.T)
proxy/apikeys_test.go:86
Function
TestAuthenticateLegacyFallback
(t *testing.T)
proxy/apikeys_test.go:178
Function
TestAuthenticateMasterSwitchOffPassesThrough
Public deployments (RequireApiKey=false) must keep accepting all requests even after keys exist in the config — e.g. an operator drafted some keys but
proxy/apikeys_test.go:315
Function
TestAuthenticateNoAuthRequired
(t *testing.T)
proxy/apikeys_test.go:205
Function
TestAuthenticateRejectsDisabledKey
(t *testing.T)
proxy/apikeys_test.go:62
Function
TestAuthenticateRejectsMissingKey
(t *testing.T)
proxy/apikeys_test.go:40
Function
TestAuthenticateRejectsOverCreditLimit
(t *testing.T)
proxy/apikeys_test.go:147
Function
TestAuthenticateRejectsOverTokenLimit
(t *testing.T)
proxy/apikeys_test.go:116
Function
TestAuthenticateRequiredWithoutKeysFailsClosed
When auth is required but no keys are configured, every request must be rejected. Previously the legacy fallback returned (nil,nil) and silently let t
proxy/apikeys_test.go:335
Function
TestBuildAnthropicModelsResponseGeneratesThinkingVariants
(t *testing.T)
proxy/handler_test.go:464
Function
TestBuildAuthTransportFallsBackToEnvironmentProxy
(t *testing.T)
auth/http_client_test.go:20
Function
TestBuildAuthTransportUsesExplicitProxyURL
(t *testing.T)
auth/http_client_test.go:9
Function
TestBuildClaudeUsageMapIncludesCacheFields
(t *testing.T)
proxy/cache_tracker_test.go:49
Function
TestBuildKiroTransportFallsBackToEnvironmentProxy
(t *testing.T)
proxy/kiro_test.go:180
Function
TestBuildKiroTransportUsesExplicitProxyURL
(t *testing.T)
proxy/kiro_test.go:169
Function
TestBuildRuntimeHeaderValuesUsesRuntimeAPIFormat
(t *testing.T)
proxy/kiro_headers_test.go:30
Function
TestBuildStreamingHeaderValuesAlignsWithKiroIDEFormat
(t *testing.T)
proxy/kiro_headers_test.go:9
Function
TestCanonicalCacheValueIgnoresPositionKeys
(t *testing.T)
proxy/cache_tracker_test.go:169
Function
TestCanonicalCacheValuePreservesSemanticPositionKeys
(t *testing.T)
proxy/cache_tracker_test.go:191
Function
TestClaudeConversationIDStableFromAnchor
(t *testing.T)
proxy/translator_test.go:205
Function
TestClaudeNonStreamRetriesNextAccountAfterPreResponseFailure
(t *testing.T)
proxy/handler_test.go:28
Function
TestClaudeToKiroDropsLeadingAssistantHistory
(t *testing.T)
proxy/translator_test.go:250
Function
TestClaudeToKiroFlattensHistoryToolCyclesForCompaction
TestClaudeToKiroFlattensHistoryToolCyclesForCompaction reproduces the context compaction scenario that triggered upstream HTTP 400 "Improperly formed
proxy/translator_compaction_test.go:14
Function
TestClaudeToKiroKeepsActiveToolTurnStructured
TestClaudeToKiroKeepsActiveToolTurnStructured verifies the in-progress tool case still works: the last assistant turn issues a tool_use and the final
proxy/translator_compaction_test.go:100
Function
TestClaudeToKiroSmallPayloadNotTruncated
TestClaudeToKiroSmallPayloadNotTruncated ensures normal-sized conversations are left untouched (no placeholder inserted).
proxy/translator_truncate_test.go:74
Function
TestClaudeToKiroTruncatesOversizedHistory
TestClaudeToKiroTruncatesOversizedHistory builds a conversation whose history far exceeds the upstream input limit and verifies the converted payload
proxy/translator_truncate_test.go:13
Function
TestClaudeToolResultImageAttachedToCurrentMessage
(t *testing.T)
proxy/translator_test.go:474
Function
TestClaudeToolResultMixedTextAndImage
(t *testing.T)
proxy/translator_test.go:524
Function
TestCloneClaudeRequestForThinkingInjectsPromptWithoutMutatingOriginal
(t *testing.T)
proxy/handler_test.go:260
Function
TestCloneClaudeRequestForThinkingPreservesStructuredSystemBlocks
(t *testing.T)
proxy/handler_test.go:284
Function
TestCollapsesConsecutiveIdenticalToolResults
TestCollapsesConsecutiveIdenticalToolResults covers a client retry loop that sends the same failing tool result many times. After hollow assistant tur
proxy/tool_narration_pollution_test.go:81
Function
TestConvertOpenAIToolsEmitsNonEmptyNames
TestConvertOpenAIToolsEmitsNonEmptyNames ensures the converter never emits a tool spec with an empty name (Kiro rejects those) and preserves valid nam
proxy/openai_tool_format_test.go:45
Function
TestConvertOpenAIToolsSanitizesSchemaAndDescription
(t *testing.T)
proxy/translator_test.go:355
Function
TestDisableAccountSetsCooldown
--------------------------------------------------------------------------- DisableAccount -----------------------------------------------------------
pool/account_test.go:216
Function
TestDropsDotPollutedAssistantTurns
TestDropsDotPollutedAssistantTurns covers the second-order pollution: after stripping "[Called tool ...]" from assistant turns that held only that tex
proxy/tool_narration_pollution_test.go:112
Function
TestEnsureObjectSchemaRemovesKiroRejectedFieldsRecursively
(t *testing.T)
proxy/translator_test.go:315
Function
TestExtractOpenAIMessageTextStructured
(t *testing.T)
proxy/translator_test.go:8
Function
TestGenerateApiKeyValueIsUnique
(t *testing.T)
config/apikeys_test.go:286
Function
TestGetContextWindowSize
TestGetContextWindowSize verifies models are classified into the correct context window. This drives the input-token count that clients use to decide
proxy/context_window_test.go:9
Function
TestGetNextExcludingSkipsExcludedAccount
(t *testing.T)
pool/account_test.go:240
Function
TestGetNextForModelExcludingReturnsNilOnEmptyPool
(t *testing.T)
pool/account_test.go:204
Function
TestGetNextForModelExcludingReturnsNilWhenAllExcluded
(t *testing.T)
pool/account_test.go:196
Function
TestGetNextForModelExcludingSkipsExcludedAccount
(t *testing.T)
pool/account_test.go:258
Function
TestGetNextForModelExcludingSkipsExcludedAccounts
(t *testing.T)
pool/account_test.go:179
Function
TestGetNextKeepsFiveMinuteTokenAvailable
(t *testing.T)
pool/account_test.go:65
Function
TestHandleToolUseEventGeneratesMissingToolUseID
(t *testing.T)
proxy/kiro_test.go:110
Function
TestHandleToolUseEventReplacesGeneratedIDWhenRealIDArrives
(t *testing.T)
proxy/kiro_test.go:136
Function
TestInitKiroHttpClientKeepsShortRestTimeout
(t *testing.T)
proxy/kiro_test.go:195
Function
TestIsAuthFailureIgnoresFalsePositives
(t *testing.T)
pool/account_test.go:106
Function
TestIsAuthFailureNilError
(t *testing.T)
pool/account_test.go:122
Function
TestIsAuthFailureRecognizes401And403
--------------------------------------------------------------------------- IsAuthFailure ------------------------------------------------------------
pool/account_test.go:88
Function
TestIsSuspensionErrorDetectsKnownMessages
--------------------------------------------------------------------------- IsSuspensionError --------------------------------------------------------
pool/account_test.go:132
Function
TestIsSuspensionErrorIgnoresUnrelatedErrors
(t *testing.T)
pool/account_test.go:146
Function
TestIsSuspensionErrorNilError
(t *testing.T)
pool/account_test.go:159
Function
TestKiroToClaudeResponseCanEmitEmptyThinkingBlock
(t *testing.T)
proxy/translator_test.go:270
Function
TestMaskApiKey
(t *testing.T)
config/apikeys_test.go:270
Function
TestMergeUniqueModelsPreservesUnionAcrossAccounts
(t *testing.T)
proxy/handler_test.go:443
Function
TestNoToolInvocationTextInAssistantHistory
TestNoToolInvocationTextInAssistantHistory is a regression guard for the few-shot pollution bug: when historical tool calls were narrated as "[Called
proxy/tool_narration_pollution_test.go:16
Function
TestNormalizeChunkBasicProgression
(t *testing.T)
proxy/kiro_test.go:14
Function
TestNormalizeChunkOverlapDelta
(t *testing.T)
proxy/kiro_test.go:40
Function
TestNormalizeChunkPrefixRewindDoesNotReplay
(t *testing.T)
proxy/kiro_test.go:25
Function
TestOpenAIConversationIDRandomForSyntheticAnchor
(t *testing.T)
proxy/translator_test.go:234
Function
TestOpenAIConversationIDStableFromAnchor
(t *testing.T)
proxy/translator_test.go:183
Function
TestOpenAIToKiroAssistantMapContentInHistory
(t *testing.T)
proxy/translator_test.go:114
Function
TestOpenAIToKiroAssistantToolCallsDoNotInjectPlaceholder
(t *testing.T)
proxy/translator_test.go:138
Function
TestOpenAIToKiroDoesNotDuplicateToolResultText
TestOpenAIToKiroDoesNotDuplicateToolResultText reproduces the bug where a non-final tool-result history entry was pre-filled with the "Tool results:"
proxy/openai_toolresult_dedup_test.go:13
Function
TestOpenAIToKiroPreservesStructuredAssistantAndToolContent
(t *testing.T)
proxy/translator_test.go:26
Function
TestOpenAIToolAcceptsNestedFormat
TestOpenAIToolAcceptsNestedFormat verifies the Chat Completions nested shape still works after adding flat-format support.
proxy/openai_tool_format_test.go:32
Function
TestOpenAIToolAcceptsResponsesFlatFormat
TestOpenAIToolAcceptsResponsesFlatFormat verifies that the Responses API tool shape (name/description/parameters at the top level) is parsed correctly
proxy/openai_tool_format_test.go:13
Function
TestOpenAIToolResultImageAttachedToCurrentMessage
(t *testing.T)
proxy/translator_test.go:566
Function
TestOpenAIToolResultImageCarriedWhenFollowedByUser
(t *testing.T)
proxy/translator_test.go:595
Function
TestOverLimitAccountsAreSkippedByDefault
(t *testing.T)
pool/account_test.go:11
Function
TestOverLimitAccountsCanBeSelectedWhenUpstreamOverageEnabled
(t *testing.T)
pool/account_test.go:29
Function
TestOverLimitAccountsRemainSkippedWhenUpstreamOverageDisabled
(t *testing.T)
pool/account_test.go:49
Function
TestParseEventStreamFinishesPendingToolUseOnEOF
(t *testing.T)
proxy/kiro_test.go:48
Function
TestParseEventStreamNilCallbackFieldsAreNoOp
(t *testing.T)
proxy/kiro_test.go:100
Function
TestParseEventStreamNilCallbackIsNoOp
(t *testing.T)
proxy/kiro_test.go:82
Function
TestParseModelAndThinking
(t *testing.T)
proxy/translator_test.go:402
Function
TestParseModelAndThinkingDoesNotRewriteDatedSnapshotMinor
(t *testing.T)
proxy/translator_test.go:461
Function
TestPromptCacheImplicitBreakpointAtMessageEnd
TestPromptCacheImplicitBreakpointAtMessageEnd verifies that once any explicit cache_control breakpoint has been seen, subsequent message-end boundarie
proxy/cache_tracker_test.go:218
Function
TestPromptCacheStableAcrossBillingHeaderDrift
TestPromptCacheStableAcrossBillingHeaderDrift verifies that Claude Code's per-request "x-anthropic-billing-header: cc_version=...; cch=...;" system bl
proxy/cache_tracker_test.go:81
Function
TestPromptCacheStableWhenBillingHeaderAppearsOrDisappears
(t *testing.T)
proxy/cache_tracker_test.go:127
← previous
next →
601–700 of 794, ranked by callers