MCPcopy Create free account

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

Functions4,238 in github.com/alibaba/open-code-review

↓ 16 callersFunctionContextWithSessionKey
ContextWithSessionKey returns a context carrying the given session key. Review and scan runs bind their session history's SessionID at the top of Run
internal/llm/sessionkey.go:31
↓ 16 callersFunctionLoadSession
LoadSession fully parses a JSONL file into a ViewSession.
internal/viewer/store.go:311
↓ 16 callersMethodMarkFailed
MarkFailed records that the item failed. class must be a valid, specific failure class — an empty or unknown-string class is rejected rather than down
internal/session/manifest.go:704
↓ 16 callersMethoddisplayModels
()
cmd/opencodereview/provider_tui.go:2722
↓ 16 callersMethodexecuteToolCall
executeToolCall dispatches a single tool call from the LLM response and records the result in session history. code_comment handling includes optional
internal/llmloop/loop.go:453
↓ 16 callersFunctionokAttempt
()
internal/llm/retry_report_test.go:34
↓ 16 callersFunctionparseScanFlags
parseScanFlags provides test compatibility: parses args through a fresh cobra command instance and returns the resulting scanOptions.
cmd/opencodereview/compat_test.go:46
↓ 16 callersFunctionreviewItemFingerprint
(mode string, d model.Diff)
internal/agent/agent.go:849
↓ 16 callersFunctionrunGitTest
runGitTest runs a git command in dir and fails the test on error.
internal/diff/git_test.go:19
↓ 16 callersFunctionwriteConfigJSON
(t *testing.T, cfg configFile)
internal/llm/resolver_keycmd_test.go:20
↓ 15 callersFunctionIsEnabled
IsEnabled returns true when telemetry has been initialized with exporters.
internal/telemetry/provider.go:73
↓ 15 callersFunctionSessionFilePath
SessionFilePath returns the JSONL path for a persisted session.
internal/session/resume.go:81
↓ 15 callersFunctionbuild
(comments, **extra)
examples/gerrit_ci/post_review_test.py:43
↓ 15 callersFunctiongetHeadCommit
(t *testing.T, dir string)
internal/tool/code_search_test.go:132
↓ 15 callersFunctionhttp_error
Build an HTTPError suitable for mocking urlopen.
examples/gitlab_ci/post_review_test.py:79
↓ 15 callersFunctionloadBackgroundFile
(path string)
cmd/opencodereview/background_file.go:49
↓ 15 callersFunctionnewAgentForTest
(t *testing.T, tpl template.ScanTemplate)
internal/scan/agent_test.go:18
↓ 15 callersFunctiontruncate
(s string, maxLen int)
internal/config/rules/system_rules_test.go:252
↓ 14 callersFunctionNewCommentWorkerPool
NewCommentWorkerPool creates a pool with the given concurrency limit. workerCount <= 0 defaults to 8.
internal/llmloop/pool.go:52
↓ 14 callersMethodRegisterSelected
RegisterSelected records an item in the selected set (the coverage denominator). It must be called once per item during the pre-dispatch pass, after f
internal/session/manifest.go:495
↓ 14 callersFunctionResolveEndpointWithOptions
ResolveEndpointWithOptions resolves an endpoint by first honoring an explicit provider selection. Otherwise it processes config, environment, then she
internal/llm/resolver.go:96
↓ 14 callersMethodSetError
SetError records an error for this task record, writes an llm_error entry to the JSONL stream, and increments the session-level LLM failure counter.
internal/session/history.go:463
↓ 14 callersFunctionanthropicClient
(url string, c *RetryCollector, extra map[string]string)
internal/llm/retry_observer_test.go:71
↓ 14 callersFunctionmockManifest
(state session.TerminalState)
cmd/opencodereview/emit_run_result_test.go:56
↓ 14 callersFunctionmodelIdxForName
(t *testing.T, m providerTUIModel, name string)
cmd/opencodereview/provider_tui_test.go:1568
↓ 14 callersFunctionnewModelTUI
newModelTUI builds a model-only TUI for tests. It has no config path or existing config, so add/delete/persist operations are unavailable — use newMod
cmd/opencodereview/provider_tui.go:2665
↓ 14 callersFunctionrightKey
()
cmd/opencodereview/provider_tui_test.go:30
↓ 14 callersFunctionuseTranslation
()
pages/src/i18n/context.tsx:67
↓ 14 callersFunctionwriteTestFile
(t *testing.T, dir, name, content string)
internal/tool/file_read_test.go:17
↓ 13 callersFunctionCountTokens
(text string)
internal/llm/client.go:356
↓ 13 callersFunctionLoadResumeState
LoadResumeState replays a previous session JSONL into a fingerprint index. A record that cannot be parsed fails the load: with nothing to arbitrate co
internal/session/resume.go:97
↓ 13 callersMethodManifest
Manifest returns the run's coverage builder, or nil for legacy/scan sessions that did not opt in via SessionOptions.Operation. Callers must be nil-saf
internal/session/history.go:187
↓ 13 callersMethodValidateOptions
ValidateOptions verifies that this session can be resumed in the requested review mode at all. It deliberately does not compare the ref text the user
internal/session/resume.go:274
↓ 13 callersFunctioncloneProviderEntry
cloneProviderEntry deep-copies a ProviderEntry so callers (rollback paths, map cloning) can safely mutate the returned value without aliasing the orig
cmd/opencodereview/provider_tui.go:1289
↓ 13 callersFunctioncollectCustomProviders
(cfg *Config)
cmd/opencodereview/provider_tui.go:252
↓ 13 callersMethodset
(key: string, value: string)
extensions/vscode/src/extension/services/ConfigService.ts:88
↓ 13 callersFunctionwriteResolverConfig
(t *testing.T, cfg configFile)
internal/llm/resolver_test.go:284
↓ 12 callersMethodGetDiff
GetDiff returns all changes as parsed model.Diff structs.
internal/diff/git.go:173
↓ 12 callersFunctionNormalizeAuthHeader
NormalizeAuthHeader normalizes an auth header value to a canonical form. It returns an error for unrecognized values.
internal/llm/resolver.go:822
↓ 12 callersFunctionNormalizeProtocol
NormalizeProtocol canonicalizes protocol names. It is case-insensitive and trims whitespace. Empty string is returned as-is (the caller decides the de
internal/llm/protocol.go:45
↓ 12 callersMethodOutput
Output executes a git command and returns stdout only.
internal/gitcmd/runner.go:60
↓ 12 callersMethodRead
Read returns the full content of a file path (relative to RepoDir), resolved according to the active review mode. - Workspace: reads directly from the
internal/tool/filereader.go:71
↓ 12 callersFunctionerrAttempt
(class ErrorClass, phase FailurePhase, status int)
internal/llm/retry_report_test.go:30
↓ 12 callersFunctionlog
(msg)
scripts/github-actions/post-review-comments.js:88
↓ 12 callersFunctionlog
(msg)
examples/gitlab_ci/post_review.py:54
↓ 12 callersFunctionmodelTUIIdxForName
(t *testing.T, m modelTUIModel, name string)
cmd/opencodereview/provider_tui_funcs_test.go:1136
↓ 12 callersFunctionmustUnmarshal
mustUnmarshal is a test helper that unmarshals SARIF output and fails the test on error, so malformed output produces a clear failure instead of a nil
cmd/opencodereview/sarif_test.go:23
↓ 12 callersFunctionresolveLocale
(raw: string)
extensions/vscode/src/shared/i18n.ts:330
↓ 12 callersFunctionwriteFile
(t *testing.T, root, rel string, content []byte)
internal/scan/provider_test.go:105
↓ 11 callersMethodAwait
Await blocks until all submitted work has completed and returns aggregated results from every Submit call so far. A panic in submitted work is recove
internal/llmloop/pool.go:129
↓ 11 callersMethodCompletionTokenLimit
CompletionTokenLimit returns the output cap for LLM requests. Runtime prompt-limit overrides must not silently expand the model's output budget.
internal/config/template/template.go:54
↓ 11 callersMethodResolveDetail
(path string)
internal/config/rules/system_rules.go:123
↓ 11 callersFunctionResolveEndpointWithModelOverride
ResolveEndpointWithModelOverride is a compatibility wrapper around ResolveEndpointWithOptions for callers that only override the model.
internal/llm/resolver.go:89
↓ 11 callersFunctionSetAttr
SetAttr sets a single attribute on a span.
internal/telemetry/span.go:66
↓ 11 callersMethodSetResponse
SetResponse records the LLM response in the most recent TaskRecord of the given type. It uses actual token usage from the API response when available,
internal/session/history.go:407
↓ 11 callersMethodToolCalls
()
cmd/opencodereview/shared.go:343
↓ 11 callersMethodWarnings
()
cmd/opencodereview/shared.go:338
↓ 11 callersMethodapplyResumeLine
applyResumeLine folds one record into the index. It reports an unparseable line to the caller, which decides whether that is fatal.
internal/session/resume.go:150
↓ 11 callersFunctioncaptureStderr
captureStderr captures everything written to os.Stderr during fn. Mirrors captureStdout; used to assert structured usage emitted on the failure path.
cmd/opencodereview/output_helpers_test.go:410
↓ 11 callersFunctioncm
(path, content string)
internal/tool/comment_collector_test.go:12
↓ 11 callersFunctionfinishManifestFlow
(t *testing.T, a *Agent)
internal/agent/manifest_integration_test.go:140
↓ 11 callersFunctiongenerateUUID
()
internal/session/persist.go:63
↓ 11 callersFunctionhttp_error
(code, body=b"", reason="error")
examples/gerrit_ci/post_review_test.py:271
↓ 11 callersFunctionmustJSON
--- helpers ---
internal/session/resume_test.go:736
↓ 11 callersFunctionofficialConfigModelTUI
(t *testing.T, configPath string, extraModels []string)
cmd/opencodereview/provider_tui_funcs_test.go:1051
↓ 11 callersFunctionoutputSARIF
outputSARIF writes a SARIF v2.1.0 document to stdout. The document always contains a single run with the 8 built-in category rules, one result per Llm
cmd/opencodereview/sarif.go:131
↓ 11 callersMethodpost
(msg: HostToWebview)
extensions/vscode/src/extension/providers/SidebarProvider.ts:56
↓ 11 callersFunctionrenderTemplate
(w http.ResponseWriter, name string, data any)
internal/viewer/server.go:299
↓ 11 callersFunctionresolveKeyCmd
resolveKeyCmd runs a credential-fetching shell command and returns its trimmed, single-line stdout. label names the source (e.g. `api_key_cmd for prov
internal/llm/keycmd.go:59
↓ 11 callersFunctionretryReportFixture
retryReportFixture is the report used by most rendering assertions: one request recovered after two errors, one request that never succeeded, and a to
cmd/opencodereview/retry_report_render_test.go:22
↓ 11 callersFunctionsetColor
setColor pins the resolved color decision for one test and restores the previous state afterwards. Tests capture stdout through a pipe, which is not a
cmd/opencodereview/color_test.go:16
↓ 11 callersFunctionuseResponsive
()
pages/src/hooks/useResponsive.ts:12
↓ 10 callersFunctionEvent
Event emits a structured event as a span with immediate end.
internal/telemetry/events.go:23
↓ 10 callersFunctionLoadDefault
LoadDefault parses the embedded system_rules.json and resolves rule file references.
internal/config/rules/system_rules.go:90
↓ 10 callersFunctionNewFileRead
(fr *FileReader)
internal/tool/file_read.go:19
↓ 10 callersFunctionNewLLMClient
--- Factory --- NewLLMClient creates the appropriate client based on the resolved endpoint protocol. protocol dispatch (canonical names from protocol.
internal/llm/client.go:286
↓ 10 callersFunctionNewManifestBuilder
NewManifestBuilder creates a builder for a run identified by runID (the canonical session ID) and operation ("review" or "scan").
internal/session/manifest.go:351
↓ 10 callersFunctionNewProvider
NewProvider creates a Provider that enumerates the repository at repoDir. If paths is non-empty each element must be a repo-relative path (file or dir
internal/scan/provider.go:54
↓ 10 callersFunctionNewWorkspaceProvider
NewWorkspaceProvider creates a Provider for workspace mode (current uncommitted changes).
internal/diff/git.go:87
↓ 10 callersFunctionParseDiffText
ParseDiffText splits the unified diff text into per-file Diff structs. ref, if non-empty, is a git ref used to read new-file content via git show inst
internal/diff/parser.go:33
↓ 10 callersMethodRecordReviewItemFailed
RecordReviewItemFailed persists an incomplete file-level checkpoint.
internal/session/history.go:295
↓ 10 callersFunctionSessionTaskKey
SessionTaskKey derives the prompt-cache affinity key for one task conversation within a session. Prompt caches match on prefixes, and OCR's task types
internal/llm/sessionkey.go:51
↓ 10 callersMethodSetRunFailure
SetRunFailure records why the whole run stopped. It rejects an invalid class (so an unclassifiable stop is never silently downgraded) and a change of
internal/session/manifest.go:415
↓ 10 callersMethodbeginAPIKeyReplace
beginAPIKeyReplace switches from the fixed-length mask placeholder to edit mode so the next keystroke or paste fully replaces the saved key. While edi
cmd/opencodereview/provider_tui.go:898
↓ 10 callersMethodbuildGrepArgs
(searchText string, caseSensitive bool, usePerlRegexp bool, noIndex bool, pathspec []string)
internal/tool/code_search.go:58
↓ 10 callersFunctiondefaultConfigPath
Default config file location: ~/.opencodereview/config.json
cmd/opencodereview/config_cmd.go:91
↓ 10 callersFunctionexpandBraces
expandBraces turns "{a,b,c}" style patterns into individual strings. e.g. "*.go.{java,kotlin}" → ["*.go.java", "*.go.kotlin"]. If no braces exist, ret
internal/config/rules/system_rules.go:172
↓ 10 callersFunctiongitCommitFile
gitCommitFile writes a file and commits it, returning after the commit lands.
cmd/opencodereview/delegate_exec_test.go:51
↓ 10 callersFunctioninitTestRepo
(t *testing.T)
internal/scan/provider_test.go:84
↓ 10 callersFunctionloadCommonContext
loadCommonContext validates the working directory, loads the embedded template, raises MaxToolRequestTimes when maxTools exceeds the default, resolves
cmd/opencodereview/shared.go:72
↓ 10 callersFunctionmakeDiff
()
internal/diff/relocation_test.go:44
↓ 10 callersFunctionmatchConsecutive
matchConsecutive scans sideLines for a consecutive run matching all targetLines.
internal/diff/resolver.go:217
↓ 10 callersFunctionnewFakeLLM
newFakeLLM returns a server that succeeds on the first attempt for every file. rateLimitOnce and hardFail are set by the caller before use.
cmd/opencodereview/retry_fake_llm_test.go:47
↓ 10 callersFunctionnewTestClient
(name string, tools []*mcp.Tool)
internal/mcp/provider_test.go:14
↓ 10 callersFunctionreadWorkspaceFileForDiff
(repoDir, relPath string)
internal/diff/workspace_file.go:14
↓ 10 callersFunctionresolveUsage
resolveUsage parses raw JSON bytes into a map and extracts token usage by probing configured paths sequentially. Returns nil if no total_tokens found.
internal/llm/usage_resolver.go:76
↓ 10 callersFunctionretryTestRepo
retryTestRepo builds a two-file repo with one reviewable commit range (HEAD~1..HEAD), each file carrying its own marker in the second commit only.
cmd/opencodereview/retry_fake_llm_test.go:142
↓ 10 callersFunctionsilenceStdout
silenceStdout redirects os.Stdout to /dev/null for the duration of fn so the delegate commands' Printf output does not clutter test logs.
cmd/opencodereview/delegate_exec_test.go:66
↓ 10 callersFunctionstartFakeLLM
startFakeLLM starts srv and points the OCR_LLM_* endpoint resolution at it, with HOME/XDG_CONFIG_HOME redirected so the developer's real config and se
cmd/opencodereview/retry_fake_llm_test.go:173
↓ 10 callersFunctiontaskDoneResponse
()
internal/llmloop/loop_test.go:62
← previousnext →101–200 of 4,238, ranked by callers