MCPcopy Create free account

hub / github.com/alibaba/open-code-review / functions

Functions3,533 in github.com/alibaba/open-code-review

↓ 4 callersMethodconfirmDeleteCustomProviderModel
()
cmd/opencodereview/provider_tui.go:2804
↓ 4 callersMethodconfirmDeleteOfficialModel
()
cmd/opencodereview/provider_tui.go:2842
↓ 4 callersMethodcustomProviderActiveModel
(cp customProviderListItem)
cmd/opencodereview/provider_tui.go:202
↓ 4 callersMethoddedupEnabled
()
internal/scan/agent.go:88
↓ 4 callersFunctiondefaultAuthHeader
(protocol string)
internal/llm/resolver.go:593
↓ 4 callersFunctiondescribeStart
(s session.Summary)
cmd/opencodereview/session_cmd.go:390
↓ 4 callersFunctionemitFailureUsage
emitFailureUsage writes a best-effort structured usage record to stderr when a review fails, so the outer caller still sees the cost of the failed att
cmd/opencodereview/output.go:440
↓ 4 callersFunctionensureMessagesSuffix
ensureMessagesSuffix appends /v1/messages to base URLs that lack a versioned path.
internal/llm/resolver.go:707
↓ 4 callersFunctionestimateCost
(items []model.ScanItem, planEnabled, dedupEnabled, summaryEnabled bool)
internal/scan/estimate.go:62
↓ 4 callersFunctionestimateDiffFileTokens
estimateDiffFileTokens projects the input+output token cost of reviewing a single diff (PLAN + MAIN_TASK rounds). It mirrors scan.estimateFileTokens b
internal/agent/estimate.go:55
↓ 4 callersFunctionexecuteDelegatePreview
(opts delegateOptions)
cmd/opencodereview/delegate_cmd.go:164
↓ 4 callersMethodexecuteSubtask
executeSubtask runs the scan pipeline for one file: 1. Optional PLAN_TASK: produce a JSON checklist of focus areas. 2. MAIN_TASK: review the file with
internal/scan/agent.go:695
↓ 4 callersFunctionfencedBlock
(content, language = "")
scripts/github-actions/post-review-comments.js:1617
↓ 4 callersMethodfilterLargeDiffs
filterLargeDiffs drops diffs whose diff content alone consumes more than 80% of MaxTokens.
internal/agent/agent.go:1376
↓ 4 callersMethodfilterLargeScans
filterLargeScans drops items whose content exceeds 80% of MaxTokens.
internal/scan/agent.go:433
↓ 4 callersMethodfinalizeManifest
finalizeManifest freezes the run's coverage builder and stores the immutable manifest on the session for persistence and CLI consumption. Nil-safe. A
internal/agent/agent.go:1066
↓ 4 callersFunctionfirstLine
firstLine returns the first non-empty trimmed line of git output, so a stray trailing newline or an unexpected second line never pollutes a resolved S
internal/diff/git.go:526
↓ 4 callersFunctionformatPlanGuidance
formatPlanGuidance parses the PLAN_TASK JSON output into a markdown snippet suitable for embedding in MAIN_TASK. On parse failure it returns the raw c
internal/scan/agent.go:1006
↓ 4 callersFunctiongetShellEnv
()
extensions/vscode/src/extension/services/shellEnv.ts:29
↓ 4 callersFunctionhandleSession
(w http.ResponseWriter, r *http.Request, root, repo, sessionID string)
internal/viewer/handler.go:64
↓ 4 callersFunctionhandleSessions
(w http.ResponseWriter, r *http.Request, root, repo string)
internal/viewer/handler.go:35
↓ 4 callersFunctionhumanTokens
humanTokens formats a token count as e.g. "1.2M" / "850K" / "420".
internal/scan/estimate.go:114
↓ 4 callersFunctionhumanTokens
humanTokens formats a token count as e.g. "1.2M" / "850K" / "420". Mirrors internal/scan/estimate.go; kept here so agent has no scan import.
internal/agent/estimate.go:101
↓ 4 callersFunctionisUserEditMsg
isUserEditMsg reports whether msg represents user text input (typing or paste).
cmd/opencodereview/provider_tui.go:855
↓ 4 callersFunctionitemList
(paths ...string)
internal/scan/batch_test.go:13
↓ 4 callersFunctionloadTestTemplate
loadTestTemplate returns a validated default template for runtime tests.
cmd/opencodereview/shared_llmruntime_test.go:17
↓ 4 callersMethodmaybeRunDedup
maybeRunDedup, when the template has a DedupTask and the batch produced at least DedupMinComments comments, invokes the DEDUP_TASK LLM to merge near-d
internal/scan/agent.go:865
↓ 4 callersMethodmaybeRunProjectSummary
maybeRunProjectSummary runs the post-batch PROJECT_SUMMARY_TASK over the union of all collected comments. Best-effort: any error / empty input no-temp
internal/scan/agent.go:789
↓ 4 callersFunctionmockManifest
(state session.TerminalState)
cmd/opencodereview/emit_run_result_test.go:55
↓ 4 callersMethodmodelProviderName
()
cmd/opencodereview/provider_tui.go:397
↓ 4 callersFunctionnKey
()
cmd/opencodereview/provider_tui_test.go:1146
↓ 4 callersFunctionnormalizeLine
normalizeLine removes leading/trailing whitespace and strips any leading '+' or '-' diff marker.
internal/diff/resolver.go:235
↓ 4 callersFunctionoutputJSONWithWarnings
(comments []model.LlmComment, warnings []agent.AgentWarning, filesReviewed, inputTokens, outputTokens, totalT
cmd/opencodereview/output.go:309
↓ 4 callersFunctionoutputTextWithWarnings
(comments []model.LlmComment, warnings []agent.AgentWarning, manifest *session.RunManifest)
cmd/opencodereview/output.go:64
↓ 4 callersFunctionparseNameStatus
(output: string)
extensions/vscode/src/extension/services/gitMap.ts:161
↓ 4 callersFunctionparseNonNegInt
(val, defaultVal)
scripts/github-actions/post-review-comments.js:1064
↓ 4 callersFunctionpartitionMessages
partitionMessages divides messages into frozen, compress, and active zones. Frozen zone is always messages[0:2]. Active zone preserves the K most rece
internal/llmloop/compression.go:126
↓ 4 callersMethodpost
(msg: ConfigPanelHostToWebview)
extensions/vscode/src/extension/providers/ConfigPanelProvider.ts:61
↓ 4 callersFunctionprintVersion
()
cmd/opencodereview/version.go:28
↓ 4 callersMethodread
(self)
examples/gerrit_ci/post_review_test.py:514
↓ 4 callersFunctionreadAllPages
(tag, pageFn, log, maxPages = 50)
scripts/github-actions/post-review-comments.js:1230
↓ 4 callersFunctionreadJSONLRecords
(t *testing.T, path string)
internal/session/persist_test.go:113
↓ 4 callersMethodrelease
()
internal/gitcmd/runner.go:44
↓ 4 callersMethodreloadConfigAfterSaveFailure
reloadConfigAfterSaveFailure reloads on-disk config and refreshes derived provider TUI state so the UI matches persisted data after a failed save. Ret
cmd/opencodereview/provider_tui.go:1579
↓ 4 callersMethodreloadConfigAfterSaveFailure
reloadConfigAfterSaveFailure reloads on-disk config so in-memory state matches persisted data after a failed save. Returns false when reload could not
cmd/opencodereview/provider_tui.go:2593
↓ 4 callersFunctionrenderListName
(name string, isCursor bool)
cmd/opencodereview/provider_tui.go:1949
↓ 4 callersFunctionresolveBackgroundFilePath
(repoDir, path string)
cmd/opencodereview/background_file.go:25
↓ 4 callersFunctionresolveRepoDir
resolveRepoDir resolves the repo dir for `ocr rules check`. It delegates to resolveWorkingDir(requireGit=true) so it anchors at the git top-level just
cmd/opencodereview/review_cmd.go:323
↓ 4 callersFunctionresolveWorkingDirForSession
resolveWorkingDirForSession accepts an explicit --repo flag value and falls back to the current working directory. Unlike resolveRepoDir it does not r
cmd/opencodereview/session_cmd.go:245
↓ 4 callersMethodresolvedModel
resolvedModel returns the model to persist, falling back to the in-session pick for the provider being finalized when result.model is empty.
cmd/opencodereview/provider_tui.go:88
↓ 4 callersMethodreviewMode
()
internal/agent/agent.go:732
↓ 4 callersFunctionreviewModeString
(from, to, commit string)
internal/agent/util.go:95
↓ 4 callersFunctionrollbackCfgActiveModel
(cfg *Config, providerName, prevModel string)
cmd/opencodereview/provider_tui.go:448
↓ 4 callersFunctionrunConfigSet
(key, value string)
cmd/opencodereview/config_cmd.go:109
↓ 4 callersFunctionrunLLMTest
()
cmd/opencodereview/llm_cmd.go:53
↓ 4 callersMethodselectedModel
()
cmd/opencodereview/provider_tui.go:2886
↓ 4 callersMethodselectedModelFromState
()
cmd/opencodereview/provider_tui.go:1822
↓ 4 callersFunctionsessionJSONLPath
(t *testing.T, repoDir, sessionID string)
internal/session/persist_test.go:133
↓ 4 callersFunctionsetupFileFindRepo
(t *testing.T)
internal/tool/file_find_test.go:92
↓ 4 callersMethodsummaryEnabled
()
internal/scan/agent.go:92
↓ 4 callersFunctiontaskDoneResponse
()
internal/llmloop/loop_test.go:57
↓ 4 callersFunctiontaskDoneResponseWithArguments
(arguments string)
internal/llmloop/loop_test.go:36
↓ 4 callersMethodtransition
transition moves a selected item to a terminal state through the single coverage entry point. Unknown item_id, an invalid failed classification, an em
internal/session/manifest.go:559
↓ 4 callersFunctionunquoteGitPath
(path: string)
extensions/vscode/src/extension/services/gitMap.ts:130
↓ 4 callersMethodupdateManualForm
(key string, msg tea.KeyPressMsg)
cmd/opencodereview/provider_tui.go:1349
↓ 4 callersFunctionuseSectionTitleStyle
()
pages/src/hooks/useResponsiveStyle.ts:15
↓ 4 callersFunctionuserAgent
(provider string)
internal/llm/client.go:31
↓ 4 callersMethodvalid
valid reports whether c is one of the fixed item failure classes.
internal/session/manifest.go:67
↓ 4 callersFunctionvalidateTimeoutSec
validateTimeoutSec converts a config-file timeout (in seconds) to time.Duration. Returns 0 for zero input (use default). Rejects negative values and o
internal/llm/resolver.go:173
↓ 4 callersFunctionwriteCommit
writeCommit writes content to name, stages it, and commits with msg.
internal/diff/git_resolve_test.go:41
↓ 3 callersMethodCallTool
CallTool invokes a tool on the MCP server and returns the text result.
internal/mcp/client.go:158
↓ 3 callersMethodCollectPendingComments
CollectPendingComments awaits any async comment-processing workers and returns the aggregated comments from the collector. Safe to call once per sessi
internal/llmloop/loop.go:139
↓ 3 callersMethodCompletionsWithCtx
CompletionsWithCtx sends a Responses API request and maps the result back to the shared ChatResponse shape.
internal/llm/responses_client.go:77
↓ 3 callersFunctionComputeLineDiff
ComputeLineDiff returns a line-level diff between oldLines and newLines. Uses Myers-style LCS to find common subsequences, then emits context/added/de
internal/suggestdiff/diff.go:27
↓ 3 callersFunctionContentLogging
ContentLogging returns true when content logging is enabled via OCR_CONTENT_LOGGING.
internal/telemetry/provider.go:78
↓ 3 callersFunctionDisplayAddr
DisplayAddr rewrites a wildcard listen address (empty host, 0.0.0.0, or ::) to a localhost form so printed URLs are always openable in a browser. Non-
internal/viewer/hostguard.go:122
↓ 3 callersMethodFinalManifest
FinalManifest returns the frozen manifest stored for this run, or nil when the run produced none (legacy/scan, or a construction failure).
internal/session/history.go:208
↓ 3 callersMethodGet
Get returns the diff text for path.
internal/tool/file_read_diff.go:27
↓ 3 callersFunctionListSessions
ListSessions returns lightweight summaries for all sessions in a repo subdir.
internal/viewer/store.go:111
↓ 3 callersMethodMergeBase
MergeBase returns the computed merge-base commit hash for range mode.
internal/diff/git.go:165
↓ 3 callersFunctionNewClient
NewClient starts an MCP server subprocess (stdio transport), initializes the connection, and caches the list of available tools. The context governs t
internal/mcp/client.go:30
↓ 3 callersFunctionNewToolCallMessage
NewToolCallMessage creates an assistant message with text content and tool invocations.
internal/llm/client.go:72
↓ 3 callersFunctionOf
Of returns a checkpoint with data.
internal/tool/response_message.go:27
↓ 3 callersFunctionPrintToolCallStarted
PrintToolCallStarted prints a line when a tool begins execution. Args are summarized as key-value pairs (path, search terms, etc.). Example: [ocr] ▶
internal/telemetry/events.go:90
↓ 3 callersFunctionRecordLLMRequest
(ctx context.Context, model string, dur time.Duration, totalTokens int64, status string)
internal/telemetry/metrics.go:107
↓ 3 callersFunctionRecordToolCall
(ctx context.Context, name string, dur time.Duration, ok bool)
internal/telemetry/metrics.go:127
↓ 3 callersMethodRemoveByPathAndIndices
RemoveByPathAndIndices removes comments for a given path whose per-path index (0-based position among all comments with that path) is in the indices s
internal/tool/comment_collector.go:96
↓ 3 callersMethodResolve
Resolve returns the rule text for a given file path. Patterns with brace expansion like "*.{go,py}" are expanded into "*.go", "*.py". The first match
internal/config/rules/system_rules.go:130
↓ 3 callersFunctionResolveConfig
ResolveConfig builds the final Config by merging defaults, JSON config, and env vars. Precedence: defaults < config.json < environment variables.
internal/telemetry/config.go:113
↓ 3 callersMethodSessionID
SessionID returns the current scan's persisted session ID. It returns an empty string when no session file exists.
internal/scan/agent.go:172
↓ 3 callersMethodSessionID
SessionID returns the persisted session identifier so callers can show it in JSON output or failure diagnostics. Returns "" when no session was create
cmd/opencodereview/shared.go:291
↓ 3 callersFunctionSessionsDir
SessionsDir returns the on-disk directory that holds JSONL session files for a given repository. It does not create the directory.
internal/session/list.go:87
↓ 3 callersFunctionSessionsRoot
SessionsRoot returns the root directory where session JSONL files are stored.
internal/viewer/store.go:25
↓ 3 callersMethodSetDiffMap
SetDiffMap replaces the diff snapshot. Must be called before concurrent access begins.
internal/tool/file_read_diff.go:42
↓ 3 callersFunctionShutdownWithTimeout
ShutdownWithTimeout creates a timeout context and calls Shutdown.
internal/telemetry/shutdown.go:36
↓ 3 callersMethodSnapshot
Snapshot returns the current count of stored comments. Pair with Since / ReplaceSince to operate on the comments added between two points in time (e.g
internal/tool/comment_collector.go:56
↓ 3 callersFunctionStartServer
(addr string)
internal/viewer/server.go:20
↓ 3 callersMethodSubmitFor
SubmitFor is Submit plus registration under key, so AwaitKey can wait for exactly the units submitted under that key instead of the whole pool. Calle
internal/llmloop/pool.go:74
↓ 3 callersMethodTotalOutputTokens
TotalOutputTokens returns the accumulated completion tokens from all LLM calls.
internal/llmloop/loop.go:69
↓ 3 callersMethodTotalTokensUsed
TotalTokensUsed / TotalInputTokens / ... delegate to the underlying runner.
internal/scan/agent.go:208
← previousnext →401–500 of 3,533, ranked by callers